Skip to content

1577 Add generic Time Series Plotting function - #1589

Open
kilianvolmer wants to merge 5 commits into
mainfrom
1577-Create-a-standard-plot-for-timeseries-objects
Open

kilianvolmer wants to merge 5 commits into
mainfrom
1577-Create-a-standard-plot-for-timeseries-objects

Conversation

@kilianvolmer

@kilianvolmer kilianvolmer commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Changes and Information

Please briefly list the changes (main added features, changed items, or corrected bugs) made:

  • New function to create a dataframe from a time series
  • New Plot time series function
  • Added new specific example and reworked three old examples to use new plot function

If need be, add additional information and what the reviewer should look out for in particular:

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below).
  • New code adheres to coding guidelines.
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.).
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP).
  • Appropriate documentation within the code (Doxygen) for new functionality has been added in the code.
  • Appropriate external documentation (ReadTheDocs) for new functionality has been added to the online documentation and checked in the preview.
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added.
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed.
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.).
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease).
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.).
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

Closes #1577

@kilianvolmer
kilianvolmer requested a balanced review from Copilot September 30, 2026 09:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kilianvolmer
kilianvolmer requested a balanced review from Copilot September 30, 2026 09:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.47%. Comparing base (2664e8c) to head (dfd0ff4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1589      +/-   ##
==========================================
- Coverage   97.48%   97.47%   -0.02%     
==========================================
  Files         190      190              
  Lines       16035    16035              
==========================================
- Hits        15632    15630       -2     
- Misses        403      405       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kilianvolmer
kilianvolmer requested a balanced review from Copilot September 30, 2026 11:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@HenrZu HenrZu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for this great addition. Just some short comments.

I think one limitation of this package is, that we need to install this additionally to the simulation package, as some of the examples even require the plot package to be installed.

It would be great, if we add this as an optional dependency in the pyproject toml of the simulation package.

[project.optional-dependencies]
dev = []
plot = ["memilio-plot"]

Also, the plot packages requires (requires-python = ">=3.9") and the simulation package has (requires-python = ">=3.8"). (however PyPI says >=3.9)

Comment thread docs/source/python/m-plot.rst Outdated
region_results = [region0_result, region1_result]
region_labels = ['Region 0', 'Region 1']

# All compartments of each region on a logarithmic axis.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add the log_scale=True

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good catch. I removed this on purpose but forgot about the comment. Do you want it to be plotted on a log axis?

Comment thread pycode/examples/plot/plotSimulationResults.py Outdated
Comment thread pycode/memilio-plot/memilio/plot/plotTimeSeries.py
Comment thread pycode/examples/simulation/ode_secir_groups.py
Comment thread pycode/examples/simulation/ode_secir_groups.py
@kilianvolmer
kilianvolmer requested a balanced review from Copilot October 1, 2026 09:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kilianvolmer

Copy link
Copy Markdown
Contributor Author

Thank you for this great addition. Just some short comments.

I think one limitation of this package is, that we need to install this additionally to the simulation package, as some of the examples even require the plot package to be installed.

It would be great, if we add this as an optional dependency in the pyproject toml of the simulation package.

[project.optional-dependencies]
dev = []
plot = ["memilio-plot"]

Also, the plot packages requires (requires-python = ">=3.9") and the simulation package has (requires-python = ">=3.8"). (however PyPI says >=3.9)

Thank you for the comment! I will add it as a dependency. However, I think we should also think about actually adding the plot package to our pypi package now.

@kilianvolmer
kilianvolmer requested a review from HenrZu October 2, 2026 11:31

This branch has not been deployed

No deployments
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.

Create a standard plot for timeseries objects

3 participants