Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

esmlab operations clobber existing ds.attrs['history'] values #159

@klindsay28

Description

@klindsay28

Is your feature request related to a problem? Please describe.
The following commands

ds = xr.open_dataset('/glade/work/klindsay/analysis/CESM2_coup_carb_cycle_JAMES/tseries/FG_CO2_ocn_piControl_00.nc')
print(ds.attrs['history'])
ds_ann = esmlab.resample(ds, freq='ann')
print(ds_ann.attrs['history'])

yield the output

created by /glade/work/klindsay/analysis/CESM2_coup_carb_cycle_JAMES/tseries_mod.py at 2019-10-24 20:32:05 UTC

and

2019-10-30 15:28:45.220584 esmlab.resample(<DATASET>, freq="ann")

Describe the solution you'd like
I think it would be useful to prepend to existing history content, instead of overwriting it, if it exists.

This behavior would be consistent with NCO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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