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

add default None -> UserWarning #4747

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

lilyminium
Copy link
Member

@lilyminium lilyminium commented Oct 20, 2024

Fixes #4746

Changes made in this Pull Request:

  • This mimics the Python warnings library by setting category=None to UserWarning by default

We don't appear to test our utilities anywhere so I haven't added a formal test -- but running it with #4744 worked.

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

Developers certificate of origin


📚 Documentation preview 📚: https://mdanalysis--4747.org.readthedocs.build/en/4747/

Copy link

codecov bot commented Oct 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.62%. Comparing base (9b69745) to head (109d99e).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4747      +/-   ##
===========================================
- Coverage    93.65%   93.62%   -0.03%     
===========================================
  Files          175      187      +12     
  Lines        21564    22630    +1066     
  Branches      3023     3023              
===========================================
+ Hits         20195    21188     +993     
- Misses         925      998      +73     
  Partials       444      444              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# https://docs.python.org/3/library/warnings.html#warnings.warn
# if category is None, the default UserWarning is used
if category is None:
category = UserWarning
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is a surprisingly simple fix, very nice. Confirming it also works in my hands.

I'll approve but not merge yet given the release cycle situation.

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be best if this was applied to something in our tests - i.e. some kind of testing by application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MAINT, TST: no_deprecated_call modernization
3 participants