Repository navigation
Open
Labels
[priority] mediumNormal/default priority[scope] maintenanceCode/tooling cleanup, no feature or bugfix (major.minor.PATCH)
Description
Problem
The supported functions of easyscience.math module #329 is the highly dependent on the version of Scipp :
- sc.sinc does not exist before scipp 26.3.1, so import easyscience fails with AttributeError.
- sc.atan returns variance = inf in scipp 26.3.1 for x = 1.0, variance = 0.01. Scipp 26.9.0 returns 0.0025, the correct value (1/(1+x²))² · σ².
Evidence
Built wheel of the branch, installed in a scratch environment with Scipp pinned. Tests: the unit
tests and the integration tests marked fast.
| Scipp | Python | Result |
|---|---|---|
| 25.11.0 | 3.12 | 30 collection errors (sc.sinc missing) |
| 25.11.0 | 3.14 | not installable: no wheel, the source build failed |
| 26.3.1 | 3.12 | 5 unit and 2 integration failures, all tied to arctan |
| 26.3.1 | 3.14 | 5 unit and 2 integration failures, same tests |
| 26.7.0 | 3.12 | 1887 passed, 1 skipped (unit); 102 passed, 1 xfailed (integration) |
| 26.7.0 | 3.14 | 1887 passed, 1 skipped (unit); 102 passed, 1 xfailed (integration) |
No Scipp release exists between 26.3.1 and 26.7.0. It is not known which change fixed atan.
Releases before 26.3.1 were not tested for atan because sinc already prevents the import.
Alternatives
| Fix | Supports Scipp | Code cost | Risk | |
|---|---|---|---|---|
| A | Raise the floor to scipp>=26.7.0 |
26.7.0 and newer | one line in pyproject.toml |
Excludes users on older Scipp. Tested (see above). |
| B | Keep a low floor and raise a clear error when Scipp is too old | 25.11.0 and newer, but sinc and arctan raise on old versions |
version check, error message, tests against old Scipp | Package installs with two broken functions. CI needs an old-Scipp job to prove it. |
| C | Implement sinc and the arctan variance in EasyScience |
25.11.0 and newer, fully working | second implementation of two functions, kept in sync with Scipp | Replaces the thin wrapper over Scipp. The inverse functions need checking for the same kind of bug. |
| D | Leave sinc out of es.math for now |
25.11.0 and newer for the rest | remove one function | Does not fix arctan. sinc is part of PR #329. |
| E | Fail at import with a message if Scipp is too old | adds a guard on top of A | a few lines at import time | Only helps installs that bypass pip's resolver (conda, vendored Scipp). Not a fix on its own. |
Caveats identified
- B. The
arctancheck cannot usehasattr(sc, ...), becausesc.atanexists in the broken
version. It has to comparesc.__version__with a cutoff, and the cutoff is not known. - C. For
arctanthe variance isvar_in / (1 + x²)², plain Scipp arithmetic. Because the
bug cannot be detected by feature, the code would either always run or sit behind a version
check.arcsin,arccosand the other inverse functions would need the same checks. They were
probed only atx = 1. - D.
sincexists from 26.3.1 on. Dropping it solves theImportErrorbut not the wrong
arctanvariance.
Not verified
- The slow integration tests (everything not marked
fast). - Which Scipp release fixed
atan.
Related
Metadata
Metadata
Assignees
Labels
[priority] mediumNormal/default priority[scope] maintenanceCode/tooling cleanup, no feature or bugfix (major.minor.PATCH)
Activity
damskii9992 commentedon Nov 2, 2026
This shouldn't really be a new issue, but rather an addendum to the math module issue.
I'm in favour or simply raising the min scipp version. But please find the lowest version which works, so that we can set the min properly.
Parameters such assinandcos#201markbujehein commentedon Nov 2, 2026
Whoops, you're right. Added it as a sub-issue!