pyearthtools.pipeline.step.PipelineStep can be instantiated with recognised_types which are then used for type checking when the __call__ method is used. There are at least a couple children of PipelineStep which still have an unnecessary extra type check e.g. in xarray filter:
|
raise TypeError("This filter only accepts xr.DataArray or xr.Dataset") |
These checks should be removed since type checks will already happen in __call__.
This might be a bit tricky to track down since PipelineStep is an indirect parent class of quite a few Pipeline related classes e.g. pyearthtools.pipeline.operation.Operation inherits from PipelineStep, and so does pyearthtools.pipeline.filters.Filter.
pyearthtools.pipeline.step.PipelineStepcan be instantiated withrecognised_typeswhich are then used for type checking when the__call__method is used. There are at least a couple children ofPipelineStepwhich still have an unnecessary extra type check e.g. in xarray filter:PyEarthTools/packages/pipeline/src/pyearthtools/pipeline/operations/xarray/filters.py
Line 83 in 8daadaf
These checks should be removed since type checks will already happen in
__call__.This might be a bit tricky to track down since
PipelineStepis an indirect parent class of quite a few Pipeline related classes e.g.pyearthtools.pipeline.operation.Operationinherits fromPipelineStep, and so doespyearthtools.pipeline.filters.Filter.