Data Models#
Core data structures used throughout NREL-shift.
GeoLocation#
- class shift.GeoLocation(longitude: Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Longitude coordinate of the parcel.', metadata=[Ge(ge=-180), Le(le=180)])], latitude: Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Latitude coordinate of the parcel.', metadata=[Ge(ge=-90), Le(le=90)])])#
Interface for geo location.
Create new instance of GeoLocation(longitude, latitude)
- longitude: Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Longitude coordinate of the parcel.', metadata=[Ge(ge=-180), Le(le=180)])]#
Alias for field number 0
- latitude: Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Latitude coordinate of the parcel.', metadata=[Ge(ge=-90), Le(le=90)])]#
Alias for field number 1
ParcelModel#
- pydantic model shift.ParcelModel#
Interface for parcel model.
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.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "ParcelModel", "description": "Interface for parcel model.", "type": "object", "properties": { "name": { "description": "Name of the parcel.", "title": "Name", "type": "string" }, "geometry": { "anyOf": [ { "items": { "$ref": "#/$defs/GeoLocation" }, "type": "array" }, { "$ref": "#/$defs/GeoLocation" } ], "description": "Geo location for the parcel.", "title": "Geometry" }, "building_type": { "description": "Type of building.", "title": "Building Type", "type": "string" }, "city": { "description": "City the parcel is locatied in.", "title": "City", "type": "string" }, "state": { "description": "State the parcel is locatied in.", "title": "State", "type": "string" }, "postal_address": { "description": "Postal code the parcel is locatied in.", "title": "Postal Address", "type": "string" } }, "$defs": { "GeoLocation": { "maxItems": 2, "minItems": 2, "prefixItems": [ { "description": "Longitude coordinate of the parcel.", "maximum": 180, "minimum": -180, "title": "Longitude", "type": "number" }, { "description": "Latitude coordinate of the parcel.", "maximum": 90, "minimum": -90, "title": "Latitude", "type": "number" } ], "type": "array" } }, "required": [ "name", "geometry", "building_type", "city", "state", "postal_address" ] }
- Fields:
building_type (str)city (str)geometry (list[shift.data_model.GeoLocation] | shift.data_model.GeoLocation)name (str)postal_address (str)state (str)
- field building_type: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Type of building.')] [Required]#
Type of building.
- field city: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='City the parcel is locatied in.')] [Required]#
City the parcel is locatied in.
- field geometry: Annotated[list[GeoLocation] | GeoLocation, FieldInfo(annotation=NoneType, required=True, description='Geo location for the parcel.')] [Required]#
Geo location for the parcel.
- field name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Name of the parcel.')] [Required]#
Name of the parcel.
- field postal_address: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Postal code the parcel is locatied in.')] [Required]#
Postal code the parcel is locatied in.
- field state: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='State the parcel is locatied in.')] [Required]#
State the parcel is locatied in.
GroupModel#
- pydantic model shift.GroupModel#
Interface for group model.
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.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "GroupModel", "description": "Interface for group model.", "type": "object", "properties": { "center": { "$ref": "#/$defs/GeoLocation", "description": "Centre of the cluster." }, "points": { "description": "List of points that belong to this cluster.", "items": { "$ref": "#/$defs/GeoLocation" }, "title": "Points", "type": "array" } }, "$defs": { "GeoLocation": { "maxItems": 2, "minItems": 2, "prefixItems": [ { "description": "Longitude coordinate of the parcel.", "maximum": 180, "minimum": -180, "title": "Longitude", "type": "number" }, { "description": "Latitude coordinate of the parcel.", "maximum": 90, "minimum": -90, "title": "Latitude", "type": "number" } ], "type": "array" } }, "required": [ "center", "points" ] }
- Fields:
center (shift.data_model.GeoLocation)points (list[shift.data_model.GeoLocation])
- field center: Annotated[GeoLocation, FieldInfo(annotation=NoneType, required=True, description='Centre of the cluster.')] [Required]#
Centre of the cluster.
- field points: Annotated[list[GeoLocation], FieldInfo(annotation=NoneType, required=True, description='List of points that belong to this cluster.')] [Required]#
List of points that belong to this cluster.
NodeModel#
- pydantic model shift.NodeModel#
Interface for node model.
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.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "NodeModel", "description": "Interface for node model.", "type": "object", "properties": { "name": { "description": "Name of the node.", "title": "Name", "type": "string" }, "location": { "$ref": "#/$defs/Location", "description": "Location of node." }, "assets": { "anyOf": [ { "items": { "description": "Possible node types." }, "type": "array", "uniqueItems": true }, { "type": "null" } ], "default": {}, "description": "Set of asset types attached to node.", "title": "Assets" } }, "$defs": { "Location": { "additionalProperties": false, "description": "Specifies geographic location.", "properties": { "uuid": { "format": "uuid", "title": "Uuid", "type": "string" }, "name": { "default": "", "title": "Name", "type": "string" }, "x": { "title": "X", "type": "number" }, "y": { "title": "Y", "type": "number" }, "crs": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Crs" } }, "required": [ "x", "y" ], "title": "Location", "type": "object" } }, "required": [ "name", "location" ] }
- Fields:
assets (set[Type[gdm.distribution.components.distribution_load.DistributionLoad] | Type[gdm.distribution.components.distribution_solar.DistributionSolar] | Type[gdm.distribution.components.distribution_capacitor.DistributionCapacitor] | Type[gdm.distribution.components.distribution_vsource.DistributionVoltageSource]] | None)location (infrasys.location.Location)name (str)
- field assets: ')] = {}#
Set of asset types attached to node.
- field location: Annotated[Location, FieldInfo(annotation=NoneType, required=True, description='Location of node.')] [Required]#
Location of node.
- field name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Name of the node.')] [Required]#
Name of the node.
EdgeModel#
- pydantic model shift.EdgeModel#
Interface for edge model.
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.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "EdgeModel", "description": "Interface for edge model.", "type": "object", "properties": { "name": { "description": "Name of the node.", "title": "Name", "type": "string" }, "edge_type": { "description": "Edge type.", "title": "Edge Type" }, "length": { "anyOf": [ {}, { "type": "null" } ], "default": null, "description": "Length of edge.", "title": "Length" } }, "required": [ "name", "edge_type" ] }
- Config:
arbitrary_types_allowed: bool = True
- Fields:
edge_type (Type[gdm.distribution.components.base.distribution_branch_base.DistributionBranchBase] | Type[gdm.distribution.components.distribution_transformer.DistributionTransformer])length (infrasys.quantities.Distance | None)name (str)
- Validators:
validate_fields»all fields
- field edge_type: Annotated[Type[DistributionBranchBase] | Type[DistributionTransformer], FieldInfo(annotation=NoneType, required=True, description='Possible edge types.'), FieldInfo(annotation=NoneType, required=True, description='Edge type.')] [Required]#
Edge type.
- Validated by:
validate_fields
- field length: Annotated[Distance | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Length of edge.')] = None#
Length of edge.
- Validated by:
validate_fields
- field name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Name of the node.')] [Required]#
Name of the node.
- Validated by:
validate_fields
- validator validate_fields » all fields#
TransformerPhaseMapperModel#
- pydantic model shift.TransformerPhaseMapperModel#
Class interface for phase mapper model.
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.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "TransformerPhaseMapperModel", "description": "Class interface for phase mapper model.", "type": "object", "properties": { "tr_name": { "title": "Tr Name", "type": "string" }, "tr_type": { "$ref": "#/$defs/TransformerTypes" }, "tr_capacity": { "title": "Tr Capacity" }, "location": { "$ref": "#/$defs/Location" } }, "$defs": { "Location": { "additionalProperties": false, "description": "Specifies geographic location.", "properties": { "uuid": { "format": "uuid", "title": "Uuid", "type": "string" }, "name": { "default": "", "title": "Name", "type": "string" }, "x": { "title": "X", "type": "number" }, "y": { "title": "Y", "type": "number" }, "crs": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Crs" } }, "required": [ "x", "y" ], "title": "Location", "type": "object" }, "TransformerTypes": { "description": "Enumerator for transformer types for phase allocation.", "enum": [ "THREE_PHASE", "SINGLE_PHASE_PRIMARY_DELTA", "SINGLE_PHASE", "SPLIT_PHASE", "SPLIT_PHASE_PRIMARY_DELTA" ], "title": "TransformerTypes", "type": "string" } }, "required": [ "tr_name", "tr_type", "tr_capacity", "location" ] }
- Config:
arbitrary_types_allowed: bool = True
- Fields:
location (infrasys.location.Location)tr_capacity (gdm.quantities.ApparentPower)tr_name (str)tr_type (shift.data_model.TransformerTypes)
- field location: Location [Required]#
- field tr_capacity: ApparentPower [Required]#
- field tr_name: str [Required]#
- field tr_type: TransformerTypes [Required]#
TransformerVoltageModel#
- pydantic model shift.TransformerVoltageModel#
Interface for transformer voltage model.
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.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "TransformerVoltageModel", "description": "Interface for transformer voltage model.", "type": "object", "properties": { "name": { "description": "Name of the transformer.", "title": "Name", "type": "string" }, "voltages": { "description": "List of transformer voltages.", "items": {}, "title": "Voltages", "type": "array" } }, "required": [ "name", "voltages" ] }
- Config:
arbitrary_types_allowed: bool = True
- Fields:
name (str)voltages (list[infrasys.quantities.Voltage])
- field name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Name of the transformer.')] [Required]#
Name of the transformer.
- field voltages: Annotated[list[Voltage], FieldInfo(annotation=NoneType, required=True, description='List of transformer voltages.')] [Required]#
List of transformer voltages.
TransformerTypes#
- class shift.TransformerTypes(value)#
Enumerator for transformer types for phase allocation.
Type Aliases#
VALID_NODE_TYPES:DistributionLoad | DistributionSolar | DistributionCapacitor | DistributionVoltageSourceVALID_EDGE_TYPES:DistributionBranchBase | DistributionTransformer