zcollection.view.View.add_variable#

View.add_variable(variable)[source]#

Add a variable to the view.

Parameters:

variable (Variable | Variable) – The variable to add

Raises:

ValueError – If the variable already exists

Return type:

None

Example

>>> view.add_variable(
...    zcollection.meta.Variable(
...        "temperature",
...        "float32", ("time", "lat", "lon"),
...        (zcollection.meta.Attribute("units", "degrees Celsius"),
...         zcollection.meta.Attribute("long_name", "temperature")),
...        fill_value=-9999.0))