Skip to content

Commit

Permalink
Merge pull request #294 from greco-project/release/v0.0.3
Browse files Browse the repository at this point in the history
Release/v0.0.3
  • Loading branch information
SabineHaas authored Apr 22, 2021
2 parents 8fc1987 + 6ecf34a commit cdcbea1
Show file tree
Hide file tree
Showing 36 changed files with 813 additions and 234 deletions.
11 changes: 9 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[run]
omit = tests/*
source = pvcompare
source =
pvcompare
omit =
pvcompare/cpv/inputs.py
pvcompare/perosi/data/*

[report]
show_missing = true
precision = 2
16 changes: 14 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Set env for dev branch
if: endsWith(github.ref, '/develop')
Expand Down Expand Up @@ -67,4 +68,15 @@ jobs:
- name: Test with pytest
run: |
coverage run --rcfile=.coveragerc --source pvcompare -m py.test
coverage run -m pytest tests/
- name: Check test coverage
run: |
coverage report -m
- name: Report to coveralls
run: |
coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
25 changes: 25 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF
#formats:
# - pdf
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- docs
- method: setuptools
path: .
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,38 @@ Here is a template for new release sections
-
```

## [0.0.3] - 2021-04-22

### Added
- Add config file for RTD `readthedocs.yml` (#276)
- Tests have been added which check if the examples of pvcompare run with exit code 0 (#284)
- Added basic model assumptions to RTD and introduced section "local energy system" in Model assumptions in RTD (#286)
- Added headings in `parameters.rst` to make references of these sections possible in RTD (#286)
- Improved "scope and limitations" section of RTD with additional information and corrections (#286)
- Add info on energy systems consisting of more than one node in RTD section "scope and limitations" (#293)
- Added description of the implementation of the stratified thermal storage in pvcompare with a description of the possibilities modeling it (#291)

### Changed
- The inlet temperatures of the heat pump and the stratified thermal storage have been revised in the pvcompare input parameters, adapting them in order to fit typical temperatures of the heating system. Also the pvcompare input parameters of the stratified thermal storage have been revised (#272)
- Improved "how to release" section in `contributing.md` with insights from last release (#275)
- Tests have been added which check if the examples of pvcompare run with exit code 0 (#284)
- Move docs requirements from `docs/docs_requirements.txt ` to `setup.py` - now installed e.g. by `pip install -e .[dev, docs]` (#276)
- Move coverage badge of `coveralls.io` from deprecated to valid section in `README.rst` (#289)
- Update code documentation in RTD: add missing functions and modules and delete outdated ones (#287)
- Update RTD's section `Electricity and heat demand modeling` and `Heat pump and thermal storage modelling` in `model_assumptions.rst` (#291)

### Removed
-

### Fixed
- fix PV costs parameters and PSI lifetime (#273)
- fix number of houses to 20 (8 flats per storey makes 40 flats per house with 5 storeys, makes 800 in total (and 480 for 3 storeys)) (#273)
- Test coverage is now automatically checked with github actions and [coveralls](https://coveralls.io/github/greco-project/pvcompare) (#283)

# Hot fixes
- Hot fix: install MVS with option `[report]` to install missing packages (#270)
- Hot fix: remove build for python 3.6 from `main.yml` github actions workflow (#270)
- Hot fix: correct parameter `overwrite_grid_parameters` in `run_pvcompare.py` (#294)

## [0.0.2] - 2021-03-24

Expand Down
19 changes: 12 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,28 @@ An introduction to creating the readthedocs with Sphinx is given here: https://d

## How to release

Currently *pvcompare* is not released on pypi, but only on github. Please follow the instructions do create a new release on github. Check [GitHub Docs](https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository) for more information on releases.
Currently *pvcompare* is not released on pypi, but only on github. Please follow the instructions to create a new release on github. Check [GitHub Docs](https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository) for more information on releases.

### Preparations
1. Create a release branch by branching off from `dev` branch
1. Create a release branch by branching off from `dev` branch by
```bash
git checkout -b release/vX.Y.Z dev
```
Please use [semantic versioning guidelines](https://semver.org/spec/v2.0.0.html) for `X`, `Y` and `Z`.
2. In the release branch update the version number in [`__init__.py`](https://github.com/greco-project/pvcompare/blob/dev/pvcompare/__init__.py) and [`setup.py`](https://github.com/greco-project/pvcompare/blob/dev/setup.py).
3. Adapt the header `[Unreleased]` of [Changelog.md](https://github.com/greco-project/pvcompare/blob/dev/CHANGELOG.md) with the version number and the date of the release in [ISO format](https://xkcd.com/1179/): `[Version] - YYYY-MM-DD`.
4. Run all tests locally by `EXECUTE_TESTS_ON=master pytest`.
5. If there are errors, fix them in the release branch.
6. When `EXECUTE_TESTS_ON=master pytest` passes, push your release branch, create a pull request towards `master` and merge.
4. Install pvcompare in a clean virtual environment on `release/vX.Y.Z` branch (navigate to directory where `setup.py` is located:
```bash
pip install -e .[dev]
```
6. Run all tests locally by `EXECUTE_TESTS_ON=master pytest`.
7. If there are errors, fix them in the release branch. If you fix something in the `setup.py` please test the installation in clean virtual environment again (see step 4).
8. When `EXECUTE_TESTS_ON=master pytest` passes, push your release branch, create a pull request towards `master` and merge.
9. Wait until the [build](https://github.com/greco-project/pvcompare/actions) on `master` branch passes.

### The actual release
1. Draft a new release on [github](https://github.com/greco-project/pvcompare/releases/) and choose `master` as target.
2. As tag version use `vX.Y.Z` please.
2. As tag version use `vX.Y.Z`.
3. Type a descriptive title and copy the [Changelog entries](https://github.com/greco-project/pvcompare/blob/dev/CHANGELOG.md) as description of the release.
4. Use checkbox "this is a pre-release" to indicate that the model may be unstable.

Expand All @@ -123,7 +128,7 @@ Currently *pvcompare* is not released on pypi, but only on github. Please follow
3. Add the structure for a new `unreleased` version to the [`CHANGELOG.md`](https://github.com/greco-project/pvcompare/blob/dev/CHANGELOG.md):
```
## [unreleased]
-
### Added
-
### Changed
Expand Down
19 changes: 10 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
|badge_docs| |badge_CI|
|badge_docs| |badge_CI| |badge_coverage|

Deprecated: |badge_travis| |badge_coverage|
Deprecated: |badge_travis|

.. |badge_docs| image:: https://readthedocs.org/projects/pvcompare/badge/?version=latest
:target: https://pvcompare.readthedocs.io/en/latest/?badge=latest
Expand Down Expand Up @@ -30,15 +30,16 @@ easily be enhanced to analyse other conversion technologies.

The functionalities include

* calculation of an area potential for PV on roof-tops and facades based on building parameters,
* calculation of an area potential for PV on roof-tops and façades based on building parameters,
* calculation of heat and electricity demand profiles for a specific amount of people living in these buildings,
* calculation of PV feed-in time series for a set of PV installations on roof-tops and facades incl. different technologies,
* calculation of PV feed-in time series for a set of PV installations on roof-tops and façades incl. different technologies,

* all technologies in the database of `pvlib <https://pvlib-python.readthedocs.io/en/stable/index.html>`_,
* a specific concentrator-PV module, and
* a module of silicon-perovskite cells,
* a specific concentrator-PV module (`CPV <https://pvcompare.readthedocs.io/en/latest/model_assumptions.html#cpv>`_) and
* a module of perovskite-silicon cells (`PeroSI <https://pvcompare.readthedocs.io/en/latest/model_assumptions.html#perosi>`_),

* calculation of temperature dependent COPs or respectively EERs for heat pumps and chillers,
* download and formatting of `ERA5 weather data <https://www.ecmwf.int/en/forecasts/datasets/reanalysis-datasets/era5>`_ (global reanalysis data set),
* preparation of data and input files for the energy system optimization,
* a sensitivity analysis for input parameters and
* visualisations for the comparison of different technologies.
Expand All @@ -58,7 +59,7 @@ Installation

To install *pvcompare* follow these steps:

- Clone *pvcompare* and navigate to the directory ``\pvcompare`` containing the ``setup.py`` and ``requirements.txt``:
- Clone *pvcompare* and navigate to the directory ``\pvcompare`` containing the ``setup.py``:

::

Expand All @@ -71,7 +72,7 @@ To install *pvcompare* follow these steps:

pip install -e .

- For the optimization you need to install a solver. Your can download the open source `cbc-solver <https://projects.coin-or.org/Cbc>`_ from https://ampl.com/dl/open/cbc/ . Please follow the installation `steps <https://oemof-solph.readthedocs.io/en/latest/readme.html#installing-a-solver>`_ in the oemof installation instructions. You also find information about other solvers there.
- For the optimization you need to install a solver. You can download the open source `cbc-solver <https://projects.coin-or.org/Cbc>`_ from https://ampl.com/dl/open/cbc/ . Please follow the installation `steps <https://oemof-solph.readthedocs.io/en/latest/readme.html#installing-a-solver>`_ in the oemof installation instructions. You also find information about other solvers there.

Examples and basic usage
========================
Expand All @@ -83,4 +84,4 @@ Contributing

We are warmly welcoming all who want to contribute to *pvcompare*.
Please read our `Contributing Guidelines <https://github.com/greco-project/pvcompare/blob/dev/CONTRIBUTING.md>`_.

You can also get in contact by writing an `issue on github <https://github.com/greco-project/pvcompare/issues/new/choose>`_.
93 changes: 80 additions & 13 deletions docs/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Code documentation
Main
====

Main functions of *pvcompare* that can be used to start a full simulation.
Main functions of *pvcompare* that can be used to run a full simulation.

.. autosummary::
:toctree: temp/

main.main
main.apply_mvs
main.apply_pvcompare


.. _area_potential:
Expand Down Expand Up @@ -44,6 +44,7 @@ Functions for calculating the electrical demand profiles and heat demand profile
demand.calculate_load_profiles
demand.calculate_power_demand
demand.calculate_heat_demand
demand.adjust_heat_demand
demand.shift_working_hours
demand.get_workalendar_class

Expand All @@ -60,7 +61,9 @@ Functions for calculating the feed-in time series of different PV technologies.
pv_feedin.create_pv_components
pv_feedin.create_si_time_series
pv_feedin.create_cpv_time_series
pv_feedin.create_psi_time_series
pv_feedin.nominal_values_pv
pv_feedin.get_peak
pv_feedin.set_up_system
pv_feedin.get_optimal_pv_angle

Expand All @@ -69,19 +72,20 @@ Functions for calculating the feed-in time series of different PV technologies.
CPV time series
===============

Function for calculating the feed-in time series for the CPV technology.
Specific functions for calculating the feed-in time series of the CPV technology.

.. autosummary::
:toctree: temp/

cpv.apply_cpvlib_StaticHybridSystem.create_cpv_time_series
cpv.apply_cpvlib_StaticHybridSystem.calculate_efficiency_ref

.. _psi:

PSI time series
===============

Function for calculating the feed-in time series for the perovskite silicone technology.
Specific functions for calculating the feed-in time series of the perovskite-silicon technology.

.. autosummary::
:toctree: temp/
Expand All @@ -92,24 +96,57 @@ Function for calculating the feed-in time series for the perovskite silicone tec
perosi.pvlib_smarts.SMARTSSpectra
perosi.pvlib_smarts._smartsAll

.. _heat_pumps_chillers:

Heat pumps and chillers
-----------------------

Functions for implementing a sector-coupled system (electricity, heat) and for calculating the COPs/EERs of heat pumps and chillers.

.. autosummary::
:toctree: temp/

heat_pump_and_chiller.add_sector_coupling
heat_pump_and_chiller.calculate_cops_and_eers

.. _thermal_storage:

Stratified thermal storage
--------------------------

Functions for calculating thermal losses of a stratified thermal storage and for adding it to the energy system.

.. autosummary::
:toctree: temp/

stratified_thermal_storage.calc_strat_tes_param
stratified_thermal_storage.save_time_dependent_values
stratified_thermal_storage.add_strat_tes
stratified_thermal_storage.run_stratified_thermal_storage

.. _check_inputs:

Reading and Writing input csv's
===============================

Functions that match manual inputs and calculated results with mvs_inputs/csv_elements/
Functions that match manual inputs and calculated results with data/user_inputs/mvs_inputs/csv_elements/

.. autosummary::
:toctree: temp/

check_inputs.add_parameter_to_mvs_file
check_inputs.load_parameter_from_mvs_file
check_inputs.add_parameters_to_storage_xx_file
check_inputs.add_scenario_name_to_project_data
check_inputs.add_location_and_year_to_project_data
check_inputs.add_local_grid_parameters
check_inputs.check_for_valid_country_year
check_inputs.add_project_data
check_inputs.add_electricity_price
check_inputs.check_mvs_energy_production_file
check_inputs.overwrite_mvs_energy_production_file
check_inputs.add_parameters_to_energy_production_file
check_inputs.add_file_name_to_energy_consumption_file
check_inputs.add_evaluated_period_to_simulation_settings


.. _era5:

Loading ERA5 weather data
Expand All @@ -125,16 +162,46 @@ Functions that request the weather data of one year and one location from the ER
era5.format_pvcompare
era5.weather_df_from_era5

Output functions
================
.. _sensitivity_analysis:

Sensitivity analysis
====================

Functions sensivity analysis, i.e. running simulations in a loop while adjusting one parameter at each loop.

.. autosummary::
:toctree: temp/

outputs.loop_mvs
outputs.plot_all_flows
outputs.plot_kpi_loop
analysis.create_loop_output_structure
analysis.loop_pvcompare
analysis.single_loop_pvcompare
analysis.loop_mvs

.. _evaluation:

Evaluation
==========

Function for the post-processing of KPIs. It is recommended to post-process certain KPIs when sector-coupling electricity and heat sector with a heat pump and/or chiller.

.. autosummary::
:toctree: temp/

analysis.postprocessing_kpi

.. _visualization:

Visualization
=============

Plotting function for visualization of simulation results.

.. autosummary::
:toctree: temp/

plots.plot_all_flows
plots.plot_psi_matrix
plots.plot_kpi_loop
plots.plot_facades
plots.plot_compare_scenarios
plots.plot_compare_technologies
2 changes: 0 additions & 2 deletions docs/docs_requirements.txt

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cdcbea1

Please sign in to comment.