mpacts.tools. load_parameters

Module to easily load pickled parameters (e.g. used in a parameter study) to set properties in a simulation object

In order to be able to use this module import it like this:

import mpacts.tools.load_parameters
#or assign it to a shorter name
import mpacts.tools.load_parameters as loa
mpacts.tools.load_parameters.load_parameters(sim, fname='./params.pickle', createNonExisting=True, ignoreNonExisting=False)

Load a file with name ‘fname’ and set matching properties in a simulation object ‘sim’ with the dictionary entries

Parameters:
  • sim – Mpacts simulation tree into which the parameters should be loaded
  • fname (str) – Name of the pickle file in which the parameters are stored
  • createNonExisting (bool) – If ‘True’, non-existing parameters will be created as Variable type tree elements
  • ignoreNonExisting (bool) – If ‘True’ and createNonExisting is ‘False’, non-existing parameters will simply be ignored. If ‘False’ and createNonExisting is ‘False’, an exception will be raised
mpacts.tools.load_parameters.load_pickled_properties(fname)

Open a file with name ‘fname’ and return the unpickled dictionary