Skip to content

easyscience.math scipp min version #355

Open

Description

@markbujehein

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 arctan check cannot use hasattr(sc, ...), because sc.atan exists in the broken
    version. It has to compare sc.__version__ with a cutoff, and the cutoff is not known.
  • C. For arctan the variance is var_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, arccos and the other inverse functions would need the same checks. They were
    probed only at x = 1.
  • D. sinc exists from 26.3.1 on. Dropping it solves the ImportError but not the wrong
    arctan variance.

Not verified

  • The slow integration tests (everything not marked fast).
  • Which Scipp release fixed atan.

Related

Activity

  1. added
    [scope] ⚠️ label needed
    [priority] ⚠️ label needed
    on Nov 2, 2026
  2. damskii9992 commented on Nov 2, 2026

    @damskii9992
    Contributor

    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.

  3. markbujehein commented on Nov 2, 2026

    @markbujehein
    CollaboratorAuthor

    Whoops, you're right. Added it as a sub-issue!

  4. added
    [priority] medium
    [scope] maintenance
    and removed
    [scope] ⚠️ label needed
    [priority] ⚠️ label needed
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [priority] medium[scope] maintenance

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions