Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Pemsel committed Jul 30, 2024
2 parents df977ab + 98bfe18 commit 8ec7fbc
Show file tree
Hide file tree
Showing 49 changed files with 612 additions and 136 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/wattadvisor/data_models/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,61 @@ Classes

.. autoapisummary::

wattadvisor.data_models.config_model.ConfigModelDataDependencies
wattadvisor.data_models.config_model.ConfigModelWeatherDataPathCsv
wattadvisor.data_models.config_model.ConfigModelWeatherDataPathNetcdf
wattadvisor.data_models.config_model.ConfigModelWeatherData
wattadvisor.data_models.config_model.ConfigModelLogging
wattadvisor.data_models.config_model.ConfigModel


Module Contents
---------------

.. py:class:: ConfigModelDataDependencies
.. py:class:: ConfigModelWeatherDataPathCsv
Bases: :py:obj:`pydantic.BaseModel`


.. py:attribute:: weather
.. py:attribute:: csv_solar
:type: str


.. py:attribute:: parameters
.. py:attribute:: csv_temperature
:type: str


.. py:attribute:: csv_wind
:type: str


.. py:method:: is_file(v)
.. py:class:: ConfigModelWeatherDataPathNetcdf
Bases: :py:obj:`pydantic.BaseModel`


.. py:attribute:: netcdf
:type: str


.. py:method:: is_file(v)
.. py:class:: ConfigModelWeatherData
Bases: :py:obj:`pydantic.BaseModel`


.. py:attribute:: source
:type: wattadvisor.data_models.enums.WeatherDataSource


.. py:attribute:: path
:type: ConfigModelWeatherDataPathNetcdf | ConfigModelWeatherDataPathCsv


.. py:class:: ConfigModelLogging
Bases: :py:obj:`pydantic.BaseModel`
Expand Down Expand Up @@ -84,8 +115,12 @@ Module Contents
:type: float


.. py:attribute:: data_dependencies
:type: ConfigModelDataDependencies
.. py:attribute:: weather_data
:type: ConfigModelWeatherData


.. py:attribute:: parameters_path
:type: str


.. py:attribute:: logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Classes
wattadvisor.data_models.enums.OptimizationStatus
wattadvisor.data_models.enums.SupportedSolver
wattadvisor.data_models.enums.WeatherDataLib
wattadvisor.data_models.enums.WeatherDataSource


Module Contents
Expand Down Expand Up @@ -140,11 +141,29 @@ Module Contents



.. py:attribute:: MWH
:value: 'MWH'



.. py:attribute:: KWH
:value: 'KWH'



.. py:attribute:: WH
:value: 'WH'



.. py:method:: get_conversion_factor() -> float | int
Returns the unit conversion factor to convert values into ``EnergyUnit.KWH``





.. py:class:: PurchaseComponent(*args, **kwds)
Bases: :py:obj:`enum.Enum`
Expand Down Expand Up @@ -484,3 +503,23 @@ Module Contents



.. py:class:: WeatherDataSource(*args, **kwds)
Bases: :py:obj:`enum.Enum`


Supported sources for weather data




.. py:attribute:: CUSTOM_CSV
:value: 'custom_csv'



.. py:attribute:: ERA5_NETCDF
:value: 'era5_netcdf'



Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Submodules
/autoapi/wattadvisor/data_models/config_model/index
/autoapi/wattadvisor/data_models/enums/index
/autoapi/wattadvisor/data_models/input_model/index
/autoapi/wattadvisor/data_models/input_model_component_normed_production_object/index
/autoapi/wattadvisor/data_models/input_model_component_object/index
/autoapi/wattadvisor/data_models/input_model_demand_object/index
/autoapi/wattadvisor/data_models/input_model_energy_tariffs/index
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
wattadvisor.data_models.input_model_component_normed_production_object
======================================================================

.. py:module:: wattadvisor.data_models.input_model_component_normed_production_object
.. autoapi-nested-parse::

Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.



Classes
-------

.. autoapisummary::

wattadvisor.data_models.input_model_component_normed_production_object.NormedProduction


Module Contents
---------------

.. py:class:: NormedProduction
Bases: :py:obj:`pydantic.BaseModel`


.. py:attribute:: production_values
:type: list[confloat(ge=0)]


.. py:attribute:: resolution
:type: wattadvisor.data_models.enums.Resolution


.. py:attribute:: unit
:type: wattadvisor.data_models.enums.EnergyUnit


Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Module Contents
:type: Optional[float]


.. py:attribute:: normed_production
:type: Optional[wattadvisor.data_models.input_model_component_normed_production_object.NormedProduction]


.. py:class:: InputModelComponentArea
Bases: :py:obj:`pydantic.BaseModel`
Expand Down Expand Up @@ -81,6 +85,10 @@ Module Contents
:type: Optional[float]


.. py:attribute:: normed_production
:type: Optional[wattadvisor.data_models.input_model_component_normed_production_object.NormedProduction]


.. py:class:: InputModelComponentStorage
Bases: :py:obj:`pydantic.BaseModel`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Classes
Module Contents
---------------

.. py:class:: Photovoltaik(name: str, interest_rate: float, parameters: dict, latitude: float, longitude: float, weather_data: pandas.DataFrame, installed_power: float, potential_power: float | None = None, capex: float | None = None, opex: float | None = None, lifespan: float | None = None, azimuth: float = 180, tilt: float = 40, elevation: float = 0)
.. py:class:: Photovoltaik(name: str, interest_rate: float, parameters: dict, latitude: float, longitude: float, weather_data: pandas.DataFrame, installed_power: float, potential_power: float | None = None, capex: float | None = None, opex: float | None = None, lifespan: float | None = None, azimuth: float = 180, tilt: float = 40, elevation: float = 0, normed_production: pandas.Series | None = None)
Bases: :py:obj:`wattadvisor.optimization_model.components.base.Component`

Expand Down Expand Up @@ -86,6 +86,9 @@ Module Contents

elevation : float, optional
elevation of the location of the photovoltaic plant above sea level [m], by default 0
normed_production : pd.Series | None, optional
Determinated normed energy production series which can be given as an input. If given,
calculation of normed production by the usage of 'weather_data' is skipped.


.. py:attribute:: installed_power
Expand All @@ -112,7 +115,10 @@ Module Contents
.. py:attribute:: elevation
.. py:class:: PhotovoltaikRoof(name: str, interest_rate: float, parameters: dict, latitude: float, longitude: float, weather_data: pandas.DataFrame, installed_power: float, potential_power: float | None = None, capex: float | None = None, opex: float | None = None, lifespan: float | None = None, azimuth: float = 180, tilt: float = 40, elevation: float = 0)
.. py:attribute:: normed_production
.. py:class:: PhotovoltaikRoof(name: str, interest_rate: float, parameters: dict, latitude: float, longitude: float, weather_data: pandas.DataFrame, installed_power: float, potential_power: float | None = None, capex: float | None = None, opex: float | None = None, lifespan: float | None = None, azimuth: float = 180, tilt: float = 40, elevation: float = 0, normed_production: pandas.Series | None = None)
Bases: :py:obj:`Photovoltaik`

Expand Down Expand Up @@ -175,9 +181,12 @@ Module Contents

elevation : float, optional
elevation of the location of the photovoltaic plant above sea level [m], by default 0
normed_production : pd.Series | None, optional
Determinated normed energy production series which can be given as an input. If given,
calculation of normed production by the usage of 'weather_data' is skipped.


.. py:class:: PhotovoltaikFreeField(name: str, interest_rate: float, parameters: dict, latitude: float, longitude: float, weather_data: pandas.DataFrame, installed_power: float, potential_power: float | None = None, capex: float | None = None, opex: float | None = None, lifespan: float | None = None, azimuth: float = 180, tilt: float = 40, elevation: float = 0)
.. py:class:: PhotovoltaikFreeField(name: str, interest_rate: float, parameters: dict, latitude: float, longitude: float, weather_data: pandas.DataFrame, installed_power: float, potential_power: float | None = None, capex: float | None = None, opex: float | None = None, lifespan: float | None = None, azimuth: float = 180, tilt: float = 40, elevation: float = 0, normed_production: pandas.Series | None = None)
Bases: :py:obj:`Photovoltaik`

Expand Down Expand Up @@ -240,5 +249,8 @@ Module Contents

elevation : float, optional
elevation of the location of the photovoltaic plant above sea level [m], by default 0
normed_production : pd.Series | None, optional
Determinated normed energy production series which can be given as an input. If given,
calculation of normed production by the usage of 'weather_data' is skipped.


Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Classes
Module Contents
---------------

.. py:class:: SolarthermalEnergy(name: str, interest_rate: float, parameters: dict, weather_data: pandas.Series, installed_area: float, potential_area: float | None = None, capex: float | None = None, opex: float | None = None, lifespan: float | None = None)
.. py:class:: SolarthermalEnergy(name: str, interest_rate: float, parameters: dict, weather_data: pandas.Series, installed_area: float, potential_area: float | None = None, capex: float | None = None, opex: float | None = None, lifespan: float | None = None, normed_production: pandas.Series | None = None)
Bases: :py:obj:`wattadvisor.optimization_model.components.base.Component`

Expand Down Expand Up @@ -64,6 +64,9 @@ Module Contents
Operational expenditure cost of the component per CAPEX per year [%/a], by default None
lifespan : float | None, optional
Expected lifespan of the component [a], by default None
normed_production : pd.Series | None, optional
Determinated normed energy production series which can be given as an input. If given,
calculation of normed production by the usage of 'weather_data' is skipped.


.. py:attribute:: installed_area
Expand All @@ -75,3 +78,6 @@ Module Contents
.. py:attribute:: weather_data
.. py:attribute:: normed_production
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Classes
Module Contents
---------------

.. py:class:: WindPower(name: str, interest_rate: float, parameters: dict, latitude: float, longitude: float, weather_data: pandas.DataFrame, installed_power: float, potential_power: float | None = None, capex: float | None = None, opex: float | None = None, lifespan: float | None = None, hub_height: float = 100)
.. py:class:: WindPower(name: str, interest_rate: float, parameters: dict, latitude: float, longitude: float, weather_data: pandas.DataFrame, installed_power: float, potential_power: float | None = None, capex: float | None = None, opex: float | None = None, lifespan: float | None = None, hub_height: float = 100, normed_production: pandas.Series | None = None)
Bases: :py:obj:`wattadvisor.optimization_model.components.base.Component`

Expand Down Expand Up @@ -68,6 +68,9 @@ Module Contents
Operational expenditure cost of the component per CAPEX per year [%/a], by default None
hub_height: float
height of the wind power plant hub above ground of the plant [m], by default 200
normed_production : pd.Series | None, optional
Determinated normed energy production series which can be given as an input. If given,
calculation of normed production by the usage of 'weather_data' is skipped.


.. py:attribute:: installed_power
Expand All @@ -88,3 +91,6 @@ Module Contents
.. py:attribute:: hub_height
.. py:attribute:: normed_production
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Module Contents

.. py:data:: logger
.. py:function:: compose(input: wattadvisor.data_models.input_model.InputModel, parameters: dict, config: wattadvisor.data_models.config_model.ConfigModel, pyomo_model: pyomo.core.base.PyomoModel.Model, t: pyomo.core.base.set.RangeSet, model_path: pathlib.Path) -> tuple[pyomo.core.base.PyomoModel.Model, list[wattadvisor.optimization_model.components.base.Component]]
.. py:function:: compose(input: wattadvisor.data_models.input_model.InputModel, parameters: dict, config: wattadvisor.data_models.config_model.ConfigModel, pyomo_model: pyomo.core.base.PyomoModel.Model, t: pyomo.core.base.set.RangeSet) -> tuple[pyomo.core.base.PyomoModel.Model, list[wattadvisor.optimization_model.components.base.Component]]
Adds all relevant components to the pyomo optimization model `pyomo_model` based on the parameterization in the input request `input` and creates the objective.

Expand All @@ -45,8 +45,8 @@ Module Contents
:type pyomo_model: Model
:param t: Time set to use for variable, parameter and constraint creation
:type t: RangeSet
:param model_path: Path of the model base directory
:type model_path: Path
:param weather_data_path: Path where weather data is placed.
:type weather_data_path: Path or None, default None

:returns: The optimization model with all components added and a separate list of all component objects added to the model.
:rtype: tuple[Model, list[Component]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ Module Contents
.. py:attribute:: logger
.. py:method:: run_calculation(export: bool = False, export_filename: str = None) -> wattadvisor.data_models.optimization_results_model.OptimizationResultsModel
.. py:method:: run_calculation(export_detailed_results: bool = False, export_detailed_results_path: None | pathlib.Path = None) -> wattadvisor.data_models.optimization_results_model.OptimizationResultsModel
Starts the calculation of an optimization model including
building of the pyomo model, optimization by solver and building result output.

:param export: Whether detailed result time series should be exported to an Excel file, by default False
:type export: bool, optional
:param export_filename: Path of the Excel file to write detailed results with time series to, by default None
:type export_filename: str, optional
:param export_detailed_results: Whether detailed result time series should be exported to an Excel file, by default False
:type export_detailed_results: bool, optional
:param export_detailed_results_path: Path of the Excel file to write detailed results with time series to
:type export_detailed_results_path: None or Path

:returns: Results object which is returned by the service as response
:rtype: OptimizationResultsModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ Functions
Module Contents
---------------

.. py:function:: run(config: wattadvisor.data_models.config_model.ConfigModel, inputdata: wattadvisor.data_models.input_model.InputModel, export: bool = False) -> wattadvisor.data_models.optimization_results_model.OptimizationResultsModel
.. py:function:: run(input_model: wattadvisor.data_models.input_model.InputModel, config_path: None | pathlib.Path = None, export_detailed_results: bool = False, export_detailed_results_path: None | pathlib.Path = None) -> wattadvisor.data_models.optimization_results_model.OptimizationResultsModel
Starts an optimization by using static input data from memory.

:param config: optimization model config object
:type config: ConfigModel
:param inputdata: input data to build the optimization model
:type inputdata: InputModel
:param export: whether to export detailed result time series to separate excel file, by default False
:type export: bool, optional
:param input_model:
:type input_model: InputModel
:param input data to build the optimization model:
:param config_path: path where the optimization model config file is located, by default "./wattadvisor/optimization_model/model_config.yaml"
:type config_path: None or Path
:param export_detailed_results: whether to export detailed result time series to separate excel file, by default False
:type export_detailed_results: bool, optional
:param export_detailed_results_path: path where detailed result file should be placed
:type export_detailed_results_path: None or Path, default None

:returns: pydantic object representing optimization results
:rtype: OptimizationResultsModel
Expand Down
Loading

0 comments on commit 8ec7fbc

Please sign in to comment.