diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9c3bc73..296d6e6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,8 +1,8 @@ -Changelog -========= - 0.0.0 (2021-06-10) ------------------- +++++++++++++++++++ + +Includ from CHANGELOG.rst +######################### * First release on PyPI. diff --git a/README.rst b/README.rst index 15d291d..0f069b1 100644 --- a/README.rst +++ b/README.rst @@ -4,10 +4,7 @@ Overview .. start-badges -.. list-table:: - :stub-columns: 1 - -|workflow_pytests| |workflow_checks| |docs| |appveyor| |requires| |coveralls| |packaging| +|workflow_pytests| |workflow_checks| |docs| |requires| |coveralls| |packaging| |version| |wheel| |supported-versions| |supported-implementations| |commits-since| .. |docs| image:: https://readthedocs.org/projects/feedinlib/badge/?style=flat @@ -31,9 +28,9 @@ Overview :alt: Requirements Status :target: https://requires.io/github/oemof/feedinlib/requirements/?branch=master -.. |coveralls| image:: https://coveralls.io/repos/oemof/feedinlib/badge.svg?branch=master&service=github +.. |coveralls| image:: https://coveralls.io/repos/github/oemof/feedinlib/badge.svg?branch=dev :alt: Coverage Status - :target: https://coveralls.io/r/oemof/feedinlib + :target: https://coveralls.io/github/oemof/feedinlib?branch=dev .. |version| image:: https://img.shields.io/pypi/v/feedinlib.svg :alt: PyPI Package latest release diff --git a/docs/api.rst b/docs/api.rst index 3fc196e..28655bf 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,8 +1,8 @@ .. _api: -############# +### API -############# +### Power plant classes @@ -31,7 +31,7 @@ wind power feed-in, respectively, have been implemented. feedinlib.models.WindpowerlibTurbineCluster Weather data -==================== +============ The feedinlib enables download of open_FRED weather data (local reanalysis data for Germany) and ERA5 weather data (global reanalysis data for the whole world). @@ -44,7 +44,7 @@ and ERA5 weather data (global reanalysis data for the whole world). feedinlib.era5.get_era5_data_from_datespan_and_position Tools -==================== +===== .. autosummary:: :toctree: temp/ @@ -52,18 +52,18 @@ Tools feedinlib.models.get_power_plant_data Abstract classes -==================== +================ The feedinlib uses abstract classes for power plant and feed-in models that serve as blueprints for classes that implement those models. This ensures that new models provide required implementations that make it possible to easily exchange the model used in your calculation. -They are important for people who want to implement new power plant and model classes +They are important for people who want to implement new power plant and model classes rather than for users. .. autosummary:: :toctree: temp/ feedinlib.powerplants.Base - feedinlib.models.Base - feedinlib.models.PhotovoltaicModelBase - feedinlib.models.WindpowerModelBase \ No newline at end of file + feedinlib.models.base.Base + feedinlib.models.base.PhotovoltaicModelBase + feedinlib.models.base.WindpowerModelBase diff --git a/docs/changelog.rst b/docs/changelog.rst index 565b052..bb5941a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1 +1,19 @@ +Changelog +========= + +These are new features and improvements of note in each release + +.. contents:: `Releases` + :depth: 1 + :local: + :backlinks: top + .. include:: ../CHANGELOG.rst + +.. include:: whatsnew/v0-1-0.rst +.. include:: whatsnew/v00012.rst +.. include:: whatsnew/v00011.rst +.. include:: whatsnew/v00010.rst +.. include:: whatsnew/v0009.rst +.. include:: whatsnew/v0008.rst +.. include:: whatsnew/v0007.rst diff --git a/docs/conf.py b/docs/conf.py index c64003e..89edca6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,43 +4,62 @@ import os extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', - 'sphinx.ext.coverage', - 'sphinx.ext.doctest', - 'sphinx.ext.extlinks', - 'sphinx.ext.ifconfig', - 'sphinx.ext.napoleon', - 'sphinx.ext.todo', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.coverage", + "sphinx.ext.doctest", + "sphinx.ext.extlinks", + "sphinx.ext.ifconfig", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", ] -source_suffix = '.rst' -master_doc = 'index' -project = 'feedinlib' -year = '2015-2021' -author = 'oemof developer group' -copyright = '{0}, {1}'.format(year, author) -version = release = '0.0.0' +source_suffix = ".rst" +master_doc = "index" +project = "feedinlib" +year = "2015-2021" +author = "oemof developer group" +copyright = "{0}, {1}".format(year, author) +version = release = "0.0.0" -pygments_style = 'trac' -templates_path = ['.'] +pygments_style = "trac" +templates_path = ["_templates"] extlinks = { - 'issue': ('https://github.com/oemof/feedinlib/issues/%s', '#'), - 'pr': ('https://github.com/oemof/feedinlib/pull/%s', 'PR #'), + "pandas": ("https://pandas.pydata.org/docs/reference/api/%s.html", ""), + "pvlib": ( + "https://pvlib-python.readthedocs.io/en/stable/generated/%s.html#", + "", + ), + "windpowerlib": ( + "https://windpowerlib.readthedocs.io/en/stable/temp/%s.html#", + "", + ), + # work around for wind turbine attributes + "wind_turbine": ( + ( + "https://windpowerlib.readthedocs.io/en/stable/temp/windpowerlib." + "wind_turbine.WindTurbine.html#%s" + ), + "", + ), + "shapely": ( + "https://shapely.readthedocs.io/en/latest/manual.html#%s", + "shapely.", + ), + "issue": ("https://github.com/oemof/feedinlib/issues/%s", "#"), + "pr": ("https://github.com/oemof/feedinlib/pull/%s", "PR #"), } # on_rtd is whether we are on readthedocs.org -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' +on_rtd = os.environ.get("READTHEDOCS", None) == "True" if not on_rtd: # only set the theme if we're building docs locally - html_theme = 'sphinx_rtd_theme' + html_theme = "sphinx_rtd_theme" html_use_smartypants = True -html_last_updated_fmt = '%b %d, %Y' +html_last_updated_fmt = "%b %d, %Y" html_split_index = False -html_sidebars = { - '**': ['searchbox.html', 'globaltoc.html', 'sourcelink.html'], -} -html_short_title = '%s-%s' % (project, version) +html_sidebars = {"**": ["searchbox.html", "globaltoc.html", "sourcelink.html"]} +html_short_title = "%s-%s" % (project, version) napoleon_use_ivar = True napoleon_use_rtype = False diff --git a/docs/examples.rst b/docs/examples.rst index 566c0e6..f39d436 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -4,9 +4,3 @@ Examples ############# - -.. toctree:: - load_open_fred_weather_data - load_era5_weather_data - run_pvlib_model - run_windpowerlib_turbine_model diff --git a/docs/getting_started.rst b/docs/getting_started.rst index cc9aeac..2ec6e1b 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -1,6 +1,4 @@ -~~~~~~~~~~~~~~~~~~~~~~ -Getting started -~~~~~~~~~~~~~~~~~~~~~~ +.. include:: ../README.rst The feedinlib is designed to calculate feed-in time series of photovoltaic and wind power plants. It is part of the oemof group but works as a standalone application. @@ -41,10 +39,10 @@ Examples and basic usage The basic usage of the feedinlib is shown in the :ref:`examples_section_label` section. The examples are provided as jupyter notebooks that you can download here: - * :download:`ERA5 weather data example <../example/load_era5_weather_data.ipynb>` - * :download:`open_FRED weather data example <../example/load_open_fred_weather_data.ipynb>` - * :download:`pvlib model example <../example/run_pvlib_model.ipynb>` - * :download:`windpowerlib model example <../example/run_windpowerlib_turbine_model.ipynb>` + * :download:`ERA5 weather data example <../examples/load_era5_weather_data.ipynb>` + * :download:`open_FRED weather data example <../examples/load_open_fred_weather_data.ipynb>` + * :download:`pvlib model example <../examples/run_pvlib_model.ipynb>` + * :download:`windpowerlib model example <../examples/run_windpowerlib_turbine_model.ipynb>` Furthermore, you have to install the feedinlib with additional packages needed to run the notebooks, e.g. `jupyter`. diff --git a/docs/index.rst b/docs/index.rst index bda475b..e53f359 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,7 +5,6 @@ Contents .. toctree:: :maxdepth: 2 - readme getting_started installation usage @@ -16,7 +15,6 @@ Contents contributing authors changelog - whats_new Indices and tables ================== diff --git a/docs/parameter_names.rst b/docs/parameter_names.rst index c9c891c..6a1ae4f 100644 --- a/docs/parameter_names.rst +++ b/docs/parameter_names.rst @@ -1,3 +1,6 @@ +Parameter Names +--------------- + ==================================================== ====== ================== ====== ================== ====== feedinlib windpowerlib pvlib ------------------------------------------------------------ -------------------------- -------------------------- @@ -10,4 +13,4 @@ roughness_length m roughness_length m surface_normalized_global_downwelling_shortwave_flux W/m^2 ghi W/m^2 surface_diffuse_downwelling_shortwave_flux W/m^2 dhi W/m^2 surface_normalized_direct_downwelling_shortwave_flux W/m^2 dni W/m^2 -==================================================== ====== ================== ====== ================== ====== \ No newline at end of file +==================================================== ====== ================== ====== ================== ====== diff --git a/docs/readme.rst b/docs/readme.rst deleted file mode 100644 index 72a3355..0000000 --- a/docs/readme.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../README.rst diff --git a/docs/requirements.txt b/docs/requirements.txt index 08d829b..d1fd5f0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,9 @@ sphinx>=1.4 ipykernel nbsphinx -psycopg2 psycopg2-binary sphinx-rtd-theme +geopandas +xarray +cdsapi +pvlib diff --git a/docs/usage.rst b/docs/usage.rst index a86558e..0622e29 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -2,6 +2,5 @@ Usage ===== -To use feedinlib in a project:: +To use feedinlib in a project: - import feedinlib diff --git a/docs/whats_new.rst b/docs/whats_new.rst deleted file mode 100644 index 1524b41..0000000 --- a/docs/whats_new.rst +++ /dev/null @@ -1,15 +0,0 @@ -What's New -~~~~~~~~~~ - -These are new features and improvements of note in each release - -.. contents:: `Releases` - :depth: 1 - :local: - :backlinks: top - -.. include:: whatsnew/v00011.txt -.. include:: whatsnew/v00010.txt -.. include:: whatsnew/v0009.txt -.. include:: whatsnew/v0008.txt -.. include:: whatsnew/v0007.txt diff --git a/docs/whatsnew/v0-1-0.rst b/docs/whatsnew/v0-1-0.rst new file mode 100644 index 0000000..9287d97 --- /dev/null +++ b/docs/whatsnew/v0-1-0.rst @@ -0,0 +1,35 @@ +v0.1.0 () ++++++++++ + +New features +############ + + + + +Documentation +############# + + + + +Testing +####### + + + +Bug fixes +######### + + + + +Other changes +############# + + + +Contributors +############ + + diff --git a/docs/whatsnew/v00010.txt b/docs/whatsnew/v00010.rst similarity index 100% rename from docs/whatsnew/v00010.txt rename to docs/whatsnew/v00010.rst diff --git a/docs/whatsnew/v00011.txt b/docs/whatsnew/v00011.rst similarity index 100% rename from docs/whatsnew/v00011.txt rename to docs/whatsnew/v00011.rst diff --git a/docs/whatsnew/v00012.txt b/docs/whatsnew/v00012.rst similarity index 100% rename from docs/whatsnew/v00012.txt rename to docs/whatsnew/v00012.rst diff --git a/docs/whatsnew/v0007.txt b/docs/whatsnew/v0007.rst similarity index 100% rename from docs/whatsnew/v0007.txt rename to docs/whatsnew/v0007.rst diff --git a/docs/whatsnew/v0008.txt b/docs/whatsnew/v0008.rst similarity index 100% rename from docs/whatsnew/v0008.txt rename to docs/whatsnew/v0008.rst diff --git a/docs/whatsnew/v0009.txt b/docs/whatsnew/v0009.rst similarity index 100% rename from docs/whatsnew/v0009.txt rename to docs/whatsnew/v0009.rst diff --git a/setup.py b/setup.py index 1f5c532..4f3ead3 100755 --- a/setup.py +++ b/setup.py @@ -91,7 +91,7 @@ def read(*names, **kwargs): "pandas >= 1.0", "xarray >= 0.12.0", "descartes", - "SQLAlchemy < 1.4.0, >=1.3.0" + "SQLAlchemy < 1.4.0, >=1.3.0", ], extras_require={ "dev": [ @@ -100,11 +100,9 @@ def read(*names, **kwargs): "punch.py", "pytest", "sphinx_rtd_theme", - "open_FRED-cli" - ], - "data-sources": [ "open_FRED-cli", ], + "data-sources": ["open_FRED-cli"], "examples": ["jupyter", "matplotlib", "descartes"], }, ) diff --git a/src/feedinlib/models/base.py b/src/feedinlib/models/base.py index 1b2486e..d7228df 100644 --- a/src/feedinlib/models/base.py +++ b/src/feedinlib/models/base.py @@ -135,7 +135,7 @@ def feedin(self, weather, power_plant_parameters, **kwargs): Returns ------- - feedin : :pandas:`pandas.Series` + feedin : :pandas:`pandas.Series` Series with power plant feed-in for specified time span in Watt. If respective model does calculate AC and DC feed-in, AC feed-in should be returned by default. `mode` parameter can be used to @@ -222,7 +222,7 @@ def get_power_plant_data(dataset, **kwargs): information. * windpowerlib wind turbine dataset: 'oedb_turbine_library' - See :windpowerlib:`get_turbine_types ` for further information. **kwargs diff --git a/src/feedinlib/models/pvlib.py b/src/feedinlib/models/pvlib.py index 667e579..00a6c7f 100644 --- a/src/feedinlib/models/pvlib.py +++ b/src/feedinlib/models/pvlib.py @@ -82,21 +82,21 @@ def power_plant_requires(self): azimuth (float) Azimuth angle of the module surface (South=180). - See also :pvlib:`PVSystem.surface_azimuth ` in pvlib documentation. + See also surface_azimuth in :pvlib:`pvlib.pvsystem.PVSystem` in + pvlib documentation. tilt (float) Surface tilt angle in decimal degrees. The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90). - See also :pvlib:`PVSystem.surface_tilt ` in pvlib documentation. + See also surface_tilt in :pvlib:`pvlib.pvsystem.PVSystem` + in pvlib documentation. albedo (float) - The ground albedo. See also :pvlib:`PVSystem.albedo ` in pvlib documentation. + The ground albedo. See also albedo in + :pvlib:`pvlib.pvsystem.PVSystem` in pvlib documentation. surface_type (str) The ground surface type. See `SURFACE_ALBEDOS` in - `pvlib.irradiance `_ module for valid values. + `pvlib.irradiance `_ module for valid values. References ---------- @@ -266,7 +266,7 @@ def feedin(self, weather, power_plant_parameters, **kwargs): Parameters ---------- - weather : :pandas:`pandas.DataFrame` + weather : :pandas:`pandas.DataFrame` Weather time series used to calculate feed-in. See `weather` parameter in pvlib's Modelchain :pvlib:`run_model ` method for more information on @@ -295,7 +295,7 @@ def feedin(self, weather, power_plant_parameters, **kwargs): Returns ------- - :pandas:`pandas.Series` + :pandas:`pandas.Series` Power plant feed-in time series in Watt. """ diff --git a/src/feedinlib/models/windpowerlib.py b/src/feedinlib/models/windpowerlib.py index d8d2b78..3e5ca09 100644 --- a/src/feedinlib/models/windpowerlib.py +++ b/src/feedinlib/models/windpowerlib.py @@ -81,14 +81,14 @@ def power_plant_requires(self): See also :wind_turbine:`WindTurbine.hub_height ` in windpowerlib documentation. - power_curve (:pandas:`pandas.DataFrame` or dict) + power_curve : :pandas:`pandas.DataFrame` or dict DataFrame/dictionary with wind speeds in m/s and corresponding power curve value in W. See also :wind_turbine:`WindTurbine.power_curve ` in windpowerlib documentation. - power_coefficient_curve (:pandas:`pandas.DataFrame` or dict) + power_coefficient_curve : :pandas:`pandas.DataFrame` or dict DataFrame/dictionary with wind speeds in m/s and corresponding power coefficient. @@ -133,9 +133,9 @@ def nominal_power_wind_power_plant(self): """ Nominal power of wind turbine in Watt. - See :wind_turbine:`WindTurbine.nominal_power ` in windpowerlib for further - information. + See :wind_turbine:`WindTurbine.nominal_power + ` in windpowerlib + for further information. """ if self.power_plant: @@ -175,7 +175,7 @@ def _power_plant_requires_check(self, parameters): def instantiate_turbine(self, **kwargs): """ - Instantiates a :windpowerlib:`windpowerlib.WindTurbine \ + Instantiates a :windpowerlib:`windpowerlib.WindTurbine ` object. Parameters @@ -203,7 +203,7 @@ def feedin(self, weather, power_plant_parameters, **kwargs): Parameters ---------- - weather : :pandas:`pandas.DataFrame` + weather : :pandas:`pandas.DataFrame` Weather time series used to calculate feed-in. See `weather_df` parameter in windpowerlib's Modelchain :windpowerlib:`run_model \ ` method for @@ -223,7 +223,7 @@ def feedin(self, weather, power_plant_parameters, **kwargs): Returns ------- - :pandas:`pandas.Series` + :pandas:`pandas.Series` Power plant feed-in time series in Watt. """ @@ -293,7 +293,7 @@ def power_plant_requires(self): ` please provide a list of `wind_farms`. See below for further information. - wind_turbine_fleet (:pandas:`pandas.DataFrame`) + wind_turbine_fleet : :pandas:`pandas.DataFrame` The wind turbine fleet specifies the turbine types and their corresponding number or total installed capacity in the wind farm. DataFrame must have columns 'wind_turbine' and either @@ -316,7 +316,7 @@ def power_plant_requires(self): The wind turbine fleet may also be provided as a list of :windpowerlib:`windpowerlib.WindTurbineGroup ` as described there. - wind_farms (list(dict) or list(:windpowerlib:`windpowerlib.WindFarm `)) + wind_farms : list(dict) or list(:windpowerlib:`windpowerlib.WindFarm `) List of wind farms in cluster. Wind farms in the list can either be provided as :windpowerlib:`windpowerlib.WindFarm \ ` or as dictionaries @@ -527,7 +527,7 @@ def feedin(self, weather, power_plant_parameters, **kwargs): Parameters ---------- - weather : :pandas:`pandas.DataFrame` + weather : :pandas:`pandas.DataFrame` Weather time series used to calculate feed-in. See `weather_df` parameter in windpowerlib's TurbineClusterModelChain :windpowerlib:`run_model ` + :pandas:`pandas.Series` Power plant feed-in time series in Watt. """ # noqa: E501 diff --git a/src/feedinlib/powerplants.py b/src/feedinlib/powerplants.py index 8db4302..05c7dbc 100755 --- a/src/feedinlib/powerplants.py +++ b/src/feedinlib/powerplants.py @@ -116,7 +116,7 @@ def feedin(self, weather, **kwargs): Returns ------- - feedin : :pandas:`pandas.Series` + feedin : :pandas:`pandas.Series` Series with power plant feed-in in Watt. """ @@ -257,7 +257,7 @@ def feedin(self, weather, scaling=None, **kwargs): Returns ------- - :pandas:`pandas.Series` + :pandas:`pandas.Series` Series with PV system feed-in in Watt. """ @@ -361,7 +361,7 @@ def feedin(self, weather, scaling=None, **kwargs): Returns ------- - :pandas:`pandas.Series` + :pandas:`pandas.Series` Series with wind power plant feed-in in Watt. """