Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate/fix rpy2 tests #35396

Merged
merged 13 commits into from
Jun 22, 2024
Merged

Conversation

mkoeppe
Copy link
Member

@mkoeppe mkoeppe commented Mar 30, 2023

📚 Description

As a follow-up on:

we make rpy2 a dynamically detected feature, enabling the automatic run of doctests tagged # optional - rpy2; we use a file-level doctest tag for the r.py file.

We also update the spkg documentation for #35347

Resolves #35347

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@github-actions
Copy link

github-actions bot commented Apr 16, 2023

Documentation preview for this PR (built with commit 11833d8; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 8, 2024

Otherwise lgtm.

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 9, 2024

There is a genuine failure:

sage -t --random-seed=30511447838430634235757231865836227899 src/sage/interfaces/r.py
**********************************************************************
File "src/sage/interfaces/r.py", line 1312, in sage.interfaces.r.R.plot
Failed example:
    r.library("lattice")
Exception raised:
    Traceback (most recent call last):
      File "/Users/runner/work/sage/sage/src/sage/doctest/forker.py", line 714, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/runner/work/sage/sage/src/sage/doctest/forker.py", line 1146, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.interfaces.r.R.plot[5]>", line 1, in <module>
        r.library("lattice")
      File "/Users/runner/work/sage/sage/src/sage/interfaces/r.py", line 860, in library
        raise ImportError("R library {} not installed".format(library_name))
    ImportError: R library lattice not installed

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 9, 2024

Is that from the conda test?

I added the package name here, but that will only take effect after updating the conda-lock files (as done and to be redone in #37998)

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 9, 2024

OK.

Thanks.

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 9, 2024

Thanks!

vbraun pushed a commit to vbraun/sage that referenced this pull request Jun 10, 2024
    
<!-- Please provide a concise, informative and self-explanatory title.
-->
<!-- Don't put issue numbers in the title. Put it in the Description
below. -->
<!-- For example, instead of "Fixes sagemath#12345", use "Add a new method to
multiply two integers" -->

### 📚 Description

<!-- Describe your changes here in detail. -->

As a follow-up on:
- sagemath#35237

we make `rpy2` a dynamically detected feature, enabling the automatic
run of doctests tagged `# optional - rpy2`; we use a file-level doctest
tag for the `r.py` file.

We also update the spkg documentation for sagemath#35347

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->

Resolves sagemath#35347

<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#35237
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#35396
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Jun 16, 2024
    
<!-- Please provide a concise, informative and self-explanatory title.
-->
<!-- Don't put issue numbers in the title. Put it in the Description
below. -->
<!-- For example, instead of "Fixes sagemath#12345", use "Add a new method to
multiply two integers" -->

### 📚 Description

<!-- Describe your changes here in detail. -->

As a follow-up on:
- sagemath#35237

we make `rpy2` a dynamically detected feature, enabling the automatic
run of doctests tagged `# optional - rpy2`; we use a file-level doctest
tag for the `r.py` file.

We also update the spkg documentation for sagemath#35347

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->

Resolves sagemath#35347

<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#35237
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#35396
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Jun 16, 2024
    
<!-- Please provide a concise, informative and self-explanatory title.
-->
<!-- Don't put issue numbers in the title. Put it in the Description
below. -->
<!-- For example, instead of "Fixes sagemath#12345", use "Add a new method to
multiply two integers" -->

### 📚 Description

<!-- Describe your changes here in detail. -->

As a follow-up on:
- sagemath#35237

we make `rpy2` a dynamically detected feature, enabling the automatic
run of doctests tagged `# optional - rpy2`; we use a file-level doctest
tag for the `r.py` file.

We also update the spkg documentation for sagemath#35347

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->

Resolves sagemath#35347

<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#35237
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#35396
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
@vbraun vbraun merged commit 0df98b3 into sagemath:develop Jun 22, 2024
31 of 42 checks passed
@mkoeppe mkoeppe deleted the doctest_clean_namespace branch June 22, 2024 20:12
antonio-rojas added a commit to antonio-rojas/sage that referenced this pull request Jun 27, 2024
These are causing some doctest failures after sagemath#35396
@mkoeppe mkoeppe added this to the sage-10.4 milestone Jul 8, 2024
vbraun pushed a commit to vbraun/sage that referenced this pull request Jul 13, 2024
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
vbraun pushed a commit to vbraun/sage that referenced this pull request Jul 16, 2024
    
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpy2: Document that it is a "semistandard" package
3 participants