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

Improve logging #1907

Merged
merged 16 commits into from
Dec 9, 2022
Merged

Improve logging #1907

merged 16 commits into from
Dec 9, 2022

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Dec 8, 2022

Make it easier for users to filter log messages.

breaking changes:

For Python:
Don't print messages to stdout, but collect them in ReturnData and forward them to python logging, making it easier to filter specific messages or to disable output completely.

For C++:
Don't print messages to stdout, but collect them in ReturnData, and let the user decide what to do with it.

This implies, that messages will no longer be shown as they occur, but only after runAmiciSimulation finishes. Downside: no live output. Upside: We can prefix messages with simulation condition IDs, making it easier to see which where any errors occurred. This is particularly helpful for runAmiciSimulation with multiple conditions.

Also resolves #1550.

Note: This should also allow us to stop using wurlitzer and should resolve any weird output redirection issues that occurred previously. To be done separately.

@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Merging #1907 (dd2fa67) into develop (65212cc) will increase coverage by 0.15%.
The diff coverage is 72.46%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1907      +/-   ##
===========================================
+ Coverage    75.76%   75.92%   +0.15%     
===========================================
  Files           75       76       +1     
  Lines        12913    12928      +15     
===========================================
+ Hits          9784     9815      +31     
+ Misses        3129     3113      -16     
Flag Coverage Δ
cpp 73.03% <68.33%> (+0.20%) ⬆️
petab 59.86% <77.77%> (+0.03%) ⬆️
python 69.03% <100.00%> (+0.06%) ⬆️
sbmlsuite ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
include/amici/model.h 56.00% <ø> (ø)
include/amici/rdata.h 95.00% <ø> (ø)
include/amici/solver.h 83.33% <ø> (ø)
src/steadystateproblem.cpp 84.63% <0.00%> (-0.40%) ⬇️
src/model.cpp 77.44% <33.33%> (-0.09%) ⬇️
src/newton_solver.cpp 71.73% <50.00%> (ø)
src/solver.cpp 76.66% <50.00%> (+0.21%) ⬆️
src/amici.cpp 76.00% <80.00%> (+5.05%) ⬆️
include/amici/logging.h 100.00% <100.00%> (ø)
python/sdist/amici/swig_wrappers.py 95.58% <100.00%> (+0.67%) ⬆️
... and 6 more

@dweindl dweindl marked this pull request as ready for review December 9, 2022 09:02
Copy link
Member

@FFroehlich FFroehlich left a comment

Choose a reason for hiding this comment

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

Fantastic, thanks! Not 100% sure about the severity levels, probably makes sense to double check that on some examples

src/amici.cpp Outdated Show resolved Hide resolved
src/amici.cpp Outdated Show resolved Hide resolved
src/amici.cpp Outdated Show resolved Hide resolved
src/steadystateproblem.cpp Outdated Show resolved Hide resolved
src/steadystateproblem.cpp Outdated Show resolved Hide resolved
src/solver.cpp Outdated Show resolved Hide resolved
src/amici.cpp Outdated Show resolved Hide resolved
src/amici.cpp Outdated Show resolved Hide resolved
dweindl and others added 2 commits December 9, 2022 16:00
Co-authored-by: Fabian Fröhlich <fabian@schaluck.com>
@sonarcloud
Copy link

sonarcloud bot commented Dec 9, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@dweindl dweindl merged commit 59c7255 into develop Dec 9, 2022
@dweindl dweindl deleted the feature_dw_logging branch December 9, 2022 16:45
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.

2 participants