home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 286072335

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
286072335 MDU6SXNzdWUyODYwNzIzMzU= 1809 WRF output : cannot serialize variable 5695215 closed 0     11 2018-01-04T18:23:44Z 2023-09-25T11:30:35Z 2023-09-25T11:30:35Z NONE      

Code Sample, a copy-pastable example if possible

```python md.to_netcdf('modified_wrf_input.nc')


ValueError Traceback (most recent call last) <ipython-input-55-ccba003701f9> in <module>() ----> 1 md.to_netcdf('modified_wrf_input.nc')

/Users/gbromley/anaconda/lib/python3.5/site-packages/xarray/core/dataset.py in to_netcdf(self, path, mode, format, group, engine, encoding, unlimited_dims) 981 return to_netcdf(self, path, mode, format=format, group=group, 982 engine=engine, encoding=encoding, --> 983 unlimited_dims=unlimited_dims) 984 985 def unicode(self):

/Users/gbromley/anaconda/lib/python3.5/site-packages/xarray/backends/api.py in to_netcdf(dataset, path_or_file, mode, format, group, engine, writer, encoding, unlimited_dims) 581 try: 582 dataset.dump_to_store(store, sync=sync, encoding=encoding, --> 583 unlimited_dims=unlimited_dims) 584 if path_or_file is None: 585 return target.getvalue()

/Users/gbromley/anaconda/lib/python3.5/site-packages/xarray/core/dataset.py in dump_to_store(self, store, encoder, sync, encoding, unlimited_dims) 907 if encoding is None: 908 encoding = {} --> 909 variables, attrs = conventions.encode_dataset_coordinates(self) 910 911 check_encoding = set()

/Users/gbromley/anaconda/lib/python3.5/site-packages/xarray/conventions.py in encode_dataset_coordinates(dataset) 1052 non_dim_coord_names = set(dataset.coords) - set(dataset.dims) 1053 return _encode_coordinates(dataset._variables, dataset.attrs, -> 1054 non_dim_coord_names=non_dim_coord_names) 1055 1056

/Users/gbromley/anaconda/lib/python3.5/site-packages/xarray/conventions.py in _encode_coordinates(variables, attributes, non_dim_coord_names) 1015 raise ValueError('cannot serialize coordinates because variable ' 1016 "%s already has an attribute 'coordinates'" -> 1017 % var_name) 1018 attrs['coordinates'] = ' '.join(map(str, coord_names)) 1019

ValueError: cannot serialize coordinates because variable FSA already has an attribute 'coordinates'

```

Problem description

This dataset is the wrfinput_d01 file for use with the WRF model. Reading and modifying the variables worked, but I cannot figure out how to write the changes out to the file. I get the above error. I saw another post about the same issue, but wasn't sure how it was resolved.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1809/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 10 rows from issue in issue_comments
Powered by Datasette · Queries took 322.304ms · About: xarray-datasette