Skip to content

Commit

Permalink
sagemathgh-38294: Filter out R warnings
Browse files Browse the repository at this point in the history
These are causing some doctest failures after
sagemath#35396

```
**********************************************************************
File "/usr/lib/python3.12/site-packages/sage/interfaces/r.py", line 51,
in sage.interfaces.r
Failed example:
    v = 2*x+y+1; v
Expected:
    [1] 32.2 17.8 10.3 20.2 66.1 21.8 22.6 12.8 16.9 50.8 43.5
Got:
    R[write to console]: Además:
    R[write to console]: Aviso:
    <BLANKLINE>
    R[write to console]: In sage10 + sage6 :
    R[write to console]:
    <BLANKLINE>
    R[write to console]:  longitud de objeto mayor no es múltiplo de la
longitud de uno menor
    <BLANKLINE>
     [1] 32.2 17.8 10.3 20.2 66.1 21.8 22.6 12.8 16.9 50.8 43.5
**********************************************************************
File "/usr/lib/python3.12/site-packages/sage/interfaces/r.py", line 78,
in sage.interfaces.r
Failed example:
    r(-17).sqrt()
Expected:
    [1] NaN
Got:
    R[write to console]: Además:
    R[write to console]: Aviso:
    <BLANKLINE>
    R[write to console]: In sqrt(sage10) :
    R[write to console]:  Se han producido NaNs
    <BLANKLINE>
    [1] NaN
**********************************************************************
File "/usr/lib/python3.12/site-packages/sage/interfaces/r.py", line 356,
in sage.interfaces.r._setup_r_to_sage_converter
Failed example:
    r(-17).sqrt().sage()
Expected:
    nan
Got:
    R[write to console]: Además:
    R[write to console]: Aviso:
    <BLANKLINE>
    R[write to console]: In sqrt(sage4) :
    R[write to console]:  Se han producido NaNs
    <BLANKLINE>
    nan
**********************************************************************
```

URL: sagemath#38294
Reported by: Antonio Rojas
Reviewer(s): Matthias Köppe
  • Loading branch information
Release Manager committed Jul 13, 2024
2 parents 2e5cb46 + ea502bf commit 28d8530
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tarball=configure-VERSION.tar.gz
sha1=a78a0025292f4831f84dc059734320de0e66e216
sha256=c108de2bfbbf3f2543ada5742d5bc9a58df700d8b6125df92b1888f867b60174
sha1=3ac8463056eddf76253b193268a2d5c49fab2f52
sha256=62eb8b415d33c1ab6611333f2767d711c1c5fd0048830d47d41d15fbe53c3093
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
74119807d7989c879f2eee167e4e29af7c4f588a
c1c19a8f29e6afcb0c22dfca59e1d0c34932be9c
6 changes: 6 additions & 0 deletions src/sage/doctest/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,12 @@ def do_fixup(self, want, got):
got = ld_pie_warning_regex.sub('', got)
did_fixup = True

if "R[write to console]" in got:
# Supress R warnings
r_warning_regex = re.compile(r'R\[write to console\]:.*')
got = r_warning_regex.sub('', got)
did_fixup = True

if "Overriding pythran description" in got:
# Some signatures changed in numpy-1.25.x that may yet be
# reverted, but which pythran would otherwise warn about.
Expand Down

0 comments on commit 28d8530

Please sign in to comment.