Weather Data Configuration Models

class encodapy.components.weather_data.weather_data_config.WeatherApiCallMethod(*values)[source]

Bases: Enum

Enum for the API call methods of the weather data service.

Members:

CURRENT: Retrieve current weather data FORECAST: Retrieve weather forecast data

CURRENT = 'current'
FORECAST = 'forecast'
pydantic model encodapy.components.weather_data.weather_data_config.WeatherDataConfigData[source]

Bases: ConfigData

Config data model for the WeatherData component

If you like to add a validator, see the documentation for ComponentData

Show JSON schema
{
   "title": "WeatherDataConfigData",
   "description": "Config data model for the WeatherData  component\n\nIf you like to add a validator, see the documentation for         :class:`~encodapy.components.basic_component_config.ComponentData`",
   "type": "object",
   "properties": {
      "longitude": {
         "$ref": "#/$defs/DataPointNumber",
         "default": {
            "value": 13.4,
            "unit": null,
            "time": null
         },
         "description": "Value of longitude of the chosen location in degree\n        (default value for Berlin)",
         "unit": "DD"
      },
      "latitude": {
         "$ref": "#/$defs/DataPointNumber",
         "default": {
            "value": 52.5,
            "unit": null,
            "time": null
         },
         "description": "Value of latitude of the chosen location in degree (default value for Berlin)",
         "unit": "DD"
      },
      "forecast_time_range": {
         "$ref": "#/$defs/DataPointTimestep",
         "default": {
            "value": 1,
            "unit": "DAY",
            "time": null
         },
         "description": "Forecast time range (for the of last weather forecast) to retrieve.\n        Default value is set to 1 day."
      },
      "time_interval_current_weather": {
         "$ref": "#/$defs/DataPointTimestep",
         "default": {
            "value": 15,
            "unit": "MIN",
            "time": null
         },
         "description": "Time interval for current weather data retrieval.\n        Default value is set to 15 minutes."
      },
      "time_interval_forecast_weather": {
         "$ref": "#/$defs/DataPointTimestep",
         "default": {
            "value": 3,
            "unit": "HUR",
            "time": null
         },
         "description": "Time interval for forecast weather data retrieval.\n        Default value is set to 3 hours."
      }
   },
   "$defs": {
      "DataPointNumber": {
         "description": "Model for datapoints with a numeric value.\n\nAttributes:\n    value (float | int): The value of the datapoint, which is a number (float, int).\n    unit (Optional[DataUnits]): Optional unit of the datapoint, if applicable.\n    time (Optional[datetime]): Optional timestamp of the datapoint, if applicable.",
         "properties": {
            "value": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "integer"
                  }
               ],
               "title": "Value"
            },
            "unit": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DataUnits"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "time": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Time"
            }
         },
         "required": [
            "value"
         ],
         "title": "DataPointNumber",
         "type": "object"
      },
      "DataPointTimestep": {
         "description": "Model for datapoint for a timestep\n\nAttributes:\n    value (float | int): The value of the datapoint, which is a number (float, int).\n    unit (DataUnits): Unit of the timestep\n    time (Optional[datetime]): Optional timestamp of the datapoint, if applicable.",
         "properties": {
            "value": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "integer"
                  }
               ],
               "title": "Value"
            },
            "unit": {
               "$ref": "#/$defs/DataUnits"
            },
            "time": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Time"
            }
         },
         "required": [
            "value",
            "unit"
         ],
         "title": "DataPointTimestep",
         "type": "object"
      },
      "DataUnits": {
         "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\n\nThe enum value is the standardized unit code (e.g., \"SEC\" for seconds).\nThe pint_unit attribute contains the corresponding pint unit string for conversion.\n\nTo add a new unit, add it to the DataUnits enum: UNIT_NAME = (\"CODE\", \"pint_string\")\nThe _UNIT_MAP will be generated automatically from the pint_unit attributes.\n\nUsage:\n    - DataUnits.PERCENT.value -> \"P1\" (unit code, for serialization)\n    - DataUnits.PERCENT.pint_unit -> \"percent\" (for pint conversion)\n    - DataUnits(\"P1\") -> DataUnits.PERCENT (lookup by unit code)",
         "enum": [
            "SEC",
            "MIN",
            "HUR",
            "DAY",
            "MON",
            "ANN",
            "CEL",
            "KEL",
            "LTR",
            "MTQ",
            "MQH",
            "MQS",
            "E32",
            "L2",
            "WTT",
            "KWT",
            "WHR",
            "KWH",
            "CMT",
            "MTR",
            "MTK",
            "DD",
            "MTS",
            "P1",
            "OHM",
            "VLT",
            "A97",
            "PAL",
            "B13"
         ],
         "title": "DataUnits",
         "type": "string"
      }
   }
}

field longitude: DataPointNumber = DataPointNumber(value=13.4, unit=None, time=None)

Value of longitude of the chosen location in degree (default value for Berlin)

field latitude: DataPointNumber = DataPointNumber(value=52.5, unit=None, time=None)

Value of latitude of the chosen location in degree (default value for Berlin)

field forecast_time_range: DataPointTimestep = DataPointTimestep(value=1, unit=<DataUnits.DAY: 'DAY'>, time=None)

Forecast time range (for the of last weather forecast) to retrieve. Default value is set to 1 day.

field time_interval_current_weather: DataPointTimestep = DataPointTimestep(value=15, unit=<DataUnits.MINUTE: 'MIN'>, time=None)

Time interval for current weather data retrieval. Default value is set to 15 minutes.

field time_interval_forecast_weather: DataPointTimestep = DataPointTimestep(value=3, unit=<DataUnits.HOUR: 'HUR'>, time=None)

Time interval for forecast weather data retrieval. Default value is set to 3 hours.

pydantic model encodapy.components.weather_data.weather_data_config.WeatherDataInputData[source]

Bases: InputData

Input model for the WeatherData component

There is actually no input nessessary for this component, but maybe in future version.

Show JSON schema
{
   "title": "WeatherDataInputData",
   "description": "Input model for the WeatherData component\n\nThere is actually no input nessessary for this component, but maybe in future version.",
   "type": "object",
   "properties": {}
}

pydantic model encodapy.components.weather_data.weather_data_config.WeatherDataOutputData[source]

Bases: OutputData

Output model for the WeatherData component

If you like to add a validator, see the documentation for ComponentData

