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

build: Update lower bound on iminuit to v2.7.0 #1895

Merged
merged 3 commits into from
Jun 23, 2022

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Jun 23, 2022

Description

This was caught in the Minimum supported dependencies workflow after PR #1845 was merged.

Update lower bound on iminuit to v2.7.0 as it is the 'oldest' SemVer release that has the behavior (as described in the iminiuit v2.7.0 changelog):

Minuit.hesse no longer sets the status of the FunctionMinimum unconditionally to valid if it was invalid before.

Without this fix, the situation can arise where Minuit.hesse() can cause Minuit.valid to be True when it should be False. Specifically in

if minimizer.valid:
# Extra call to hesse() after migrad() is always needed for good error estimates. If you pass a user-provided gradient to MINUIT, convergence is faster.
minimizer.hesse()
hess_inv = minimizer.covariance
corr = hess_inv.correlation()
unc = minimizer.errors

during

pytest tests/test_pdf.py -k test_pdf_clipping[numpy_minuit]

def test_pdf_clipping(backend):

Also update tests/constraints.txt to use iminuit==2.7.0.

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 lower bound on iminuit to v2.7.0 as it is the 'oldest' SemVer release
that has the behavior:
> Minuit.hesse no longer sets the status of the FunctionMinimum unconditionally
> to valid if it was invalid before.

Without this fix, the situation can arise where `Minuit.hesse()` can cause
`Minuit.valid` to be True when it should be False.
* Update tests/constraints.txt to use iminuit==2.7.0.
* Amends PR #1845

* Update lower bound on iminuit to v2.7.0 as it is the 'oldest' SemVer release
that has the behavior:
> Minuit.hesse no longer sets the status of the FunctionMinimum unconditionally
> to valid if it was invalid before.

Without this fix, the situation can arise where `Minuit.hesse()` can cause
`Minuit.valid` to be True when it should be False.

            # Extra call to hesse() after migrad() is always needed for good error estimates. If you pass a user-provided gradient to MINUIT, convergence is faster.
            minimizer.hesse()
            hess_inv = minimizer.covariance
>           corr = hess_inv.correlation()
E           AttributeError: 'NoneType' object has no attribute 'correlation'
@matthewfeickert matthewfeickert added fix A bug fix build Changes that affect the build system or external dependencies labels Jun 23, 2022
@matthewfeickert matthewfeickert self-assigned this Jun 23, 2022
@matthewfeickert matthewfeickert added the dependencies Pull requests that update a dependency file label Jun 23, 2022
@matthewfeickert
Copy link
Member Author

Minimum supported dependencies workflow is passing now. 👍

@codecov
Copy link

codecov bot commented Jun 23, 2022

Codecov Report

Merging #1895 (6d988e0) into master (2411ed3) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1895   +/-   ##
=======================================
  Coverage   98.17%   98.17%           
=======================================
  Files          68       68           
  Lines        4331     4331           
  Branches      730      730           
=======================================
  Hits         4252     4252           
  Misses         46       46           
  Partials       33       33           
Flag Coverage Δ
contrib 26.34% <ø> (ø)
doctest 60.63% <ø> (ø)
unittests-3.10 96.05% <ø> (ø)
unittests-3.7 96.03% <ø> (ø)

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


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2411ed3...6d988e0. Read the comment docs.

@matthewfeickert matthewfeickert merged commit d825d5a into master Jun 23, 2022
@matthewfeickert matthewfeickert deleted the test/update-iminuit-lower-bound branch June 23, 2022 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Changes that affect the build system or external dependencies dependencies Pull requests that update a dependency file fix A bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants