kujaku11 / mt_metadata

Tools for standardizing metadata, geared towards magnetotelluric (MT) data but is general enough to accommodate "any" type of metadata.
https://mt-metadata.readthedocs.io/en/latest/
MIT License
18 stars 4 forks source link

Filtered.applied can be mutlivalued #216

Closed kkappler closed 2 months ago

kkappler commented 3 months ago

The class mt_metadata.timeseries.filters.filtered.Filtered has attrs: applied and name which both return lists.

The current behaviour is that the applied list must either have the same number of values as the names list, or applied can be a list of a single boolean.

If Filtered's _check_consistency method sees a single boolean in applied, it assumes filters.applied all have the same value as the lone boolean.

Aurora does not like this -- it wants these two lists have the same length, so for a given list of filter names we know explicitly whether these have been applied or not. I would rather not add logic in downstream applications to handle this.

I propose to modify _check_consistency (which is called by name.setter) to explicitly assign applied a list of bools of the same length as name, and warn the user this is happening.

Of course, one should explicitly add the applied list while building the MTH5, but sometimes I forget