trac context

Definition

When it runs, every model is provided a context through which it can access parameters, inputs and other resources that are defined in the model schema.

trac context — model interacting with runtime context

Everything defined in the model schema will be available in the context. If the trac runtime cannot provide all the inputs, the model will not launch.

Example methods

Several methods and functions are available for the model to interact with the context, for example:

get_parameter()

Get the value of a model parameter that was defined using define_parameters() method

get_pandas_table()

Get an input defined using the define_inputs() method as a Pandas dataframe

put_pandas_table()

Returns an output defined using the define_output() as a Pandas dataframe

Note

For more details on class methods and helper functions see TracContext in the model API documentation.