xarray-contrib / xarray-simlab

Xarray extension and framework for computer model simulations
http://xarray-simlab.readthedocs.io
BSD 3-Clause "New" or "Revised" License
73 stars 9 forks source link

Propagate original description to foreign variables #91

Closed rlange2 closed 4 years ago

rlange2 commented 4 years ago

PR#88 was closed and the code has been changed in order to work independently from the autodoc-feature (PR#67).

I use variables_dict() from utils.py. Since attrs is already imported in variables.py, the following line would return the same result:

description = attr.fields_dict(other_process_cls)[var_name].metadata["description"])

From my understanding, foreign variables always belong to xsimlab variables. Therefore, we technically could use attr.fields_dict() instead. What do you think, @benbovy ? My first inclination was, to iterate over variables_dict(other_process_cls).items() but luckily, the construct makes it accessibly as is 👍

There's already a test included in test_variable.py. Should we update this one to account for these changes or is it better to test at another place (e.g. as part of autodoc)?

benbovy commented 4 years ago

Thanks @rlange2 !