Skip to content

Documentation for ticktack

save_model(carbon_box_model, filename)

Saves the Carbon Box Model in a hd5 format with the specified filename. If the first parameter is not of Type CarbonBoxModel, then it throws a ValueError.

Parameters:

Name Type Description Default
carbon_box_model CarbonBoxModel

the model to save.

required
filename str

file name and location where Carbon Box Model needs to be saved. Must have a '.hd5' at end of filename.

required

Raises:

Type Description
ValueError

If the first parameter is not of type CarbonBoxModel.

load_model(filename, production_rate_units='kg/yr', flow_rate_units='Gt/yr')

Loads the saved Carbon Box Model from the relevant filename. Units for both production rate and flow rate can be specified as parameters. filename must be specified with the .hd5 extension.

Parameters:

Name Type Description Default
filename str

the name and location (in one string) of the file where the Carbon Box Model is saved.

required
production_rate_units str

the production rate of the model to be loaded. Defaults to 'kg/yr'.

'kg/yr'
flow_rate_units str

the production rate of the model to be loaded. Defaults to 'Gt/yr'.

'Gt/yr'

Returns:

Type Description
CarbonBoxModel

Carbon Box Model which is generated from the file.

Raises:

Type Description
ValueError

If the flow rate units are not either 'Gt/yr' or '1/yr'.

load_presaved_model(model, production_rate_units='kg/yr', flow_rate_units='Gt/yr')

Loads a pre-saved, commonly used model based on the research papers linked below. The model must be one of the following: Miyake17, Brehm21, Guttler15, Buntgen18. Loads the model based on the units for production rate and flow rate specified.

Parameters:

Name Type Description Default
model str

the name of the model to load. Must be one in [Miyake17, Brehm21, Guttler15, Buntgen18].

required
production_rate_units str

the production rate of the model to be loaded. Defaults to 'kg/yr'.

'kg/yr'
flow_rate_units str

the production rate of the model to be loaded. Defaults to 'Gt/yr'.

'Gt/yr'

Returns:

Type Description
CarbonBoxModel

Carbon Box Model which is generated from the pre-saved file.

Raises:

Type Description
ValueError

If the specified model parameter is not in the required list.