-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow global attributes on a Mesh #6085
Comments
Thanks for raising this @jrackham-mo and stating the case clearly. Unfortunately I'm not going to be around for the next 2 weeks. But we had an offline discussion on this, so I'll try to record some of that (see below). |
Regarding the "Conventions" attribute, it's hard-wired in our save code at present, though you can "monkey patch" what it will write by assigning Personally I would be open to discussion on how to better manage this in Iris, as it really could do with more flexibility. |
So, regarding the specific proposal, my initial feeling is that I'm reluctant to supporting global attributes on a mesh. But I'm wondering (hoping) maybe that is proposing a solution in advance of stating the requirement... So, I think the requirement is to handle global (i.e. file-level) attributes when reading and writing meshes to files. Why not global attributes on a Mesh? Whereas, if we just support loading and saving meshes with a keyword to manage global-attributes in a dictionary, I think that would be clear and simple.
( @jrackham-mo would this approach meet your needs, and if not what does this miss ? |
✨ Feature Request
Following the introduction of split local/global attribute handling in Iris 3.8 (PR #5152), it would be useful to have the ability to set global attributes on a Mesh. Setting an attribute on a mesh currently sets a local attribute on the mesh topology variable. Global attributes that do exist on the file (for example added via the python netcdf4 library, or the Conventions attribute that iris always adds on save) are lost on load.
Motivation
The motivation is to be able to add attributes such as history, provenance, etc. which make sense at the file level (i.e. global) rather than the variable level. Especially in the case where multiple meshes exist in a single file.
Additional context
Example current behaviour (iris 3.9):
Inspecting the saved netCDF file:
Desired output:
Interestingly, a global
Conventions
attribute is already added on save.The text was updated successfully, but these errors were encountered: