champpy.ParamsLoader

The ParamsLoader class is used to load existing model parameters ModelParams required as input for the mobility model MobModel.

Basic workflow:

  1. Create an instance of the ParamsLoader class

  2. Call load_info() to check what parameters are available

  3. Select parameters by choosing the corresponding id_params

  4. Call load_params() with the selected id_params

The model parameters ModelParams have the following structure:

ModelParams
├── df    # Dataframe holding the model parameters
└── info  # Meta information about the parameters

To generate new model parameters, please use the Parameterizer class.

class champpy.ParamsLoader(user_name=None)[source]

Class for loading pre-calculated parameters for the mobility model.

The ParamsLoader is a factory class to load pre-calculated parameters for the mobility model. The parameters are loaded from parquet files stored in the repository. Basic workflow to load existing parameters:

  1. Create an instance of the ParamsLoader class

  2. Call load_info() to check what parameters are available

  3. Select parameters by choosing the corresponding id_params

  4. Call load_params() with the selected id_params

Examples

>>> loader = ParamsLoader()
>>> info_df = loader.load_info()
>>> params = loader.load_params(id_params=1)
classmethod deep_to_numpy(arr)[source]

Recursively convert nested lists or object arrays to float numpy arrays.

load_info()[source]

Load info DataFrame from all available parameter sets.

Returns:

DataFrame containing metadata for all available parameter sets

Return type:

DataFrame

load_params(id_params=None)[source]

Load existing ModelParams.

Parameters:

id_params (int) – Unique identifier for the parameter set to be loaded. Must correspond to an existing entry in the info DataFrame.

Returns:

Loaded model parameters and stored in ModelParams

Return type:

ModelParams