Skip to content

improve units handling #44

Description

@chrishavlin

The units parsing doesn't currently handle composite unit combinations. Should adjust the following to try to parse the unit strings and allow them through if unyt understands:

def _find_units(self, xr_ds) -> dict:
units = {}
for field in self.fields:
unit = getattr(xr_ds[field], "units", "")
if unit != "" and hasattr(unyt.unit_symbols, unit) is False:
unit = ""
units[field] = unit
return units

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions