firecrown.data_functions.TwoPointBinFilterCollection#

class firecrown.data_functions.TwoPointBinFilterCollection(**data)[source]#

Bases: BaseModel

Class defining a collection of bin filters.

Parameters:

data (Any) –

Public Methods:

check_bin_filters()

Check the bin filters.

filter_match(tpm)

Check if the TwoPointMeasurement matches the filter.

run_bin_filter(bin_filter, vals)

Run the filter merge.

apply_filter_single(tpm)

Apply the filter to a single TwoPointMeasurement.

__call__(tpms)

Filter the two-point measurements.

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

__hash__()

Return hash(self).

__signature__

The synthesized __init__ [Signature][inspect.Signature] of the model.

Inherited from BaseModel

__init__(**data)

Create a new model by parsing and validating input data from keyword arguments.

model_construct([_fields_set])

Creates a new instance of the Model class with validated data.

model_copy(*[, update, deep])

Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#model_copy

model_dump(*[, mode, include, exclude, ...])

Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump

model_dump_json(*[, indent, include, ...])

Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump_json

model_json_schema([by_alias, ref_template, ...])

Generates a JSON schema for a model class.

model_parametrized_name(params)

Compute the class name for parametrizations of generic classes.

model_post_init(_BaseModel__context)

Override this method to perform additional initialization after __init__ and model_construct.

model_rebuild(*[, force, raise_errors, ...])

Try to rebuild the pydantic-core schema for the model.

model_validate(obj, *[, strict, ...])

Validate a pydantic model instance.

model_validate_json(json_data, *[, strict, ...])

Usage docs: https://docs.pydantic.dev/2.10/concepts/json/#json-parsing

model_validate_strings(obj, *[, strict, context])

Validate the given object with string data against the Pydantic model.

__get_pydantic_core_schema__(source, handler, /)

Hook into generating the model's CoreSchema.

__get_pydantic_json_schema__(core_schema, ...)

Hook into generating the model's JSON schema.

__pydantic_init_subclass__(**kwargs)

This is intended to behave just like __init_subclass__, but is called by ModelMetaclass only after the class is actually fully initialized.

__class_getitem__(typevar_values)

param typevar_values:

__copy__()

Returns a shallow copy of the model.

__deepcopy__([memo])

Returns a deep copy of the model.

__getattr__(item)

param item:

__setattr__(name, value)

Implement setattr(self, name, value).

__delattr__(item)

Implement delattr(self, name).

__replace__(**changes)

param changes:

__getstate__()

Helper for pickle.

__setstate__(state)

param state:

__eq__(other)

Return self==value.

__iter__()

So dict(model) works.

__repr__()

Return repr(self).

__repr_args__()

__repr_name__()

Name of the instance's class, used in __repr__.

__repr_recursion__(object)

Returns the string representation of a recursive object.

__repr_str__(join_str)

param join_str:

__pretty__(fmt, **kwargs)

Used by devtools (https://python-devtools.helpmanual.io/) to pretty print objects.

__rich_repr__()

Used by Rich (https://rich.readthedocs.io/en/stable/pretty.html) to pretty print objects.

__str__()

Return str(self).

dict(*[, include, exclude, by_alias, ...])

param include:

json(*[, include, exclude, by_alias, ...])

param include:

parse_obj(obj)

param obj:

parse_raw(b, *[, content_type, encoding, ...])

param b:

parse_file(path, *[, content_type, ...])

param path:

from_orm(obj)

param obj:

construct([_fields_set])

param _fields_set:

copy(*[, include, exclude, update, deep])

Returns a copy of the model.

schema([by_alias, ref_template])

param by_alias:

schema_json(*[, by_alias, ref_template])

param by_alias:

validate(value)

param value:

update_forward_refs(**localns)

param localns:

Private Methods:

Inherited from BaseModel

_check_frozen(name, value)

param name:

_iter(*args, **kwargs)

param args:

_copy_and_set_values(*args, **kwargs)

param args:

_get_value(*args, **kwargs)

param args:

_calculate_keys(*args, **kwargs)

param args:


__call__(tpms)[source]#

Filter the two-point measurements.

Parameters:

tpms (Sequence[TwoPointMeasurement]) –

Return type:

list[TwoPointMeasurement]

apply_filter_single(tpm)[source]#

Apply the filter to a single TwoPointMeasurement.

Parameters:

tpm (TwoPointMeasurement) –

Return type:

tuple[ndarray[tuple[int, ...], dtype[bool]], ndarray[tuple[int, ...], dtype[bool]]]

property bin_filter_dict: dict[frozenset[firecrown.data_functions.TwoPointTracerSpec], tuple[float, float]]#

Return the bin filter dictionary.

check_bin_filters()[source]#

Check the bin filters.

Return type:

TwoPointBinFilterCollection

filter_match(tpm)[source]#

Check if the TwoPointMeasurement matches the filter.

Parameters:

tpm (TwoPointMeasurement) –

Return type:

bool

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

run_bin_filter(bin_filter, vals)[source]#

Run the filter merge.

Parameters:
  • bin_filter (tuple[float, float]) –

  • vals (ndarray[tuple[int, ...], dtype[float64]] | ndarray[tuple[int, ...], dtype[int64]]) –

Return type:

ndarray[tuple[int, ...], dtype[bool]]