archaeo_super_prompt.dataset.normalization.intervention_date.utils
source module archaeo_super_prompt.dataset.normalization.intervention_date.utils
Utils for piping normalization functions.
Classes
-
Date — Not completely normalized date, but the day, the month and the year are already separated by /.
-
Duration — Tuple to represent a uniform duration.
-
RawInterventionDataForDateNormalization — This is the schema of usefull columns for normalizing the intervention dates.
-
InterventionDataForDateNormalization — This is the schema of usefull columns for normalizing the intervention dates.
-
InterventionDataForDateNormalizationRowSchema — Row schema of the class above.
Functions
-
process_if_not_yet — For each row not processed yet, apply a normalization function.
-
pipe — Apply to the raw date df a range of normalization functions.
Bases : NamedTuple
Not completely normalized date, but the day, the month and the year are already separated by /.
Bases : NamedTuple
Tuple to represent a uniform duration.
source class RawInterventionDataForDateNormalization()
Bases : DataFrameModel
This is the schema of usefull columns for normalizing the intervention dates.
source class InterventionDataForDateNormalization()
Bases : DataFrameModel
This is the schema of usefull columns for normalizing the intervention dates.
source class InterventionDataForDateNormalizationRowSchema()
Bases : NamedTuple
Row schema of the class above.
source process_if_not_yet(row: InterventionDataForDateNormalizationRowSchema, fn: DateProcessor) → Date | None
For each row not processed yet, apply a normalization function.
This normalization function try to normalize if the humanly-input date matches with patterns that it supports. Else, it returns None.
source pipe(s: DataFrame[RawInterventionDataForDateNormalization], functions: tuple[DateProcessor, ...]) → DataFrame[InterventionDataForDateNormalization]
Apply to the raw date df a range of normalization functions.
This functions tries to cover a maximum of humanly-input dates.