Skip to content

Data dimension API behavior on QuantityFactory and State doesn't align #373

@FlorianDeconinck

Description

@FlorianDeconinck

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingRefactorTechnical internal work to improve systems

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions