captest.filters.Custom
- class captest.filters.Custom(func, *args, custom_name=None, **kwargs)
Apply an arbitrary callable to
capdata.data_filteredas a row filter.funcis a callable that takes a DataFrame as its first argument and returns a DataFrame whose index is the rows to keep. Typical use is a pandas DataFrame method likepd.DataFrame.dropnaorpd.DataFrame.between_time.Unlike most filters,
func/*args/**kwargsare stored as plain instance attributes (notparamparameters). Callables and variadics don’t fitparam’s declared-parameter model; YAML serialization forfunc(module-qualified-name string) is handled by the YAML plan.- __init__(func, *args, custom_name=None, **kwargs)
Methods
__init__(func, *args[, custom_name])from_config(config)Build an instance from a
to_config()dict.run(capdata)Execute the step, record runtime state, and append self to filters.
to_config()Serialize this step to a config dict (every param, defaults included; the param-system
nameis omitted).Attributes
args_reprRender
func_name(arg, ..., k=v, ...)— matches the legacy regex.custom_nameexplanationHuman-readable description of the step's effect (read after run()).
nameparam