There's an inconsistency in the API of data dimensions. When a dimension already exists (in the below example "tracers") the following errors out:
quantity_factory.add_data_dimensions({"tracers": config.NUMBER_OF_TRACERS})
The API rightly tell you to use update if you are sure of what you are doing in order to avoid unintended overrides of values.
But when using state, the following doesn't error:
state = State.empty(quantity_factory, data_dimensions={"tracers": config.NUMBER_OF_TRACERS})
And that's because we "temporarily" swap the dimensions size. This was done before the data dimension refactor on the quantity factory and should be aligned with the new add/update system.
There's an inconsistency in the API of data dimensions. When a dimension already exists (in the below example "tracers") the following errors out:
quantity_factory.add_data_dimensions({"tracers": config.NUMBER_OF_TRACERS})The API rightly tell you to use
updateif you are sure of what you are doing in order to avoid unintended overrides of values.But when using state, the following doesn't error:
state = State.empty(quantity_factory, data_dimensions={"tracers": config.NUMBER_OF_TRACERS})And that's because we "temporarily" swap the dimensions size. This was done before the data dimension refactor on the quantity factory and should be aligned with the new add/update system.