-
Notifications
You must be signed in to change notification settings - Fork 79
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
Minuit.interactive outside of Jupyter notebooks #1056
base: develop
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@adryyan I reviewed this PR, but you also made another where you don't change the plotting API. I prefer the other one, as expressed here. I think we need a few iterations, but I generally appreciate your effort very much. This is a significant contribution. |
@HDembinski Thank you for your comments; I will go through them in the next weeks. |
I still don't understand: the associated ipywidget with that Lines 209 to 224 in 811b27b
In the interactive call raise_on_exception is set to true, so the ipywidget shouldn't catch the exception? Or am I missing something?
|
Ok, I will check this more thoroughly to give you a proper answer. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
except AttributeError: | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is not necessary, the object returned by get_ipython always has the "has_trait" method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have thought so as well, but when calling get_ipython() not in a jupyter notebook / ipython session, it just returns None and that of course has no attribute has_trait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then please add a comment since this is surprising.
@adryyan We are coming to the finish line. Thank you for all the hard work! This is a significant addition to iminuit, and I praise your improvements to the fitting GUI and your nice unit tests. I will mimic the new GUI in a separate PR at some later point in the ipywidget widget. The last step is to make sure that all tests pass, then we can merge this PR. I took a glance, and the failures that I see seem minor and should be easy to fix. |
This one looks a bit tricky https://github.com/scikit-hep/iminuit/actions/runs/12353782099/job/34473645329?pr=1056#step:9:41 If you cannot figure it out, I will handle that one. |
Thank you for all your input, I learned some new things and I feel like the code is much cleaner now. I don't really have any experience with nox, but the problems look to me like there are issues with the installed packages and importskips. I moved all tests regarding the qtwidget into one file and put the importskip of pyqt6 before the test functions, because of the qtbot (pytest-qt). I did the same with the ipywidget tests, because the mock_ipython fixture fails if there is no IPython. But I think the actions would also need to be updated to install the necessary packages, so that the qtwidget can be tested (PyQt6, pytest-qt), but I am not sure how to do that. |
Yes, it should not have anything to do with nox. This looks like the image is missing a dependency. In fact, that error occurs in the doc build as well, but does not cause a failure: The Test / X tests only check the basic functionality, that's why they do not expose this issue. |
Implementation of a PyQt6 widget for
minuit.interactive
(Issue #771 ). In order to make the plotting work properly, I changed the API for thevisualize
methods of the build-in cost functions so that they optionally accept matplotlibAxes
objects (and forCostSum
s aFigure
). If these arguments don't receive a value,pyplot
is used. This should keep the disruption of existing code as minimal as I could manage.