Skip to content

Do not write an empty "coordinates" attribute to a netCDF file - #5121

Merged
dcherian merged 4 commits into
pydata:masterfrom
bopen:drop_empty_coordinates_attribute
Apr 7, 2021
Merged

Do not write an empty "coordinates" attribute to a netCDF file#5121
dcherian merged 4 commits into
pydata:masterfrom
bopen:drop_empty_coordinates_attribute

Conversation

@alexamici

@alexamicialexamici commented Apr 6, 2021

Copy link
Copy Markdown
Collaborator
  • No issue, trivial cleanup
  • Tests modified to match

The behaviour is not too problematic as CF checkers don't complain about the empty string, but it is aesthetically annoying.

This happens more frequently after #2844 added the auxiliary variable to .coords.

@dcheriandcherian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alexamici

@keewiskeewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. We could change the comparison, but this doesn't really change the readability so it's your choice. I don't know much about the current behavior so I can't comment on changing the test vs. writing a new one.

Comment threadxarray/conventions.py Outdated
Co-authored-by: keewis <keewis@users.noreply.github.com>
@dcherian
dcherian merged commit e569058 into pydata:masterApr 7, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@alexamici@dcherian@keewis