-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fix AMICI hiding all warnings #2243
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously, importing amici would result in all warnings of the program being hidden, due to `logging.captureWarnings(True)`: ```sh $ python -c "import warnings; warnings.warn('bla');" <string>:1: UserWarning: bla $ python -c "import amici; import warnings; warnings.warn('bla');" $ ``` This can't be the desired default. Changes: * Default to not capturing warnings * If warnings are to be captured, at least handle them by amici loggers
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2243 +/- ##
===========================================
- Coverage 76.64% 76.63% -0.02%
===========================================
Files 91 91
Lines 15112 15005 -107
===========================================
- Hits 11583 11499 -84
+ Misses 3529 3506 -23
Flags with carried forward coverage won't be shown. Click here to find out more.
|
FFroehlich
approved these changes
Dec 18, 2023
dweindl
added a commit
to dweindl/AMICI
that referenced
this pull request
Dec 18, 2023
Previously, importing amici would result in all warnings of the program being hidden, due to `logging.captureWarnings(True)`: ```sh $ python -c "import warnings; warnings.warn('bla');" <string>:1: UserWarning: bla $ python -c "import amici; import warnings; warnings.warn('bla');" $ ``` This can't be the desired default. Changes: * Default to not capturing warnings * If warnings are to be captured, at least handle them by amici loggers Closes ICB-DCM/pyPESTO#1252
dweindl
added a commit
that referenced
this pull request
Dec 18, 2023
Improves model code generation by collapsing cases with identical statements. I.e. ``` switch(a) case b: case c: statements; break; ``` instead of ``` switch(a) case b: statements; break; case c: statements; break; ``` For my current model of interest, containing many events, this significantly reduces the generated code: E.g.: ``` 16K my_model/deltasx.cpp 6,6M my_model_old/deltasx.cpp ``` Overall, for this model, I got from 204201 LOC down to 7936 LOC (i.e. -96%). * .. * Apply suggestions from code review Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com> * GHA: test python3.12 (#2179) Run nightly tests also on python3.12 * Deterministic order of event assignments (#2242) Ensure event assignments targets are processed in deterministic order. Otherwise the ordering of state variables may change between subsequent model imports, which we'd like to avoid. Closes #2241. * Fix AMICI hiding all warnings (#2243) Previously, importing amici would result in all warnings of the program being hidden, due to `logging.captureWarnings(True)`: ```sh $ python -c "import warnings; warnings.warn('bla');" <string>:1: UserWarning: bla $ python -c "import amici; import warnings; warnings.warn('bla');" $ ``` This can't be the desired default. Changes: * Default to not capturing warnings * If warnings are to be captured, at least handle them by amici loggers Closes ICB-DCM/pyPESTO#1252 --------- Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
dweindl
added a commit
to dweindl/AMICI
that referenced
this pull request
Jan 16, 2024
Fixes a "unused parameters" warning when using simulate_petab with default parameters. By default, fixed parameters are hard-coded during parameter mapping, and thus, must not be passed to `fill_in_edatas` later on. This warning was swallowed until recently (AMICI-dev#2243).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, importing amici would result in all warnings of the program being hidden, due to
logging.captureWarnings(True)
:This can't be the desired default.
Changes:
Closes ICB-DCM/pyPESTO#1252