git_info#

class git_info(filename=None, check=False, comments=None, old_info=None, die=False, indent=2, verbose=True, frame=2, **kwargs)[source]#

Get current git information and optionally write it to disk. Simplest usage is cv.git_info(__file__)

Parameters:
  • filename (str) – name of the file to write to or read from

  • check (bool) – whether or not to compare two git versions

  • comments (dict) – additional comments to include in the file

  • old_info (dict) – dictionary of information to check against

  • die (bool) – whether or not to raise an exception if the check fails

  • indent (int) – how many indents to use when writing the file to disk

  • verbose (bool) – detail to print

  • frame (int) – how many frames back to look for caller info

  • kwargs (dict) – passed to sc.loadjson() (if check=True) or sc.savejson() (if check=False)

Examples:

cv.git_info() # Return information
cv.git_info(__file__) # Writes to disk
cv.git_info('covasim_version.gitinfo') # Writes to disk
cv.git_info('covasim_version.gitinfo', check=True) # Checks that current version matches saved file