-
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. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@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. |
for more information, see https://pre-commit.ci
Fixing the CI issue turns out to be difficult. I am getting segfaults when the PyQt code is executed, presumably because there is a mismatch between the versions of libraries that Qt links to at run-time and those which the PyQt Python package was build against. I found this nice install qt action, which should avoid exactly that issue, but it does not work. It is always annoying when the error only appears on CI, that makes debugging difficult. One way to fix this is to install all the required packages with conda/mamba, then all the external libs should be consistent with the libs used to build the python package. Another idea is to port this all to PySide, which is now officially supported by Qt. Although it is not clear whether that would avoid the issue. |
Changing from PyQt6 to PySide6 is quite easy in the code, so it doesn't hurt to try (a817bc9). |
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.