tempor.clinic.field_def module¶
-
class tempor.clinic.field_def.FieldDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: Any =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None)[source]¶ Bases:
BaseModel,ABCCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.- data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]]¶
-
get_default_value(modality: Literal[static] | Literal[temporal] | Literal[event], data_sample: DataSample | Literal[first_step] | None =
None) Any[source]¶
-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Any, required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
- class tempor.clinic.field_def.FieldDefsCollection(static, temporal, event)[source]¶
Bases:
tupleCreate new instance of FieldDefsCollection(static, temporal, event)
-
class tempor.clinic.field_def.IntDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: int | None =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, min_value: int | None =None, max_value: int | None =None, step: int | None =None)[source]¶ Bases:
FieldDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
'int'¶
-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Union[int, NoneType], required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'max_value': FieldInfo(annotation=Union[int, NoneType], required=False), 'min_value': FieldInfo(annotation=Union[int, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'step': FieldInfo(annotation=Union[int, NoneType], required=False), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
-
class tempor.clinic.field_def.FloatDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: float | None =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, min_value: float | None =None, max_value: float | None =None, step: float | None =None)[source]¶ Bases:
FieldDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
'float'¶
-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Union[float, NoneType], required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'max_value': FieldInfo(annotation=Union[float, NoneType], required=False), 'min_value': FieldInfo(annotation=Union[float, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'step': FieldInfo(annotation=Union[float, NoneType], required=False), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
-
class tempor.clinic.field_def.CategoricalDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: str | None =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, options: list[str])[source]¶ Bases:
FieldDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
'categorical'¶
-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Union[str, NoneType], required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'options': FieldInfo(annotation=List[str], required=True), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
-
class tempor.clinic.field_def.BinaryDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: bool =False, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None)[source]¶ Bases:
FieldDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
'binary'¶
-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=bool, required=False, default=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
-
class tempor.clinic.field_def.StrDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: str ='', timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None)[source]¶ Bases:
FieldDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
'str'¶
-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=str, required=False, default=''), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
-
class tempor.clinic.field_def.DateDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: datetime | None =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, min_value: date | None =None, max_value: date | None =None)[source]¶ Bases:
FieldDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
'date'¶
-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Union[datetime, NoneType], required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'max_value': FieldInfo(annotation=Union[date, NoneType], required=False), 'min_value': FieldInfo(annotation=Union[date, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
-
data_type : ClassVar[Literal[int] | Literal[float] | Literal[categorical] | Literal[binary] | Literal[str] | Literal[date]] =
-
class tempor.clinic.field_def.TimeIndexDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: Any =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None)[source]¶ Bases:
FieldDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Any, required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
-
model_config : ClassVar[ConfigDict] =
-
class tempor.clinic.field_def.IntTimeIndexDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: int | None =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, min_value: int | None =None, max_value: int | None =None, step: int | None =None)[source]¶ Bases:
IntDef,TimeIndexDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Union[int, NoneType], required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'max_value': FieldInfo(annotation=Union[int, NoneType], required=False), 'min_value': FieldInfo(annotation=Union[int, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'step': FieldInfo(annotation=Union[int, NoneType], required=False), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
- data_modality : DataModality¶
- timestep_default_mode : TimestepDefaultMode¶
- transform_input_to_db : collections.abc.Callable | None¶
- transform_db_to_input : collections.abc.Callable | None¶
-
model_config : ClassVar[ConfigDict] =
-
class tempor.clinic.field_def.FloatTimeIndexDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: float | None =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, min_value: float | None =None, max_value: float | None =None, step: float | None =None)[source]¶ Bases:
FloatDef,TimeIndexDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Union[float, NoneType], required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'max_value': FieldInfo(annotation=Union[float, NoneType], required=False), 'min_value': FieldInfo(annotation=Union[float, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'step': FieldInfo(annotation=Union[float, NoneType], required=False), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
- data_modality : DataModality¶
- timestep_default_mode : TimestepDefaultMode¶
- transform_input_to_db : collections.abc.Callable | None¶
- transform_db_to_input : collections.abc.Callable | None¶
-
model_config : ClassVar[ConfigDict] =
-
class tempor.clinic.field_def.DateTimeIndexDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: datetime | None =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, min_value: date | None =None, max_value: date | None =None)[source]¶ Bases:
DateDef,TimeIndexDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Union[datetime, NoneType], required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'max_value': FieldInfo(annotation=Union[date, NoneType], required=False), 'min_value': FieldInfo(annotation=Union[date, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
- data_modality : DataModality¶
- timestep_default_mode : TimestepDefaultMode¶
- transform_input_to_db : collections.abc.Callable | None¶
- transform_db_to_input : collections.abc.Callable | None¶
-
model_config : ClassVar[ConfigDict] =
-
class tempor.clinic.field_def.ComputedDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: Any =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, computation: Callable[[DataSample, date | float | int], Any], hide_computed_icon: bool =False)[source]¶ Bases:
FieldDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.- compute(data_sample: DataSample, current_timestep: date | float | int) Any[source]¶
Make whatever computation the field requires and return the computed value.
Note
The computation cascades from static data, to time series data, to event data.
-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'computation': FieldInfo(annotation=Callable[[tempor.clinic.const.DataSample, Union[datetime.date, float, int]], Any], required=True), 'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Any, required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'hide_computed_icon': FieldInfo(annotation=bool, required=False, default=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
-
class tempor.clinic.field_def.IntComputedDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: Any =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, min_value: int | None =None, max_value: int | None =None, step: int | None =None, computation: Callable[[DataSample, date | float | int], Any], hide_computed_icon: bool =False)[source]¶ Bases:
ComputedDef,IntDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'computation': FieldInfo(annotation=Callable[[tempor.clinic.const.DataSample, Union[datetime.date, float, int]], Any], required=True), 'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Any, required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'hide_computed_icon': FieldInfo(annotation=bool, required=False, default=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'max_value': FieldInfo(annotation=Union[int, NoneType], required=False), 'min_value': FieldInfo(annotation=Union[int, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'step': FieldInfo(annotation=Union[int, NoneType], required=False), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
- data_modality : DataModality¶
- timestep_default_mode : TimestepDefaultMode¶
- transform_input_to_db : collections.abc.Callable | None¶
- transform_db_to_input : collections.abc.Callable | None¶
-
model_config : ClassVar[ConfigDict] =
-
class tempor.clinic.field_def.FloatComputedDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: Any =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, min_value: float | None =None, max_value: float | None =None, step: float | None =None, computation: Callable[[DataSample, date | float | int], Any], hide_computed_icon: bool =False)[source]¶ Bases:
ComputedDef,FloatDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'computation': FieldInfo(annotation=Callable[[tempor.clinic.const.DataSample, Union[datetime.date, float, int]], Any], required=True), 'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Any, required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'hide_computed_icon': FieldInfo(annotation=bool, required=False, default=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'max_value': FieldInfo(annotation=Union[float, NoneType], required=False), 'min_value': FieldInfo(annotation=Union[float, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'step': FieldInfo(annotation=Union[float, NoneType], required=False), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
- data_modality : DataModality¶
- timestep_default_mode : TimestepDefaultMode¶
- transform_input_to_db : collections.abc.Callable | None¶
- transform_db_to_input : collections.abc.Callable | None¶
-
model_config : ClassVar[ConfigDict] =
-
class tempor.clinic.field_def.CategoricalComputedDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: Any =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, options: list[str], computation: Callable[[DataSample, date | float | int], Any], hide_computed_icon: bool =False)[source]¶ Bases:
ComputedDef,CategoricalDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'computation': FieldInfo(annotation=Callable[[tempor.clinic.const.DataSample, Union[datetime.date, float, int]], Any], required=True), 'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Any, required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'hide_computed_icon': FieldInfo(annotation=bool, required=False, default=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'options': FieldInfo(annotation=List[str], required=True), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
- data_modality : DataModality¶
- timestep_default_mode : TimestepDefaultMode¶
- transform_input_to_db : collections.abc.Callable | None¶
- transform_db_to_input : collections.abc.Callable | None¶
-
model_config : ClassVar[ConfigDict] =
-
class tempor.clinic.field_def.BinaryComputedDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: Any =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, computation: Callable[[DataSample, date | float | int], Any], hide_computed_icon: bool =False)[source]¶ Bases:
ComputedDef,BinaryDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'computation': FieldInfo(annotation=Callable[[tempor.clinic.const.DataSample, Union[datetime.date, float, int]], Any], required=True), 'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Any, required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'hide_computed_icon': FieldInfo(annotation=bool, required=False, default=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
- data_modality : DataModality¶
- timestep_default_mode : TimestepDefaultMode¶
- transform_input_to_db : collections.abc.Callable | None¶
- transform_db_to_input : collections.abc.Callable | None¶
-
model_config : ClassVar[ConfigDict] =
-
class tempor.clinic.field_def.StrComputedDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: Any =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, computation: Callable[[DataSample, date | float | int], Any], hide_computed_icon: bool =False)[source]¶ Bases:
ComputedDef,StrDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'computation': FieldInfo(annotation=Callable[[tempor.clinic.const.DataSample, Union[datetime.date, float, int]], Any], required=True), 'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Any, required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'hide_computed_icon': FieldInfo(annotation=bool, required=False, default=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
- data_modality : DataModality¶
- timestep_default_mode : TimestepDefaultMode¶
- transform_input_to_db : collections.abc.Callable | None¶
- transform_db_to_input : collections.abc.Callable | None¶
-
model_config : ClassVar[ConfigDict] =
-
class tempor.clinic.field_def.DateComputedDef(*, data_modality: Literal[static] | Literal[temporal] | Literal[event], feature_name: str, readable_name: str, units: str | None =
None, default_value: Any =None, timestep_default_mode: Literal[no_action] | Literal[take_previous] ='no_action', formatting: str | None =None, info: str | None =None, transform_input_to_db: Callable | None =None, transform_db_to_input: Callable | None =None, min_value: date | None =None, max_value: date | None =None, computation: Callable[[DataSample, date | float | int], Any], hide_computed_icon: bool =False)[source]¶ Bases:
ComputedDef,DateDefCreate 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.__init__uses__pydantic_self__instead of the more commonselffor the first arg to allowselfas a field name.-
model_config : ClassVar[ConfigDict] =
{}¶ Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
-
model_fields : ClassVar[dict[str, FieldInfo]] =
{'computation': FieldInfo(annotation=Callable[[tempor.clinic.const.DataSample, Union[datetime.date, float, int]], Any], required=True), 'data_modality': FieldInfo(annotation=Literal['static', 'temporal', 'event'], required=True), 'default_value': FieldInfo(annotation=Any, required=False), 'feature_name': FieldInfo(annotation=str, required=True), 'formatting': FieldInfo(annotation=Union[str, NoneType], required=False), 'hide_computed_icon': FieldInfo(annotation=bool, required=False, default=False), 'info': FieldInfo(annotation=Union[str, NoneType], required=False), 'max_value': FieldInfo(annotation=Union[date, NoneType], required=False), 'min_value': FieldInfo(annotation=Union[date, NoneType], required=False), 'readable_name': FieldInfo(annotation=str, required=True), 'timestep_default_mode': FieldInfo(annotation=Literal['no_action', 'take_previous'], required=False, default='no_action'), 'transform_db_to_input': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'transform_input_to_db': FieldInfo(annotation=Union[Callable, NoneType], required=False), 'units': FieldInfo(annotation=Union[str, NoneType], required=False)}¶ Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].This replaces
Model.__fields__from Pydantic V1.
- data_modality : DataModality¶
- timestep_default_mode : TimestepDefaultMode¶
- transform_input_to_db : collections.abc.Callable | None¶
- transform_db_to_input : collections.abc.Callable | None¶
-
model_config : ClassVar[ConfigDict] =
- tempor.clinic.field_def.parse_field_defs(field_defs_raw: dict[Literal[static] | Literal[temporal] | Literal[event], Any]) FieldDefsCollection[source]¶
-
tempor.clinic.field_def.get_default(field_defs: dict[str, FieldDef], modality: Literal[static] | Literal[temporal] | Literal[event], data_sample: DataSample | Literal[first_step] | None =
None) dict[str, dict][source]¶
- tempor.clinic.field_def.get_default_computed(field_defs: dict[str, FieldDef], modality: Literal[static] | Literal[temporal] | Literal[event], data_sample_before_computation: DataSample, current_timestep: date | float | int) dict[str, dict][source]¶
-
tempor.clinic.field_def.update(field_defs: dict[str, FieldDef], session_state: Any, modality: Literal[static] | Literal[temporal] | Literal[event], data_sample: DataSample, current_timestep: date | float | int, computed_only: bool =
False) dict[str, dict][source]¶