captest.filters.Custom

class captest.filters.Custom(func, *args, custom_name=None, **kwargs)

Apply an arbitrary callable to capdata.data_filtered as a row filter.

func is 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 like pd.DataFrame.dropna or pd.DataFrame.between_time.

Unlike most filters, func/*args/**kwargs are stored as plain instance attributes (not param parameters). Callables and variadics don’t fit param’s declared-parameter model; YAML serialization for func (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 name is omitted).

Attributes

args_repr

Render func_name(arg, ..., k=v, ...) — matches the legacy regex.

custom_name

explanation

Human-readable description of the step's effect (read after run()).

name

param