question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: to_netcdf does not save attrs

See original GitHub issue

When I store meta data in attrs and call to_netcdf() and then load it subsequently, the meta-data is lost (attrs is empty). Is this expected? Is there a format to save this in so that they stay?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ahartikainencommented, Sep 6, 2022

In to_netcdf function we don’t save it, we only touch groups, so it is a bug in that save function.

0reactions
twieckicommented, Sep 6, 2022

I think it is a bug. idata.attrs is never accessed.

How do you mean, never accessed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

KeyError on saving to NetCDF - due to objects in attrs? #911
Dataset that I'm trying to save out to a NetCDF file. ... check_encoding) 277 # set attributes one-by-one since netCDF4<1.0.10 can't handle ...
Read more >
Arviz's 'to_netcdf' having issues saving my trace object - v4
Hello, I'm trying to save a trace after a six hour model run. ... documentation to use `az.to_netcdf' but when I try to...
Read more >
TypeError when trying to save xarray to netcdf - Stack Overflow
I tried changing the name of the variables by ds_land[1.0].name = 'class_1' etc, but that produces the same error as well. Any ideas...
Read more >
NetCDF User's Guide - Use of the NetCDF Library - C4
In define mode, you can create dimensions, variables, and new attributes, but you cannot read or write variable data. In data mode, you...
Read more >
8 Attributes
An array of LEN attribute values. The data should be of a type appropriate for the function called. You cannot write CHARACTER data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found