execute pre-commit

This commit is contained in:
Fabian Neumann 2020-09-11 15:26:43 +02:00
parent f6dd2e12f3
commit cbd22c2efd
54 changed files with 135 additions and 141 deletions

View File

@ -11,7 +11,7 @@ assignees: ''
## Checklist ## Checklist
- [ ] I am using the current [`master`](https://github.com/PyPSA/pypsa-eur/tree/master) branch or the latest [release](https://github.com/PyPSA/pypsa-eur/releases). Please indicate. - [ ] I am using the current [`master`](https://github.com/PyPSA/pypsa-eur/tree/master) branch or the latest [release](https://github.com/PyPSA/pypsa-eur/releases). Please indicate.
- [ ] I am running on an up-to-date [`pypsa-eur` environment](https://github.com/PyPSA/pypsa-eur/blob/master/environment.yaml). Update via `conda env update -f environment.yaml`. - [ ] I am running on an up-to-date [`pypsa-eur` environment](https://github.com/PyPSA/pypsa-eur/blob/master/envs/environment.yaml). Update via `conda env update -f envs/environment.yaml`.
## Describe the Bug ## Describe the Bug

View File

@ -7,7 +7,7 @@ Closes # (if applicable).
- [ ] I tested my contribution locally and it seems to work fine. - [ ] I tested my contribution locally and it seems to work fine.
- [ ] Code and workflow changes are sufficiently documented. - [ ] Code and workflow changes are sufficiently documented.
- [ ] Newly introduced dependencies are added to `environment.yaml` and `environment.docs.yaml`. - [ ] Newly introduced dependencies are added to `envs/environment.yaml` and `envs/environment.docs.yaml`.
- [ ] Changes in configuration options are added in all of `config.default.yaml`, `config.tutorial.yaml`, and `test/config.test1.yaml`. - [ ] Changes in configuration options are added in all of `config.default.yaml`, `config.tutorial.yaml`, and `test/config.test1.yaml`.
- [ ] Changes in configuration options are also documented in `doc/configtables/*.csv` and line references are adjusted in `doc/configuration.rst` and `doc/tutorial.rst`. - [ ] Changes in configuration options are also documented in `doc/configtables/*.csv` and line references are adjusted in `doc/configuration.rst` and `doc/tutorial.rst`.
- [ ] A note for the release notes `doc/release_notes.rst` is amended in the format of previous release notes. - [ ] A note for the release notes `doc/release_notes.rst` is amended in the format of previous release notes.

8
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,8 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

View File

@ -5,4 +5,4 @@
version: 2 version: 2
conda: conda:
environment: environment.docs.yaml environment: envs/environment.docs.yaml

View File

@ -15,11 +15,12 @@ before_install:
- source conda4travis.sh - source conda4travis.sh
# install conda environment # install conda environment
- conda env create -f ./environment.yaml - conda install -c conda-forge mamba
- mamba env create -f ./envs/environment.yaml
- conda activate pypsa-eur - conda activate pypsa-eur
# install open-source solver # install open-source solver
- conda install -c conda-forge ipopt glpk - mamba install -c conda-forge ipopt glpk
script: script:
- cp ./test/config.test1.yaml ./config.yaml - cp ./test/config.test1.yaml ./config.yaml

View File

@ -210,7 +210,7 @@ rule add_electricity:
geth_hydro_capacities='data/geth2015_hydro_capacities.csv', geth_hydro_capacities='data/geth2015_hydro_capacities.csv',
opsd_load='data/bundle/time_series_60min_singleindex_filtered.csv', opsd_load='data/bundle/time_series_60min_singleindex_filtered.csv',
nuts3_shapes='resources/nuts3_shapes.geojson', nuts3_shapes='resources/nuts3_shapes.geojson',
**{'profile_' + tech: "resources/profile_" + tech + ".nc" **{f"profile_{tech}": f"resources/profile_{tech}.nc"
for tech in config['renewable']} for tech in config['renewable']}
output: "networks/elec.nc" output: "networks/elec.nc"
log: "logs/add_electricity.log" log: "logs/add_electricity.log"

View File

@ -37,12 +37,12 @@ We recommend using the package manager and environment management system ``conda
Install `miniconda <https://docs.conda.io/en/latest/miniconda.html>`_, which is a mini version of `Anaconda <https://www.anaconda.com/>`_ that includes only ``conda`` and its dependencies or make sure ``conda`` is already installed on your system. Install `miniconda <https://docs.conda.io/en/latest/miniconda.html>`_, which is a mini version of `Anaconda <https://www.anaconda.com/>`_ that includes only ``conda`` and its dependencies or make sure ``conda`` is already installed on your system.
For instructions for your operating system follow the ``conda`` `installation guide <https://docs.conda.io/projects/conda/en/latest/user-guide/install/>`_. For instructions for your operating system follow the ``conda`` `installation guide <https://docs.conda.io/projects/conda/en/latest/user-guide/install/>`_.
The python package requirements are curated in the `environment.yaml <https://github.com/PyPSA/pypsa-eur/blob/master/environment.yaml>`_ file. The python package requirements are curated in the `envs/environment.yaml <https://github.com/PyPSA/pypsa-eur/blob/master/envs/environment.yaml>`_ file.
The environment can be installed and activated using The environment can be installed and activated using
.. code:: bash .. code:: bash
.../pypsa-eur % conda env create -f environment.yaml .../pypsa-eur % conda env create -f envs/environment.yaml
.../pypsa-eur % conda activate pypsa-eur .../pypsa-eur % conda activate pypsa-eur
@ -62,7 +62,7 @@ The environment can be installed and activated using
.. code:: bash .. code:: bash
mamba env create -f environment.yaml mamba env create -f envs/environment.yaml
Install a Solver Install a Solver
================ ================

View File

@ -56,4 +56,3 @@ improving the approximations.
Belarus, Ukraine, Turkey and Morocco have not been taken into account; Belarus, Ukraine, Turkey and Morocco have not been taken into account;
islands which are not connected to the main European system, such as Malta, islands which are not connected to the main European system, such as Malta,
Crete and Cyprus, are also excluded from the model. Crete and Cyprus, are also excluded from the model.

View File

@ -97,8 +97,8 @@ Release Process
* Finalise release notes at ``doc/release_notes.rst``. * Finalise release notes at ``doc/release_notes.rst``.
* Update ``environment.fixedversions.yaml`` via * Update ``envs/environment.fixed.yaml`` via
``conda env export -n pypsa-eur -f environment.fixedversions.yaml --no-builds`` ``conda env export -n pypsa-eur -f envs/environment.fixed.yaml --no-builds``
from an up-to-date `pypsa-eur` environment. from an up-to-date `pypsa-eur` environment.
* Update version number in ``doc/conf.py`` and ``*config.*.yaml``. * Update version number in ``doc/conf.py`` and ``*config.*.yaml``.

View File

@ -5,19 +5,15 @@
name: pypsa-eur-docs name: pypsa-eur-docs
channels: channels:
- conda-forge - conda-forge
#- bioconda
dependencies: dependencies:
#- python
- pip - pip
- pypsa>=0.17.1 - pypsa>=0.17.1
- atlite=0.0.3 - atlite=0.0.3
# Dependencies of the workflow itself # Dependencies of the workflow itself
#- xlrd
- scikit-learn - scikit-learn
- pycountry - pycountry
- seaborn - seaborn
#- snakemake-minimal
- memory_profiler - memory_profiler
- yaml - yaml
- pytables - pytables
@ -25,28 +21,19 @@ dependencies:
# Second order dependencies which should really be deps of atlite # Second order dependencies which should really be deps of atlite
- xarray - xarray
#- netcdf4
#- bottleneck
#- toolz
#- dask
- progressbar2 - progressbar2
- pyyaml>=5.1.0 - pyyaml>=5.1.0
# Include ipython so that one does not inadvertently drop out of the conda
# environment by calling ipython
# - ipython
# GIS dependencies have to come all from conda-forge # GIS dependencies have to come all from conda-forge
- conda-forge::cartopy - cartopy
- conda-forge::fiona - fiona
- conda-forge::proj - proj
- conda-forge::pyshp - pyshp
- conda-forge::geopandas - geopandas
- conda-forge::rasterio - rasterio
- conda-forge::shapely - shapely
- conda-forge::libgdal - libgdal
# The FRESNA/KIT stuff is not packaged for conda yet
- pip: - pip:
- vresutils==0.3.1 - vresutils==0.3.1
- git+https://github.com/PyPSA/glaes.git#egg=glaes - git+https://github.com/PyPSA/glaes.git#egg=glaes

View File

@ -186,4 +186,3 @@ solving:
# solutiontype: 2 # non basic solution, ie no crossover # solutiontype: 2 # non basic solution, ie no crossover
# barrier_convergetol: 1.e-5 # barrier_convergetol: 1.e-5
# feasopt_tolerance: 1.e-6 # feasopt_tolerance: 1.e-6