adsorpy.rsa_config module

Reads the config json.

The config.json contains the standard values for the RSA simulations. They can be changed if the user wants to, however, the most important values can be overridden in the run_simulation module as well.

class adsorpy.rsa_config.RsaConfig(config_path=None, config=None)[source]

Bases: object

Load the RSA config json and parse it for the simulation.

Initialise the config reader.

Parameters:
__init__(config_path=None, config=None)[source]

Initialise the config reader.

Parameters:
__init()
Return type:

None

to_dict()[source]

Return the json as dictionary.

Return type:

dict[str, float | str | int | list[float]]

Returns:

The json as dictionary.

get_item(item, required=True)[source]

Get the item from the json.

Parameters:
  • item (str) – The item to be split into keys.

  • required (bool) – Bool denoting whether it is required.

Return type:

float | str | int | list[float] | dict[str, float | str | int | list[float]] | RsaConfig | None

Returns:

The item from the json.

get_value(item, required=True)[source]

Get the value from the json.

Parameters:
  • item (str) – The item to be split into keys.

  • required (bool) – Bool denoting whether it is required.

Return type:

float | str | int | list[float] | dict[str, float | str | int | list[float]] | RsaConfig | None

Returns:

The value of the item from the json.

__return_key_value(config_value, keys)
Return type:

float | str | int | list[float] | dict[str, float | str | int | list[float]] | RsaConfig | None