Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Add support for unit-aware xarray #37

@jacobbieker

Description

@jacobbieker

https://xarray.dev/blog/introducing-pint-xarray

Detailed Description

The pint package can now add units to Xarray arrays, and explicitly track the units through operations, etc. This could potentially simplify and unify some of our variable names while enforcing the units we want, and stopping us from mixing up units.

Context

Having consistent units is why we add all the suffixes of wp or mwp etc. and this could be a fix for keeping track of that in a smoother way, e.g. having both GSP and PV system power in the variable power with the units keeping track if its in megawatts or just watts

Possible Implementation

There is one currently lacking thing, in that indexes don't directly support units, just have to access them and select on them using .pint.sel()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions