Skip to content

Edits to VPH Output package for Alzheimer's simulation#10

Open
NathanielBlairStahn wants to merge 20 commits intomainfrom
vph-outputs-improvements
Open

Edits to VPH Output package for Alzheimer's simulation#10
NathanielBlairStahn wants to merge 20 commits intomainfrom
vph-outputs-improvements

Conversation

@NathanielBlairStahn
Copy link
Collaborator

Adds some functionality to handle outputs from the Alzheimer's simulation. Much of the additions are for better handling pandas Categoricals, which was necessary for loading some large DataFrames into memory. Other changes are updating column names and adding parameters to functions to make them more flexible.

  • Add some functions in utils.py for dealing with Categoricals and printing memory usage
  • Add explicit reindexing to the difference function to preserve Categoricals and save memory
  • Update hard-coded column names in the extract_transition_states and get_burden functions
  • Add prefilter_query and measure parameters to the ratio function
  • Add a location_col parameter to the VPHOperator constructor, and add location_col and ops parameters to the VPHResults constructor
  • Generalize the describe function to a summarize_draws function which defaults to computing "mean, lower, upper"

Comment on lines +110 to +113
# FIXME: Define the cause column somewhere else that makes
# sense, and deal with different column names in older
# Vivarium models
cause_col = 'entity' # Used to be 'cause'
Copy link

Choose a reason for hiding this comment

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

It seems like at the least we could make this an argument to the function?

Comment on lines 639 to 640
This is a wrapper function for DataFrameGroupBy.describe(),
with `df` grouped by everything except draw and value.
Copy link

Choose a reason for hiding this comment

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

Seems like this is no longer true. I don't understand the reason behind the changes here.

__uri__ = "https://github.com/ihmeuw/vivarium_helpers"

__version__ = "0.4.2"
__version__ = "0.5.0-dev"
Copy link

Choose a reason for hiding this comment

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

We should get this set up with https://pypi.org/project/setuptools-scm/

Copy link

Choose a reason for hiding this comment

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

I bet this is done by #11 😄

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

Comments