qfa.domain.chunk_models#

Domain model for a thematic chunk of feedback records.

Kept in a dedicated module separate from qfa.domain.clustering_models so that FeedbackRecordModel can be imported here without creating a circular dependency: models imports CodingTrendTable from clustering_models, which does NOT import FeedbackRecordModel, so the cycle is avoided.

Classes

Chunk(*, label, is_uncategorised, records)

A thematically coherent group of feedback records for the map step.

class qfa.domain.chunk_models.Chunk(*, label: int, is_uncategorised: bool, records: Annotated[tuple[FeedbackRecordModel, ...], MinLen(min_length=1)])[source]#

Bases: BaseModel

A thematically coherent group of feedback records for the map step.

A chunk is produced either by a cluster, by splitting an over-budget cluster into sub-chunks, or by collecting HDBSCAN noise points into one or more “uncategorised” chunks. Every input record belongs to exactly one chunk (the full-coverage invariant).

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'frozen': True}#

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

label: int#
is_uncategorised: bool#
records: tuple[FeedbackRecordModel, ...]#