sc_versioning#

Functions for checking and saving versioning information, such as Python package versions, git versions, etc.

Highlights:

Functions

freeze

Alias for pip freeze.

require

Check whether environment requirements are met.

gitinfo

Retrieve git info

compareversions

Function to compare versions, expecting both arguments to be a string of the format 1.2.3, but numeric works too.

getcaller

Try to get information on the calling function, but fail gracefully.

metadata

Collect common metadata: useful for exactly recreating (or remembering) the environment at a moment in time.

loadmetadata

Read metadata from a saved image; currently only PNG and SVG are supported.

savearchive

Save any object as a pickled zip file, including metadata as a separate JSON file.

loadarchive

Load a zip file saved with sc.savearchive().