Project Config¶
- pydantic model dsgrid.config.project_config.ProjectConfigModel[source]¶
Represents project configurations
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 datasets: List[InputDatasetModel] [Required]¶
List of input datasets for the project.
- field description: str [Required]¶
Detailed project description.
- field dimension_mappings: DimensionMappingsModel = DimensionMappingsModel(base_to_supplemental_references=[], dataset_to_project={})¶
List of project mappings. Initialized with base-to-base and base-to-supplemental mappings. dataset-to-project mappings are added by dsgrid as datasets get registered with the project.
- field dimensions: DimensionsModel [Required]¶
List of base and supplemental dimensions.
- field id: str | None = None (alias '_id')¶
Registry database ID
- field key: str | None = None (alias '_key')¶
Registry database key
- field name: str [Required]¶
A project name to accompany the ID.
- field project_id: str [Required]¶
A unique project identifier that is project-specific (e.g., ‘standard-scenarios-2021’).
- Validated by:
- field rev: str | None = None (alias '_rev')¶
Registry database revision
- field status: ProjectRegistryStatus = ProjectRegistryStatus.INITIAL_REGISTRATION¶
project registry status
- field version: str | None = None¶
Version, generated by dsgrid
- validator check_project_id_handle » project_id[source]¶
Check for valid characters in project id
- pydantic model dsgrid.config.project_config.InputDatasetModel[source]¶
Defines an input dataset for the project config.
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 dataset_id: str [Required]¶
Unique dataset identifier.
- field dataset_type: InputDatasetType [Required]¶
Dataset type.
- field mapping_references: List[DimensionMappingReferenceModel] = []¶
Defines how to map the dataset dimensions to the project.
- field required_dimensions: RequiredDimensionsModel = RequiredDimensionsModel(single_dimensional=RequiredDimensionRecordsModel(geography=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), metric=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), model_year=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), scenario=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), sector=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), subsector=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), weather_year=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[])), multi_dimensional=[])¶
Defines required record IDs that must exist for each dimension.
- field status: DatasetRegistryStatus = DatasetRegistryStatus.UNREGISTERED¶
Registration status of the dataset, added by dsgrid.
- field version: str = None¶
Version of the registered dataset
- field wrap_time_allowed: bool = False¶
Whether to allow dataset time to be wrapped to project time if different
- pydantic model dsgrid.config.project_config.DimensionsModel[source]¶
Contains dimensions defined by a project
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:
base_dimension_references (List[dsgrid.config.dimensions.DimensionReferenceModel])
subset_dimensions (list[dsgrid.config.project_config.SubsetDimensionGroupModel])
supplemental_dimension_references (List[dsgrid.config.dimensions.DimensionReferenceModel])
supplemental_dimensions (List[dsgrid.config.supplemental_dimension.SupplementalDimensionModel])
- Validators:
check_dimension_query_names
»all fields
check_dimensions
»all fields
pre_check_values
»all fields
- field base_dimension_references: List[DimensionReferenceModel] = []¶
List of registry references (
DimensionReferenceModel
) for a project’s base dimensions.- Validated by:
- field base_dimensions: List[DimensionModel | DateTimeDimensionModel | AnnualTimeDimensionModel | RepresentativePeriodTimeDimensionModel | NoOpTimeDimensionModel] = []¶
List of dimensions for a project’s base dimensions. They will be automatically registered during project registration and then converted to base_dimension_references.
- Constraints:
func = <function handle_dimension_union at 0x7ff05b0d9ea0>
- Validated by:
- field subset_dimensions: list[SubsetDimensionGroupModel] = []¶
List of subset dimension groups
- field supplemental_dimension_references: List[DimensionReferenceModel] = []¶
List of registry references for a project’s supplemental dimensions.
- Validated by:
- field supplemental_dimensions: List[SupplementalDimensionModel] = []¶
List of supplemental dimensions. They will be automatically registered during project registration and then converted to supplemental_dimension_references.
- Validated by:
- validator check_dimension_query_names » all fields[source]¶
Check that all dimension query names are unique.
- validator check_dimensions » all fields[source]¶
Validate that the dimensions are complete and consistent.
- validator check_files » base_dimensions[source]¶
Validate dimension files are unique across all dimensions
- validator check_names » base_dimensions[source]¶
Validate dimension names are unique across all dimensions.
- validator check_subset_dimensions » subset_dimensions[source]¶
Check that each subset dimension has a unique name and display_name.
- validator check_time_zone » base_dimensions[source]¶
Validate the time zone column in geography records.
- pydantic model dsgrid.config.project_config.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
- pydantic model dsgrid.config.project_config.RequiredDimensionsModel[source]¶
Defines required record IDs that must exist for each dimension in a dataset. Record IDs can reside in the project’s base, subset, or supplemental dimensions. Using subset dimensions is recommended. dsgrid will substitute base records for mapped subset records at runtime. If no records are listed for a dimension then all project base records are required.
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_for_duplicates
»all fields
- field multi_dimensional: list[RequiredDimensionRecordsModel] = []¶
Required records for a combination of dimensions. For example, there may be a dataset requirement for only one subsector for a given sector instead of a cross product.
- Validated by:
- field single_dimensional: RequiredDimensionRecordsModel = RequiredDimensionRecordsModel(geography=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), metric=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), model_year=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), scenario=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), sector=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), subsector=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]), weather_year=RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[]))¶
Required records for a single dimension.
- Validated by:
- pydantic model dsgrid.config.project_config.DimensionMappingsModel[source]¶
Defines all dimension mappings associated with a dsgrid project, including base-to-supplemental mappings and dataset-to-project mappings.
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 base_to_supplemental_references: List[DimensionMappingReferenceModel] = []¶
Base dimension to supplemental dimension mappings (e.g., county-to-state) used to support various queries and dimension transformations.
- field dataset_to_project: Dict[str, List[DimensionMappingReferenceModel]] = {}¶
Dataset-to-project mappings map dataset dimensions to project dimensions.
- pydantic model dsgrid.config.project_config.RequiredDimensionRecordsModel[source]¶
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:
geography (dsgrid.config.project_config.RequiredDimensionRecordsByTypeModel)
metric (dsgrid.config.project_config.RequiredDimensionRecordsByTypeModel)
model_year (dsgrid.config.project_config.RequiredDimensionRecordsByTypeModel)
scenario (dsgrid.config.project_config.RequiredDimensionRecordsByTypeModel)
sector (dsgrid.config.project_config.RequiredDimensionRecordsByTypeModel)
subsector (dsgrid.config.project_config.RequiredDimensionRecordsByTypeModel)
weather_year (dsgrid.config.project_config.RequiredDimensionRecordsByTypeModel)
- field geography: RequiredDimensionRecordsByTypeModel = RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[])¶
- field metric: RequiredDimensionRecordsByTypeModel = RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[])¶
- field model_year: RequiredDimensionRecordsByTypeModel = RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[])¶
- field scenario: RequiredDimensionRecordsByTypeModel = RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[])¶
- field sector: RequiredDimensionRecordsByTypeModel = RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[])¶
- field subsector: RequiredDimensionRecordsByTypeModel = RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[])¶
- field weather_year: RequiredDimensionRecordsByTypeModel = RequiredDimensionRecordsByTypeModel(base=[], subset=[], supplemental=[])¶
- pydantic model dsgrid.config.project_config.RequiredSupplementalDimensionRecordsModel[source]¶
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 name: str [Required]¶
Name of a supplemental dimension
- field record_ids: list[str] [Required]¶
One or more record IDs in the supplemental dimension
- pydantic model dsgrid.config.project_config.RequiredDimensionRecordsByTypeModel[source]¶
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 base: list[str] = []¶
- field subset: list[RequiredSubsetDimensionRecordsModel] = []¶
- field supplemental: list[RequiredSupplementalDimensionRecordsModel] = []¶