check_save_version#

class check_save_version(expected=None, filename=None, die=False, verbose=True, **kwargs)[source]#

A convenience function that bundles check_version with git_info and saves automatically to disk from the calling file. The idea is to put this at the top of an analysis script, and commit the resulting file, to keep track of which version of HPVsim was used.

Parameters:
  • expected (str) – expected version information

  • filename (str) – file to save to; if None, guess based on current file name

  • kwargs (dict) – passed to git_info(), and thence to sc.savejson()

Examples:

hpv.check_save_version()
hpv.check_save_version('1.3.2', filename='script.gitinfo', comments='This is the main analysis script')
hpv.check_save_version('1.7.2', folder='gitinfo', comments={'SynthPops':sc.gitinfo(sp.__file__)})