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
- [ ] 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

View File

@ -7,7 +7,7 @@ Closes # (if applicable).
- [ ] I tested my contribution locally and it seems to work fine.
- [ ] 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 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.

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
conda:
environment: environment.docs.yaml
environment: envs/environment.docs.yaml

View File

@ -15,11 +15,12 @@ before_install:
- source conda4travis.sh
# 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
# install open-source solver
- conda install -c conda-forge ipopt glpk
- mamba install -c conda-forge ipopt glpk
script:
- cp ./test/config.test1.yaml ./config.yaml

View File

@ -210,7 +210,7 @@ rule add_electricity:
geth_hydro_capacities='data/geth2015_hydro_capacities.csv',
opsd_load='data/bundle/time_series_60min_singleindex_filtered.csv',
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']}
output: "networks/elec.nc"
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.
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
.. 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
@ -62,7 +62,7 @@ The environment can be installed and activated using
.. code:: bash
mamba env create -f environment.yaml
mamba env create -f envs/environment.yaml
Install a Solver
================

View File

@ -56,4 +56,3 @@ improving the approximations.
Belarus, Ukraine, Turkey and Morocco have not been taken into account;
islands which are not connected to the main European system, such as Malta,
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``.
* Update ``environment.fixedversions.yaml`` via
``conda env export -n pypsa-eur -f environment.fixedversions.yaml --no-builds``
* Update ``envs/environment.fixed.yaml`` via
``conda env export -n pypsa-eur -f envs/environment.fixed.yaml --no-builds``
from an up-to-date `pypsa-eur` environment.
* Update version number in ``doc/conf.py`` and ``*config.*.yaml``.

View File

@ -5,19 +5,15 @@
name: pypsa-eur-docs
channels:
- conda-forge
#- bioconda
dependencies:
#- python
- pip
- pypsa>=0.17.1
- atlite=0.0.3
# Dependencies of the workflow itself
#- xlrd
- scikit-learn
- pycountry
- seaborn
#- snakemake-minimal
- memory_profiler
- yaml
- pytables
@ -25,28 +21,19 @@ dependencies:
# Second order dependencies which should really be deps of atlite
- xarray
#- netcdf4
#- bottleneck
#- toolz
#- dask
- progressbar2
- 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
- conda-forge::cartopy
- conda-forge::fiona
- conda-forge::proj
- conda-forge::pyshp
- conda-forge::geopandas
- conda-forge::rasterio
- conda-forge::shapely
- conda-forge::libgdal
- cartopy
- fiona
- proj
- pyshp
- geopandas
- rasterio
- shapely
- libgdal
# The FRESNA/KIT stuff is not packaged for conda yet
- pip:
- vresutils==0.3.1
- git+https://github.com/PyPSA/glaes.git#egg=glaes

View File

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