Skip to content
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

Add metadata to a xsimlab.Model object #21

Open
benbovy opened this issue Nov 16, 2017 · 0 comments
Open

Add metadata to a xsimlab.Model object #21

benbovy opened this issue Nov 16, 2017 · 0 comments

Comments

@benbovy
Copy link
Member

benbovy commented Nov 16, 2017

It may be useful for users to be able to add some metadata to a xsimlab.Model object, e.g., a description, comments, package versions... -> xsimlab.Model({}, metadata={})

Using the xarray interface, these metadata can be used to systematically add some informative global attributes to Dataset objects generated using the model.

This raises a couple of questions:

  • How to handle metadata with Model.drop_processes() and Model.update_processes()? It is dangerous simply copying all the metadata as for example updating the processes may result in an invalid description. Probably it is better to no copying any metadata.

  • Add the metadata to the input or output Dataset? Probably the input Dataset is better. If we save the input to disk for loading it back later, then we at least have a clue on which model has been used to create this setup. Edit: considering also methods like Dataset.xsimlab.update_vars or Dataset.xsimlab.filter_vars that generate new Datasets, another option would be to systematically add (and maybe overwrite) the metadata for each of these methods that accept a Model instance as argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant