-
Notifications
You must be signed in to change notification settings - Fork 0
Base stuff #6
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
Base stuff #6
Conversation
* Add a util class for import warnings * Add docstring * Add test * Add context manager Co-authored-by: Marvin Poul <ponder@creshal.de>
Decorating a function with the Deprecator can change its instance attributes (if you pass arguments when decorating). That means that when decorating different functions the warning shown used only the arguments from the last call to the deprecator instance. This is fixed now by copying the deprecator instance before wrapping the given function.
Copy deprecator instance on decorating
We had a pattern for this in multiple places (talking to the database or hdf5 file).
Add numpy equality check for unit tests
add ruff linter
…est -sfp tests/utils/test_error.py
Catching warnings can be janky, e.g. if some upstream dependency starts getting a deprecation warning (possible even depending only on the standard library, as we may update python itself), so provide a private way to convert those warnings into a hard failure for test purposes.
None of it was shared
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more |
Pull Request Test Coverage Report for Build 9272728772Details
💛 - Coveralls |
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 really appreciate deprecation warning to be here, because I always had a hard time finding out where it was stored, and I ended up not using it because I was too lazy, even though I find it super useful.
Co-authored-by: Marvin Poul <ponder@creshal.de>
Co-authored-by: Marvin Poul <ponder@creshal.de>
Co-authored-by: Sam Dareska <37879103+samwaseda@users.noreply.github.com>
Co-authored-by: Sam Dareska <37879103+samwaseda@users.noreply.github.com>
Co-authored-by: Sam Dareska <37879103+samwaseda@users.noreply.github.com>
Per @pmrv's suggestion, adding from
pyiron_base
:ImportAlarm
Deprecator
retry
@pmrv, catching warnings in the tests can be janky -- e.g. because some dependency introduces some deprecation error of its own or whatever -- so I made a private flag to convert the deprecator warnings into hard errors and then test explicitly for that. User facing stuff remains totally unchanged.