COSIMA / cosima-cookbook

Framework for indexing and querying ocean-sea ice model output.
https://cosima-recipes.readthedocs.io/en/latest/
Apache License 2.0
57 stars 25 forks source link

Returning `ncfiles` attribute in data array using getvar should be optional #314

Open aidanheerdegen opened 1 year ago

aidanheerdegen commented 1 year ago

PR https://github.com/COSIMA/cosima-cookbook/pull/265 added an ncfiles attribute to the DataArray returned by getvar. This attribtue is a list of all the netcdf files that are queried to create the DataArray, and from which data could be extracted when the data is accessed.

This is useful information to the user, but by default it makes for very verbose output in jupyter notebooks when a the DataArray is "printed" in the code block.

In retrospect it was a mistake to return ncfiles as an attribute by default. I think this should be wound back, and the functionality retained, but requiring an option to getvar, e.g. ncfilesattr = True or similar.