misc#

Miscellaneous functions that do not belong anywhere else

Functions

date

Convert any reasonable object -- a string, integer, or datetime object, or list/array of any of those -- to a date object (or string, pandas, or numpy date).

day

Convert a string, date/datetime object, or int to a day (int), the number of days since the start day.

daydiff

Convenience function to find the difference between two or more days.

date_range

Return a list of dates from the start date to the end date.

load_data

Load data for comparing to the model output, either from file or from a dataframe.

load

Convenience method for sc.loadobj() and equivalent to hpv.Sim.load() or hpv.Scenarios.load().

save

Convenience method for sc.saveobj() and equivalent to hpv.Sim.save() or hpv.Scenarios.save().

savefig

Wrapper for Matplotlib's pl.savefig() function which automatically stores HPVsim metadata in the figure.

git_info

Get current git information and optionally write it to disk.

check_version

Get current git information and optionally write it to disk.

check_save_version

A convenience function that bundles check_version with git_info and saves automatically to disk from the calling file.

get_version_pars

Function for loading parameters from the specified version.

get_png_metadata

Read metadata from a PNG file.

get_doubling_time

Alternate method to calculate doubling time (one is already implemented in the sim object).

compute_gof

Calculate the goodness of fit.

help

Get help on HPVsim in general, or search for a word/expression.