Skip to content

Commit

Permalink
Merge branch 'dev' into features/#276-improve-simple-example
Browse files Browse the repository at this point in the history
  • Loading branch information
maike93he committed Sep 27, 2022
2 parents 82e7dbc + c0a1cab commit 6498bd7
Show file tree
Hide file tree
Showing 92 changed files with 16,439 additions and 75,938 deletions.
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ Please delete options that are not relevant.
- [ ] 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
- [ ] I have added new features to the [doc/whatsnew.rst](https://github.com/openego/eDisGo/blob/dev/doc/whatsnew.rst)
91 changes: 68 additions & 23 deletions .github/workflows/tests-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,78 @@
# 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: "eDisGo-${{ matrix.name-suffix }} at Python ${{ 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: "basic"
os: ubuntu-latest
python-version: 3.8
- name-suffix: "dev"
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 --upgrade pip
pip3 install -e $GITHUB_WORKSPACE[full]
pip3 install coveralls
- name: Run coverage
run: |
coverage run --source=edisgo -m pytest --runslow -vv
- 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 - Basic)
if: runner.os == 'Linux' && matrix.name-suffix == 'basic'
run: |
pip install --upgrade pip wheel setuptools
pip install -e "."
- name: Install packages (Linux - Dev)
if: runner.os == 'Linux' && matrix.name-suffix == 'dev'
run: |
pip install --upgrade pip wheel setuptools
pip install -e ".[dev]"
- 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 == 'dev') }}
run: |
python -m pip install pytest pytest-notebook
python -m pytest --runslow -vv
- name: Run tests, coverage and send to coveralls
if: runner.os == 'Linux' && matrix.python-version == 3.8 && matrix.name-suffix == 'dev'
run: |
pip install coveralls
coverage run --source=edisgo -m pytest --runslow -vv
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
11 changes: 0 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ 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
12 changes: 8 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
Expand All @@ -19,10 +19,14 @@ repos:
- id: isort
name: isort (python)
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
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
18 changes: 2 additions & 16 deletions doc/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Getting started
Installation using Linux
-------------------------

.. warning:: Make sure to use python 3.7 or higher!
.. warning:: Make sure to use python 3.8 or higher!

Install latest eDisGo version through pip. Therefore, we highly recommend using
a virtual environment and its pip.
Expand All @@ -15,25 +15,13 @@ a virtual environment and its pip.
python -m pip install edisgo
The above will install all packages for the basic usage of eDisGo. To install
additional packages e.g. needed to create plots with background maps or to run
the jupyter notebook examples, we provide installation with extra packages:

.. code-block:: bash
python -m pip install edisgo[geoplot] # for plotting with background maps
python -m pip install edisgo[examples] # to run examples
python -m pip install edisgo[dev] # developer packages
python -m pip install edisgo[full] # combines all of the extras above
You may also consider installing a developer version as detailed in
:ref:`dev-notes`.

Installation using Windows
--------------------------

.. warning:: Make sure to use python 3.7 or higher!
.. warning:: Make sure to use python 3.8 or higher!

For Windows users we recommend using Anaconda and to install the geo stack
using the conda-forge channel prior to installing eDisGo. You may use the provided
Expand All @@ -50,8 +38,6 @@ Activate the newly created environment with:
conda activate eDisGo_env
This will install eDisGo with all it's dependencies ([full] flag).

Installation using MacOS
--------------------------

Expand Down
2 changes: 2 additions & 0 deletions doc/whatsnew/v0-2-0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Changes
* added pre-commit hooks (flake8, black, isort, pyupgrade) `#229 <https://github.com/openego/eDisGo/pull/229>`_
* added issue and pull request templates `#220 <https://github.com/openego/eDisGo/issues/220>`_
* added Windows installation yml and documentation
* added automatic testing for Windows `#317 <https://github.com/openego/eDisGo/pull/317>`_
* dropped support for python 3.7
* added functionality to set up different loggers with individual logging levels and where to write output `#295 <https://github.com/openego/eDisGo/issues/295>`_
* added integrity checks of eDisGo object `#231 <https://github.com/openego/eDisGo/issues/231>`_
* added functionality to save to and load from zip archive `#216 <https://github.com/openego/eDisGo/pull/216>`_
Expand Down
4 changes: 2 additions & 2 deletions eDisGo_env.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: eDisGo_env
name: eDisGo_env_dev
channels:
- conda-forge
- defaults
Expand All @@ -17,4 +17,4 @@ dependencies:
- conda-forge::contextily
- conda-forge::descartes
- pip:
- eDisGo[full]
- eDisGo
2 changes: 1 addition & 1 deletion eDisGo_env_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ dependencies:
- conda-forge::contextily
- conda-forge::descartes
- pip:
- -e .[full]
- -e .[dev]
Loading

0 comments on commit 6498bd7

Please sign in to comment.