Utility functions (starclass.utilities)

Utility functions.

Code author: Rasmus Handberg <rasmush@phys.au.dk>

starclass.utilities.loadPickle(fname)[source]

Load an object from file using pickle.

Parameters:
  • fname (string) – File name to save to. If the name ends in ‘.gz’ the file will be automatically unzipped.
  • obj (object) – Any pickalble object to be saved to file.
Returns:

The unpickled object from the file.

Return type:

object

starclass.utilities.savePickle(fname, obj)[source]

Save an object to file using pickle.

Parameters:
  • fname (string) – File name to save to. If the name ends in ‘.gz’ the file will be automatically gzipped.
  • obj (object) – Any pickalble object to be saved to file.
starclass.utilities.PICKLE_DEFAULT_PROTOCOL = 2

Default protocol to use for saving pickle files.