Show JSON schema
{
   "title": "WeatherDataOutputData",
   "description": "Output model for the WeatherData component\n\nIf you like to add a validator, see the documentation for         :class:`~encodapy.components.basic_component_config.ComponentData`",
   "type": "object",
   "properties": {
      "temperature": {
         "anyOf": [
            {
               "$ref": "#/$defs/DataPointNumber"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Air temperature at timestamp, 2 m above the ground in degree celsius",
         "unit": "CEL",
         "weather_type": "current"
      },
      "relative_humidity": {
         "anyOf": [
            {
               "$ref": "#/$defs/DataPointNumber"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Relative humidity at timestamp in %",
         "unit": "P1",
         "weather_type": "current"
      },
      "pressure_msl": {
         "anyOf": [
            {
               "$ref": "#/$defs/DataPointNumber"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Atmospheric pressure at timestamp, reduced to mean sea level in pascal",
         "unit": "PAL",
         "weather_type": "current"
      },
      "dew_point": {
         "anyOf": [
            {
               "$ref": "#/$defs/DataPointNumber"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Dew point at timestamp, 2 m above ground in degree celsius",
         "unit": "CEL",
         "weather_type": "current"
      },
      "solar_60": {
         "anyOf": [
            {
               "$ref": "#/$defs/DataPointNumber"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Solar irradiation during previous 60 minutes in J / m\u00b2",
         "unit": "B13",
         "weather_type": "current"
      },
      "forecast_temperature": {
         "anyOf": [
            {
               "$ref": "#/$defs/DataPointDict"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Forecast temperature data",
         "unit": "CEL",
         "weather_type": "forecast"
      },
      "forecast_solar": {
         "anyOf": [
            {
               "$ref": "#/$defs/DataPointDict"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Forecast solar irradiation data during previous 60 minutes in J/m\u00b2",
         "unit": "B13",
         "weather_type": "forecast"
      }
   },
   "$defs": {
      "DataPointDict": {
         "description": "Model for datapoints with a dictionary value.\n\nAttributes:\n    value (dict): The value of the datapoint, which is a dictionary.\n    unit (Optional[DataUnits]): Optional unit of the datapoint, if applicable.\n    time (Optional[datetime]): Optional timestamp of the datapoint, if applicable.",
         "properties": {
            "value": {
               "additionalProperties": true,
               "title": "Value",
               "type": "object"
            },
            "unit": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DataUnits"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "time": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Time"
            }
         },
         "required": [
            "value"
         ],
         "title": "DataPointDict",
         "type": "object"
      },
      "DataPointNumber": {
         "description": "Model for datapoints with a numeric value.\n\nAttributes:\n    value (float | int): The value of the datapoint, which is a number (float, int).\n    unit (Optional[DataUnits]): Optional unit of the datapoint, if applicable.\n    time (Optional[datetime]): Optional timestamp of the datapoint, if applicable.",
         "properties": {
            "value": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "integer"
                  }
               ],
               "title": "Value"
            },
            "unit": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DataUnits"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "time": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Time"
            }
         },
         "required": [
            "value"
         ],
         "title": "DataPointNumber",
         "type": "object"
      },
      "DataUnits": {
         "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\n\nThe enum value is the standardized unit code (e.g., \"SEC\" for seconds).\nThe pint_unit attribute contains the corresponding pint unit string for conversion.\n\nTo add a new unit, add it to the DataUnits enum: UNIT_NAME = (\"CODE\", \"pint_string\")\nThe _UNIT_MAP will be generated automatically from the pint_unit attributes.\n\nUsage:\n    - DataUnits.PERCENT.value -> \"P1\" (unit code, for serialization)\n    - DataUnits.PERCENT.pint_unit -> \"percent\" (for pint conversion)\n    - DataUnits(\"P1\") -> DataUnits.PERCENT (lookup by unit code)",
         "enum": [
            "SEC",
            "MIN",
            "HUR",
            "DAY",
            "MON",
            "ANN",
            "CEL",
            "KEL",
            "LTR",
            "MTQ",
            "MQH",
            "MQS",
            "E32",
            "L2",
            "WTT",
            "KWT",
            "WHR",
            "KWH",
            "CMT",
            "MTR",
            "MTK",
            "DD",
            "MTS",
            "P1",
            "OHM",
            "VLT",
            "A97",
            "PAL",
            "B13"
         ],
         "title": "DataUnits",
         "type": "string"
      }
   }
}

field temperature: DataPointNumber | None = None

Air temperature at timestamp, 2 m above the ground in degree celsius

field relative_humidity: DataPointNumber | None = None

Relative humidity at timestamp in %

field pressure_msl: DataPointNumber | None = None

Atmospheric pressure at timestamp, reduced to mean sea level in pascal

field dew_point: DataPointNumber | None = None

Dew point at timestamp, 2 m above ground in degree celsius

field solar_60: DataPointNumber | None = None

Solar irradiation during previous 60 minutes in J / m²

field forecast_temperature: DataPointDict | None = None

Forecast temperature data

field forecast_solar: DataPointDict | None = None

Forecast solar irradiation data during previous 60 minutes in J/m²

classmethod get_weather_types() → Dict[str, str][source]

get a dict with {key: weather_type} for all fields in this class, which defines “weather_type” in json_schema_extra.

Return type:

Dict[str, str]