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

Use warnings.warn instead of logging.warn when loading Problem from H… #1253

Merged
merged 2 commits into from
Jan 18, 2024

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Dec 16, 2023

…DF5 without an Objective

Allows using warnings filters to get rid of this message.

e.g.,

import warnings
warnings.filterwarnings("ignore", category=UserWarning, message=".*You are loading a problem.*", module="pypesto.store.read_from_hdf5")

Wait until next amici release for #1252 to be fixed.

@dweindl dweindl self-assigned this Dec 16, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (65d4ec6) 84.38% compared to head (d2c4e3a) 84.42%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1253      +/-   ##
===========================================
+ Coverage    84.38%   84.42%   +0.04%     
===========================================
  Files          153      153              
  Lines        12450    12451       +1     
===========================================
+ Hits         10506    10512       +6     
+ Misses        1944     1939       -5     

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

'WARNING: You are loading a problem.\nThis problem'
' is not to be used without a separately created'
' objective.'
warnings.warn(
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not logger.warn? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Because then I can't easily silence just this warning

…DF5 without an Objective

Allows using warnings filter to get rid of this message.
@dweindl dweindl merged commit 1eabff1 into ICB-DCM:develop Jan 18, 2024
18 checks passed
@dweindl dweindl deleted the hdf5_problem_obj_warn branch January 18, 2024 13:53
This was referenced Jan 30, 2024
@dweindl dweindl mentioned this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants