esm-tools / pymorize

A Python based Tool to CMORize NetCDF Data
https://pymorize.readthedocs.io
MIT License
2 stars 1 forks source link

cmorizer tests #68

Open mandresm opened 1 week ago

mandresm commented 1 week ago

Unit tests are missing for the cmorizer

pgierz commented 4 days ago

One important check to include here is to see if a DataRequestVariable contained in multiple DataRequestTables is properly "depluralized". By this I mean something like the variable thetao, which is contained in several CMIP tables (e.g. Omon, Oday, Oclim).

After initialisation, the user should have three separate Rule objects in the CMORizer, since one DataRequestVariable should correspond to exactly one Rule, which is defined specifically for one output frequency. If the user does not include a table (i.e. the table is ambiguous), the initialisation should assign multiple tables to the object's tables attribute, as a list. Then there should be something that checks if any Rule's data_request_variable.tables attribute is a list of length more than one, and if that is the case, make a copy of the rule for each table in the list.

...I hope that is clear enough. @mandresm, I think it would be nice if you implement this (or check that is already there, I already wrote something called depluralize), since you can gain some more familiarity of how the CMORizer object is built from the inside.