Skip to content

Conversation

@kratsg
Copy link
Contributor

@kratsg kratsg commented Nov 4, 2025

Description

Resolves #2593.

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Update central value for test_asymptotic_calculator_has_fitted_par test to
  meet test tolerances, given numerical differences in SciPy v1.16.x from a
  rewrite of optimization routines from Fortran to C.
   - c.f. https://github.com/scikit-hep/pyhf/issues/2593#issuecomment-3410710074
* Update doctests to use `np.isclose` to avoid having to revise exact numerical values.

@kratsg kratsg self-assigned this Nov 4, 2025
@kratsg kratsg added the fix A bug fix label Nov 4, 2025
@matthewfeickert
Copy link
Member

unsure why things have changed in nightly

What's the environment diff?

@matthewfeickert
Copy link
Member

unsure why things have changed in nightly

What's the environment diff?

This is because of the v1.16.3 patch release of SciPy that we requested (#2593 (comment)) to fix #2593. However, it was noted that there were numerical differences between Fortran and C given different compiler optimizations (#2593 (comment)).

It was also suggested that we should try to tune the pytest tolerances (#2593 (comment)) instead of changing the numerical values.

@kratsg
Copy link
Contributor Author

kratsg commented Nov 4, 2025

This is because of the v1.16.3 patch release of SciPy that we requested (#2593 (comment)) to fix #2593. However, it was noted that there were numerical differences between Fortran and C given different compiler optimizations (#2593 (comment)).

It was also suggested that we should try to tune the pytest tolerances (#2593 (comment)) instead of changing the numerical values.

But it's already at rel=1e-3 and the different is larger than that. We can tune the central value to match both...

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.23%. Comparing base (2af4dea) to head (b4516fd).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2631   +/-   ##
=======================================
  Coverage   98.23%   98.23%           
=======================================
  Files          65       65           
  Lines        4198     4198           
  Branches      592      592           
=======================================
  Hits         4124     4124           
  Misses         45       45           
  Partials       29       29           
Flag Coverage Δ
contrib 97.97% <ø> (ø)
doctest 98.09% <ø> (ø)
unittests-3.10 96.28% <ø> (ø)
unittests-3.11 96.28% <ø> (ø)
unittests-3.12 96.28% <ø> (ø)
unittests-3.13 96.28% <ø> (ø)
unittests-3.8 96.28% <ø> (ø)
unittests-3.9 96.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matthewfeickert
Copy link
Member

But it's already at rel=1e-3 and the different is larger than that. We can tune the central value to match both...

Note in #2593 (comment) the absolute difference tolerance is a the level of 1e-7.

@kratsg kratsg changed the title fix: Nightly failure seen fix: Test tolerance for SciPy v1.16.x series tweaked/tuned Nov 4, 2025
@matthewfeickert matthewfeickert changed the title fix: Test tolerance for SciPy v1.16.x series tweaked/tuned test: Update test tolerance for SciPy v1.16.x series Nov 5, 2025
@matthewfeickert matthewfeickert added docs Documentation related tests pytest labels Nov 5, 2025
@github-project-automation github-project-automation bot moved this to In progress in pyhf v0.8.0 Nov 5, 2025
@matthewfeickert matthewfeickert merged commit 97ebaf3 into main Nov 5, 2025
25 checks passed
@matthewfeickert matthewfeickert deleted the fix/nightly branch November 5, 2025 08:07
@github-project-automation github-project-automation bot moved this from In progress to Done in pyhf v0.8.0 Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation related fix A bug fix tests pytest

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

SciPy v1.16.0 gives different numerical results and Singular matrix E in LSQ subproblem

3 participants