cf.Constructs.filters_applied¶
-
Constructs.
filters_applied
()[source]¶ A history of filters that have been applied.
The history is returned in a tuple. The last element of the tuple describes the last filter applied. Each element is a single-entry dictionary whose key is the name of the filter method that was used, with a value that gives the arguments that were passed to the call of that method. If no filters have been applied then the tuple is empty.
New in version (cfdm): 1.7.0
See also
filter_by_axis
,filter_by_data
,filter_by_key
,filter_by_measure
,filter_by_method
,filter_by_naxes
,filter_by_identity
,filter_by_ncdim
,filter_by_ncvar
,filter_by_property
,filter_by_type
,inverse_filter
,unfilter
- Returns
tuple
The history of filters that have been applied, ordered from first to last. If no filters have been applied then the tuple is empty.
Examples:
>>> print(c) {'auxiliarycoordinate0': <AuxiliaryCoordinate: latitude(10, 9) degrees_N>, 'auxiliarycoordinate1': <AuxiliaryCoordinate: longitude(9, 10) degrees_E>, 'coordinatereference1': <CoordinateReference: grid_mapping_name:rotated_latitude_longitude>, 'dimensioncoordinate1': <DimensionCoordinate: grid_latitude(10) degrees>, 'dimensioncoordinate2': <DimensionCoordinate: grid_longitude(9) degrees>, 'domainaxis1': <DomainAxis: size(10)>, 'domainaxis2': <DomainAxis: size(9)>} >>> c.filters_applied() () >>> c = c.filter_by_type('dimension_coordinate', 'auxiliary_coordinate') >>> c.filters_applied() ({'filter_by_type': ('dimension_coordinate', 'auxiliary_coordinate')},) >>> c = c.filter_by_property(units='degrees') >>> c.filters_applied() ({'filter_by_type': ('dimension_coordinate', 'auxiliary_coordinate')}, {'filter_by_property': ((), {'units': 'degrees'})}) >>> c = c.filter_by_property('or', standard_name='grid_latitude', axis='Y') >>> c.filters_applied() ({'filter_by_type': ('dimension_coordinate', 'auxiliary_coordinate')}, {'filter_by_property': ((), {'units': 'degrees'})}, {'filter_by_property': (('or',), {'axis': 'Y', 'standard_name': 'grid_latitude'})}) >>> print(c) Constructs: {'dimensioncoordinate1': <DimensionCoordinate: grid_latitude(10) degrees>}