Models¶
- pydantic model qgreenland.models.base_model.QgrBaseModel[source]¶
Bases:
pydantic.main.BaseModel
Implements ‘faux’ immutability and allows usage of functools.cached_property.
Immutability is not ‘strict’ (e.g., dicts can be mutated) - a determined dev can still mutate model instances.
Configuration¶
The configuration determines the final output of the processing pipelines, including the final QGIS project, zip package, and layers that are created.
- pydantic model qgreenland.models.config.__init__.Config[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
The configuration determines the pipeline outputs.
All fields are populated programmatically. There is no need to specify a Config object anywhere: this is part of the framework.
- field datasets: dict[str, qgreenland.models.config.dataset.Dataset] [Required][source]¶
A lookup of all datasets included in the project.
- Validated by
clean_all_string_fields
validate_id_fields
- field layer_tree: anytree.node.node.Node [Required][source]¶
A tree of all layers and groups.
Structured as they would be in the QGIS Layers Panel.
- Validated by
clean_all_string_fields
validate_id_fields
- field layers: dict[str, qgreenland.models.config.layer.Layer] [Required][source]¶
A lookup of all layers included in the project.
- Validated by
clean_all_string_fields
validate_id_fields
- field project: qgreenland.models.config.project.Project [Required][source]¶
General project-wide configuration, such as CRS.
- Validated by
clean_all_string_fields
validate_id_fields
Project¶
- pydantic model qgreenland.models.config.project.BoundariesInfo[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
- field bbox: qgreenland.models.config.project.BoundingBox [Required][source]¶
Bounding box, automatically populated from the file.
- Validated by
validate_id_fields
clean_all_string_fields
- pydantic model qgreenland.models.config.project.Project[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
General project-wide configuration.
- field boundaries: dict[str, qgreenland.models.config.project.BoundariesInfo] [Required][source]¶
The boundaries available for use (e.g. clipping) during layer steps.
- Validated by
clean_all_string_fields
validate_id_fields
Layer Groups¶
- pydantic model qgreenland.models.config.layer_group.LayerGroupSettings[source]¶
Bases:
qgreenland.models.config.layer_group.RootGroupSettings
- pydantic model qgreenland.models.config.layer_group.RootGroupSettings[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
Settings specific to the root group.
- field order: Optional[list[str]] [Required][source]¶
The order in which this group’s contents will be shown.
Subgroups are referenced by name, e.g. ‘Basemaps’, and layers are referenced by a colon followed by the layer ID, e.g. :background. If ‘order’ is omitted, a default sorting algorithm is applied.
- Validated by
validate_id_fields
clean_all_string_fields
Layers¶
- pydantic model qgreenland.models.config.layer.Layer[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
- field description: str [Required][source]¶
Descriptive text shown as hover-text in the QGIS Layer Panel.
- Constraints
minLength = 1
- Validated by
validate_id_fields
validate_paragraph_text
clean_all_string_fields
- field id: str [Required][source]¶
Unique identifier.
- Validated by
validate_id_fields
clean_all_string_fields
- field in_package: bool = True[source]¶
Is this layer in the final QGreenland zip file?
- Validated by
validate_id_fields
clean_all_string_fields
- field input: qgreenland.models.config.layer.LayerInput [Required][source]¶
- Validated by
validate_id_fields
clean_all_string_fields
- field show: bool = False[source]¶
Is this layer initially “checked” or visible in QGIS?
- Validated by
validate_id_fields
clean_all_string_fields
- field steps: Optional[list[qgreenland.models.config.step.CommandStep]] [Required][source]¶
- Validated by
validate_id_fields
clean_all_string_fields
- field style: Optional[str] = None[source]¶
Which style (.qml) file to use for this layer?
Omit the file extension.
- Constraints
minLength = 1
- Validated by
validate_id_fields
clean_all_string_fields
- field tags: list[str] = [][source]¶
Additional categories that describe this data.
- Validated by
validate_id_fields
clean_all_string_fields
- pydantic model qgreenland.models.config.layer.LayerInput[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
The input(s) to a layer’s processing pipeline.
- field asset: Union[qgreenland.models.config.asset.CmrAsset, qgreenland.models.config.asset.CommandAsset, qgreenland.models.config.asset.HttpAsset, qgreenland.models.config.asset.ManualAsset, qgreenland.models.config.asset.OnlineAsset, qgreenland.models.config.asset.RepositoryAsset] [Required][source]¶
The actual input asset (file or files).
- Validated by
validate_id_fields
clean_all_string_fields
- field dataset: qgreenland.models.config.dataset.Dataset [Required][source]¶
The dataset providing the layer’s input. Important for metadata.
- Validated by
validate_id_fields
clean_all_string_fields
Steps¶
- pydantic model qgreenland.models.config.step.CommandStep[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
,qgreenland.models.config.step.LayerStep
A step run as a shell command.
- field args: list[qgreenland.util.runtime_vars.EvalStr] [Required][source]¶
The command arguments, e.g. [‘cat’, ‘{input_dir}/foo.txt’].
- Validated by
validate_id_fields
clean_all_string_fields
- field id: Optional[str] [Required][source]¶
An identifier for the step. Does not need to be unique.
- Validated by
validate_id_fields
clean_all_string_fields
- field type: Literal['command'] = 'command'[source]¶
The type of the step. Should not be set by the user.
- Validated by
validate_id_fields
clean_all_string_fields
Datasets¶
- pydantic model qgreenland.models.config.dataset.Dataset[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
Configuration for a dataset.
- field assets: dict[str, Union[qgreenland.models.config.asset.CmrAsset, qgreenland.models.config.asset.CommandAsset, qgreenland.models.config.asset.HttpAsset, qgreenland.models.config.asset.ManualAsset, qgreenland.models.config.asset.OnlineAsset, qgreenland.models.config.asset.RepositoryAsset]] [Required][source]¶
Actual data associated with the dataset.
- Validated by
validate_id_fields
clean_all_string_fields
- field id: str [Required][source]¶
Dataset unique identifier.
- Constraints
minLength = 1
- Validated by
validate_id_fields
clean_all_string_fields
- field metadata: qgreenland.models.config.dataset.DatasetMetadata [Required][source]¶
- Validated by
validate_id_fields
clean_all_string_fields
- pydantic model qgreenland.models.config.dataset.DatasetCitation[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
Citation for a dataset.
- field text: str [Required][source]¶
The citation text.
- Validated by
validate_id_fields
clean_all_string_fields
- pydantic model qgreenland.models.config.dataset.DatasetMetadata[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
Metadata for the dataset.
- field abstract: str [Required][source]¶
The dataset abstract.
- Validated by
clean_all_string_fields
validate_paragraph_text
validate_id_fields
- field citation: qgreenland.models.config.dataset.DatasetCitation [Required][source]¶
- Validated by
clean_all_string_fields
validate_id_fields
Assets¶
- pydantic model qgreenland.models.config.asset.CmrAsset[source]¶
Bases:
qgreenland.models.config.asset.DatasetAsset
Data fetched based on the location provided by CMR.
- field collection_concept_id: str [Required][source]¶
The CMR unique collection concept identifier.
- Constraints
minLength = 1
- Validated by
validate_id_fields
clean_all_string_fields
- pydantic model qgreenland.models.config.asset.CommandAsset[source]¶
Bases:
qgreenland.models.config.asset.DatasetAsset
Data that are fetched via an arbitrary command.
Data is written to ‘{output_dir}’, which _must_ be specified in the command.
- pydantic model qgreenland.models.config.asset.DatasetAsset[source]¶
Bases:
qgreenland.models.base_model.QgrBaseModel
,abc.ABC
Actual data associated with the dataset.
Assets determine how this data is accessed.
- pydantic model qgreenland.models.config.asset.HttpAsset[source]¶
Bases:
qgreenland.models.config.asset.DatasetAsset
An asset fetched over HyperText Transfer Protocol.
- field urls: list[pydantic.networks.AnyUrl] [Required][source]¶
List of URLs to fetch.
- Validated by
clean_all_string_fields
validate_id_fields
- field verify_tls: bool = True[source]¶
Verify the server’s TLS certificate?
https://2.python-requests.org/en/master/api/#requests.Session.request
- Validated by
clean_all_string_fields
validate_id_fields
- pydantic model qgreenland.models.config.asset.ManualAsset[source]¶
Bases:
qgreenland.models.config.asset.DatasetAsset
Data that must be manually accessed by a human.
For example, data which require an interactive login.
- pydantic model qgreenland.models.config.asset.OnlineAsset[source]¶
Bases:
qgreenland.models.config.asset.DatasetAsset
A QGIS online layer that is not fetched, but is accessed by QGIS.
- field provider: Literal['gdal', 'ogr', 'wms', 'wfs', 'wcs'] [Required][source]¶
The Layer Provider to use when setting up this layer in QGIS.
- Validated by
clean_all_string_fields
validate_id_fields
- pydantic model qgreenland.models.config.asset.RepositoryAsset[source]¶
Bases:
qgreenland.models.config.asset.DatasetAsset
Data stored in this repository in ASSETS_DIR.