Skip to content

1290 add abm visualization from paper to memilio plot #1291

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

xsaschako
Copy link
Member

@xsaschako xsaschako commented May 27, 2025

Changes and Information

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

  • add visualization for the abm runs.

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 for new functionality has been added (Doxygen in the code and Markdown files if necessary)
  • 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).

@xsaschako xsaschako requested review from reneSchm and Copilot May 27, 2025 22:20
@xsaschako xsaschako self-assigned this May 27, 2025
@xsaschako xsaschako linked an issue May 27, 2025 that may be closed by this pull request
2 tasks
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds new visualization modules to support ABM simulation output analysis for infection states and ICU/death comparisons. Key changes include:

  • Introduction of plotAbmInfectionStates.py for visualizing infection states and spatial location types.
  • Introduction of plotAbmICUAndDeadComp.py for comparing ICU occupancy and deaths between simulation results and real-world data.
  • Addition of helper functions for file loading and axis formatting to support the new visualizations.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pycode/memilio-plot/memilio/plot/plotAbmInfectionStates.py New module for plotting infection states and location types from simulation HDF5 data.
pycode/memilio-plot/memilio/plot/plotAbmICUAndDeadComp.py New module for plotting and comparing ICU occupancy and cumulative deaths with real-world data.
Comments suppressed due to low confidence (2)

pycode/memilio-plot/memilio/plot/plotAbmICUAndDeadComp.py:71

  • The variable 'age_grous_string' appears to be misspelled. Consider renaming it to 'age_groups_string' for clarity.
age_grous_string = ['Age 0-4', 'Age 5-14', 'Age 15-34', 'Age 35-59', 'Age 60-79', 'Age 80+'] # Adjust as needed

pycode/memilio-plot/memilio/plot/plotAbmICUAndDeadComp.py:30

  • Consider using a context manager (e.g., 'with h5py.File(..., 'r') as f:') when opening HDF5 files to ensure they are properly closed after reading.
f_p50 = h5py.File(path+"/infection_state_per_age_group/0/p50/Results.h5", 'r')

Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.20%. Comparing base (2d50c90) to head (ab2e0e8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1291   +/-   ##
=======================================
  Coverage   97.20%   97.20%           
=======================================
  Files         167      167           
  Lines       14915    14915           
=======================================
  Hits        14498    14498           
  Misses        417      417           

☔ View full report in Codecov by Sentry.
📢 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.

@mknaranja
Copy link
Member

Thanks for bringing this close to our previous plot style from the assessment paper. @jubicker Could you have a look for the detailed review?

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.

Add abm visualization from paper to MEmilio-plot
2 participants