Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
khelfen committed Nov 10, 2022
2 parents 5c2d798 + 882634b commit 9350c60
Show file tree
Hide file tree
Showing 198 changed files with 38,658 additions and 55,983 deletions.
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
extend-exclude = docs
max-line-length = 88
extend-ignore = E203
count = true
statistics = true
show-source = true
5 changes: 4 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ Please delete options that are not relevant.

# Checklist:

- [ ] New and adjusted code is formated using the `pre-commit` hooks
- [ ] New and adjusted code is formatted using the `pre-commit` hooks
- [ ] New and adjusted code includes type hinting now
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] The Read the Docs documentation is compiling correctly
- [ ] If new packages are needed, I added them the [setup.py](https://github.com/openego/eDisGo/blob/dev/setup.py), and if needed the [rtd_requirements.txt](https://github.com/openego/eDisGo/blob/dev/rtd_requirements.txt), the [eDisGo_env.yml](https://github.com/openego/eDisGo/blob/dev/eDisGo_env.yml) and the [eDisGo_env_dev.yml](https://github.com/openego/eDisGo/blob/dev/eDisGo_env_dev.yml).
- [ ] I have added new features to the corresponding [whatsnew](https://github.com/openego/eDisGo/tree/dev/doc/whatsnew) file
84 changes: 60 additions & 24 deletions .github/workflows/tests-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,69 @@
# Tests with pytest the package and monitors the covarage and sends it to coveralls.io
# Coverage is only send to coveralls.io when no pytest tests fail
name: "Tests & coverage"
name: "Tests & Coverage"

on: [push]


# Cancel jobs on new push
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
name: "${{ matrix.name-suffix }} at py${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
python-version: [ '3.7', '3.8', '3.9' ]
include:
- name-suffix: "coverage"
os: ubuntu-latest
python-version: 3.8
- name-suffix: "basic"
os: ubuntu-latest
python-version: 3.9
- name-suffix: "basic"
os: windows-latest
python-version: 3.8

steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip3 install -e $GITHUB_WORKSPACE[full]
pip3 install coveralls
- name: Run coverage
run: |
coverage run --source=edisgo -m pytest --runslow -vv
#continue-on-error: true
- name: Run coveralls
run: |
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install packages (Linux)
if: runner.os == 'Linux'
run: |
pip install --upgrade pip wheel setuptools
pip install -e "."
- name: Install packages (Windows)
if: runner.os == 'Windows'
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: edisgo_env
environment-file: eDisGo_env_dev.yml
python-version: ${{ matrix.python-version }}

- name: Run tests
if: ${{ !(runner.os == 'Linux' && matrix.python-version == 3.8 && matrix.name-suffix == 'coverage') }}
run: |
python -m pip install pytest pytest-notebook
python -m pytest --runslow --disable-warnings --color=yes -v
- name: Run tests, coverage and send to coveralls
if: runner.os == 'Linux' && matrix.python-version == 3.8 && matrix.name-suffix == 'coverage'
run: |
pip install pytest pytest-notebook coveralls
coverage run --source=edisgo -m pytest --runslow --disable-warnings --color=yes -v
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,13 @@
*.woff
*.css
*.pkl
*.ipynb_checkpoints

# exclude locally built docs
doc/_html

# exclude egg-info
eDisGo.egg-info/
/examples/Exemplary_PyPSA_bus_results.csv
/examples/Exemplary_PyPSA_line_results.csv

# exclude directories
/examples/edisgo2pypsa_export/*
/examples/data/
/examples/ding0_example_grid/

# exclude check scripts
/examples/compare_graphs.py
/examples/compare_pypsa_network.py

# exclude .json files in opf
/edisgo/opf/edisgo_scenario_data/*.json
Expand Down
4 changes: 4 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[settings]
profile = black
multi_line_output = 3
lines_between_types = 1
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.0
hooks:
- id: pyupgrade
#- repo: https://github.com/pycqa/pylint
# rev: pylint-2.6.0
# hooks:
# - id: pylint
- repo: https://github.com/kynan/nbstripout
rev: 0.6.0
hooks:
- id: nbstripout
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: "3.7"
version: "3.8"
install:
- requirements: rtd_requirements.txt
- requirements: rtd_requirements.txt
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
<img align="right" width="200" height="200" src="https://raw.githubusercontent.com/openego/eDisGo/dev/doc/images/edisgo_logo.png">

Overview
========
[![Coverage Status](https://coveralls.io/repos/github/openego/eDisGo/badge.svg?branch=dev)](https://coveralls.io/github/openego/eDisGo?branch=dev)
[![Tests & coverage](https://github.com/openego/eDisGo/actions/workflows/tests-coverage.yml/badge.svg)](https://github.com/openego/eDisGo/actions/workflows/tests-coverage.yml)

Overview
========
# Overview

[![Coverage Status](https://coveralls.io/repos/github/openego/eDisGo/badge.svg?branch=dev)](https://coveralls.io/github/openego/eDisGo?branch=dev)
[![Tests & coverage](https://github.com/openego/eDisGo/actions/workflows/tests-coverage.yml/badge.svg)](https://github.com/openego/eDisGo/actions/workflows/tests-coverage.yml)


# eDisGo

The python package eDisGo serves as a toolbox to evaluate flexibility measures
as an economic alternative to conventional grid expansion in
medium and low voltage grids.
See [documentation](https://edisgo.readthedocs.io/en/dev/) for further information.


LICENSE
-------
# LICENSE

Copyright (C) 2017 Reiner Lemoine Institut gGmbH

Expand All @@ -34,4 +31,3 @@ details.

You should have received a copy of the GNU General Public License along with
this program. If not, see https://www.gnu.org/licenses/.

54 changes: 39 additions & 15 deletions doc/api/edisgo.flex_opt.rst
Original file line number Diff line number Diff line change
@@ -1,42 +1,66 @@
edisgo.flex\_opt package
========================

edisgo.flex\_opt.charging\_strategies module
--------------------------------------------

.. automodule:: edisgo.flex_opt.charging_strategies
:members:
:undoc-members:
:show-inheritance:

edisgo.flex\_opt.check\_tech\_constraints module
------------------------------------------------

.. automodule:: edisgo.flex_opt.check_tech_constraints
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

edisgo.flex\_opt.costs module
-----------------------------

.. automodule:: edisgo.flex_opt.costs
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

edisgo.flex\_opt.exceptions module
----------------------------------

.. automodule:: edisgo.flex_opt.exceptions
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

edisgo.flex\_opt.heat_pump_operation module
---------------------------------------------

.. automodule:: edisgo.flex_opt.heat_pump_operation
:members:
:undoc-members:
:show-inheritance:

edisgo.flex\_opt.q\_control module
-----------------------------------

.. automodule:: edisgo.flex_opt.q_control
:members:
:undoc-members:
:show-inheritance:

edisgo.flex\_opt.reinforce\_grid module
---------------------------------------

.. automodule:: edisgo.flex_opt.reinforce_grid
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

edisgo.flex\_opt.reinforce\_measures module
-------------------------------------------

.. automodule:: edisgo.flex_opt.reinforce_measures
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
40 changes: 24 additions & 16 deletions doc/api/edisgo.io.rst
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
edisgo.io package
===================
=================

edisgo.io.ding0\_import module
-------------------------------
------------------------------

.. automodule:: edisgo.io.ding0_import
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

edisgo.io.electromobility\_import module
----------------------------------------

.. automodule:: edisgo.io.electromobility_import
:members:
:undoc-members:
:show-inheritance:

edisgo.io.generators\_import module
-----------------------------------

.. automodule:: edisgo.io.generators_import
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

edisgo.io.pypsa\_io module
------------------------------
--------------------------

.. automodule:: edisgo.io.pypsa_io
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

edisgo.io.timeseries\_import module
------------------------------------
-----------------------------------

.. automodule:: edisgo.io.timeseries_import
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 9350c60

Please sign in to comment.