Skip to content

Produce friendlier errors when dimensions conflict #262

Description

@staadecker

Example:

pyoframe._constants.PyoframeError: Cannot subtract the two expressions below because their
        dimensions are different ([] != ['datetime']).
Expression 1:   Dispatch.sum(…)
Expression 2:   active_load
If this is intentional, use .over(…) to broadcast. Learn more at
        https://bravos-power.github.io/pyoframe/latest/learn/concepts/addition/#adding-expressions-with-differing-dimensions-using-over
pyoframe._constants.PyoframeError: Cannot subtract the two expressions below because expression 1 has extra labels.
Expression 1:   Dispatch
Expression 2:   upper_limit
Extra labels in expression 1:

Ideas of potential text:

pyoframe._constants.PyoframeError: Cannot join expression 1 (dimensionless) with expression 2 (dimensions: ["datetime"]) because dimensions differ. 
Expression 1:   Dispatch.sum(…)
Expression 2:   active_load
Either correct the dimensions or, if the difference is intentional, use .over(...) to broadcast dimensions. Learn more at ...
pyoframe._constants.PyoframeError: Dimensions conflict. Cannot join expressions because expression B has dimension(s) ["datetime"] but not expression A.
Expression A (dimensionless):   Dispatch.sum(…)
Expression B (dimensions: []):   active_load
Either correct the conflict or use the .over(...) join modifier to broadcast the missing dimensions.
pyoframe._constants.PyoframeError: Cannot join expressions because expression 1 has extra labels not present in expression 2. 
Expression 1:   Dispatch
Expression 2:   upper_limit
Extra labels in expression 1:
...
Extra labels may be indicative of a bug in your model. Or, 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumMedium priorityuser-experienceRelated to the quality of the user's experience (e.g., error messages, logs, etc.)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions