Dimension Config¶
- pydantic model dsgrid.config.dimensions.DimensionModel[source]¶
Defines a non-time dimension
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.
__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.
- Fields:
- Validators:
- field file_hash: str | None = None¶
Hash of the contents of the file
- Validated by:
- field filename: str | None = None (alias 'file')¶
Filename containing dimension records. Only assigned for user input and output purposes. The registry database stores records in the dimension JSON document.
- Validated by:
- field records: List = []¶
Dimension records in filename that get loaded at runtime
- Validated by:
DateTime Dimension Config¶
- pydantic model dsgrid.config.dimensions.DateTimeDimensionModel[source]¶
Defines a time dimension where timestamps translate to datetime objects.
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.
__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.
- Fields:
- Validators:
check_frequency
»all fields
check_time_type_and_class_consistency
»all fields
- field frequency: timedelta [Required]¶
Resolution of the timestamps
- Validated by:
- field leap_day_adjustment: LeapDayAdjustmentType | None = LeapDayAdjustmentType.NONE¶
Leap day adjustment method applied to time data
- Validated by:
- field measurement_type: MeasurementType = MeasurementType.TOTAL¶
- The type of measurement represented by a value associated with a timestamp:
mean, min, max, measured, total
- Validated by:
- field ranges: List[TimeRangeModel] [Required]¶
Defines the continuous ranges of time in the data, inclusive of start and end time.
- Validated by:
- field str_format: str | None = '%Y-%m-%d %H:%M:%s'¶
Timestamp string format
- Validated by:
- field time_interval_type: TimeIntervalType [Required]¶
The range of time that the value associated with a timestamp represents, e.g., period-beginning
- Validated by:
Annual Time Dimension Config¶
- pydantic model dsgrid.config.dimensions.AnnualTimeDimensionModel[source]¶
Defines an annual time dimension where timestamps are years.
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.
__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.
- Fields:
- Validators:
check_time_type_and_class_consistency
»all fields
- field include_leap_day: bool = False¶
Whether annual time includes leap day.
- Validated by:
- field measurement_type: MeasurementType = MeasurementType.TOTAL¶
- The type of measurement represented by a value associated with a timestamp:
mean, min, max, measured, total
- Validated by:
- field ranges: List[TimeRangeModel] [Required]¶
Defines the contiguous ranges of time in the data, inclusive of start and end time.
- Validated by:
- field str_format: str | None = '%Y'¶
Timestamp string format
- Validated by:
- field time_type: TimeDimensionType = TimeDimensionType.ANNUAL¶
- Validated by:
Representative Period Time Dimension Config¶
- pydantic model dsgrid.config.dimensions.RepresentativePeriodTimeDimensionModel[source]¶
Defines a representative time dimension.
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.
__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.
- Fields:
- Validators:
- field format: RepresentativePeriodFormat [Required]¶
Format of the timestamps in the load data
- field measurement_type: MeasurementType = MeasurementType.TOTAL¶
- The type of measurement represented by a value associated with a timestamp:
mean, min, max, measured, total
- field ranges: List[MonthRangeModel] [Required]¶
Defines the continuous ranges of time in the data, inclusive of start and end time.
- field time_interval_type: TimeIntervalType [Required]¶
The range of time that the value associated with a timestamp represents
No-op Time Dimension Config¶
- pydantic model dsgrid.config.dimensions.NoOpTimeDimensionModel[source]¶
Defines a NoOp time dimension.
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.
__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.
- Fields:
- Validators:
check_time_type_and_class_consistency
»all fields
- field time_type: TimeDimensionType = TimeDimensionType.NOOP¶
- Validated by:
- pydantic model dsgrid.config.dimensions.TimeRangeModel[source]¶
Defines a continuous range of time.
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.
__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.
- Fields:
- field end: str [Required]¶
Last timestamp in the data (inclusive)
- field start: str [Required]¶
First timestamp in the data
- pydantic model dsgrid.config.dimensions.MonthRangeModel[source]¶
Defines a continuous range of time.
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.
__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.
- Fields:
- field end: int [Required]¶
Last month in the data (inclusive)
- field start: int [Required]¶
First month in the data (January is 1, December is 12)
Dimension Reference¶
- pydantic model dsgrid.config.dimensions.DimensionReferenceModel[source]¶
Reference to a dimension stored in the registry
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.
__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.
- Fields:
- field dimension_id: str [Required]¶
Unique ID of the dimension in the registry
- field dimension_type: DimensionType [Required] (alias 'type')¶
Type of the dimension
- field version: str [Required]¶
Version of the dimension