-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
Some types of global attributes specifications in the to_xarray method (global_attrs kwarg) are ignored.
What are the steps to reproduce the bug?
import earthkit.data as ekd
ds_fl = ekd.from_source("sample", "pl.grib")
ds = ds_fl.to_xarray(
attrs_mode="fixed",
global_attrs=[
{"centre_fixed": "_ecmf_"},
lambda md: {"centre_callable": md.get("centre")},
"centre",
"key=centreDescription",
{"centre_key": "key=centre"},
],
)
ds.attrsThe current output is:
{'centre_callable': 'ecmf', 'centre_fixed': '_ecmf_'}The excepted output is:
{'centre_callable': 'ecmf',
'centre': 'ecmf',
'centreDescription': 'European Centre for Medium-Range Weather Forecasts',
'centre_key': 'ecmf',
'centre_fixed': '_ecmf_'}Version
main, latest (v0.16.1)
Platform (OS and architecture)
all
Relevant log output
Accompanying data
No response
Organisation
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working