-
Notifications
You must be signed in to change notification settings - Fork 20
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
Resolve matplotlib deprecation issue #74
Conversation
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.
Currently, the pre-commit
CI test is failing. You should have this installed in your local repository first, so that the pre-commit hooks run locally, only allowing to commit once the checks pass.
# Given the virtual environment you are working on is activated
pip install pre-commit
pre-commit install
# Now, each time you commit the pre-commit hooks will run only allowing for the commit once all of the tests pass
# Run the following command to run the test prior to commiting for a sanity check
pre-commit run --all-files
Now you would need to run the pre-commit hooks to correct some styling issues and then re-add the files and commit. Otherwise you will get a warning for unstaged files altered by pre-commit
peakdet/editor.py
Outdated
@@ -60,29 +60,36 @@ def __init__(self, data): | |||
delete = functools.partial(self.on_edit, method="delete") | |||
reject = functools.partial(self.on_edit, method="reject") | |||
insert = functools.partial(self.on_edit, method="insert") | |||
|
|||
# Check matplotlib version rectprops is deprecated with matplotlib 3.5.0 and then obsolete | |||
if matplotlib.__version__ >= '3.5.0': |
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.
You need to explicitly import matplotlib
for this. The current imports don't cover this. This is also indicated in the pre-commit
fail
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.
This comparison does not work consistently. E.g. from my ipython session
In [17]: matplotlib.__version__
Out[17]: '3.9.1'
In [18]: matplotlib.__version__ > '3.13.0'
Out[18]: True
In [19]: matplotlib.__version__ > '3.5.0'
Out[19]: True
It should be handle by a module such as packaging.version
or importlib
@smoia
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.
Looks good to me 🚀
Thanks @afni-dglen
🚀 PR was released in |
Closes #
#66 (comment)
Couldn't get rebase to work, so reforked again and put the changes for editor.py and setup.cfg requested in that previous issue.
Proposed Changes
Implement changes for deprecated rectprops with props in matplotlib function call. This version checks for older versions of matplotlib to continue with old behavior.
Also removed some of the constraints on matplotlib in setup.cfg, but kept requirement for some version, consistent with physiobids setup.cfg.
Change Type
bugfix
(+0.0.1)minor
(+0.1.0)major
(+1.0.0)refactoring
(no version update)test
(no version update)infrastructure
(no version update)documentation
(no version update)other
Checklist before review