xsimlab.any_object(global_name=None, groups=None, description='', attrs=None)

Create a variable used to hold any arbitrary object that needs to be shared with other process classes.

Use this instead of variable() if you need to pass anything other than scalar/array values to other processes (e.g., a callable or an instance of a custom class that have no array-like interface).

Unlike regular variables, ‘object’ variables are not intended to be used as model inputs or outputs. Additionally, a value must be set in the class within which this variable is declared (i.e., intent=’out’).

  • groups (str or list, optional) – Variable group(s).

  • global_name (str, optional) – Name that may be used to retrieve this variable from other processes in a model with global_ref() (model-wise implicit reference). This name must be unique among all global names found in a model.

  • description (str, optional) – Short description of the variable.

  • attrs (dict, optional) – Dictionnary of additional metadata.