calliope icon indicating copy to clipboard operation
calliope copied to clipboard

No unit for `global_expressions` set, even if schema requires

Open jnnr opened this issue 1 year ago • 2 comments

What happened?

Just as variables do, global_expressions should state their unit. Among others, this makes life easier when post-processing results.

It seems like unit is required for both variables and global_expressions (https://github.com/calliope-project/calliope/blob/main/src/calliope/config/math_schema.yaml), but in base math, only the units of variables are specified.

Which operating systems have you used?

  • [ ] macOS
  • [ ] Windows
  • [X] Linux

Version

v0.7.0

Relevant log output

No response

jnnr avatar Aug 15 '24 12:08 jnnr

The schema doesn't require it, just provides the rules it must follow if it is defined. It's the same with "title" and "description". It's probably good practice for us to have them defined for all of our pre-defined math components, but I wouldn't require it for user-defined components since it's just metadata (the user can decide if they care to have it).

brynpickering avatar Aug 16 '24 09:08 brynpickering

Thanks for clarifying! I agree, it is good practice. I can open a PR adding that metadata to our base math.

jnnr avatar Aug 19 '24 12:08 jnnr

We should make sure all of our base math has units or specifies them units should remain as an optional setting in the schema though.

irm-codebase avatar Jul 31 '25 08:07 irm-codebase