diff --git a/.travis.yml b/.travis.yml index 011753f4..0fe59eb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ before_install: - conda activate pypsa-eur # install open-source solver - - mamba install -c conda-forge ipopt glpk + - mamba install -c conda-forge glpk ipopt # list packages for easier debugging - conda list diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 1cae0807..f2192490 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -25,6 +25,10 @@ Upcoming Release * Don't remove capital costs from lines and links, when imposing a line volume limit (wildcard ``lv``) or a line cost limit (``lc``). Previously, these were removed to move the expansion in direction of the limit. +* Fix bug of clustering offwind-{ac,dc} sites in the option of high-resolution sites for renewables. Now, there are more sites for offwind-{ac,dc} available than network nodes. Before, they were clustered to the resolution of the network. (e.g. elec_s1024_37m.nc: 37 network nodes, 1024 sites) + +* Use `mamba` (https://github.com/mamba-org/mamba) for faster Travis CI builds (`#196 `_) + PyPSA-Eur 0.2.0 (8th June 2020) ================================== diff --git a/envs/environment.yaml b/envs/environment.yaml index fb4019a3..f970e894 100644 --- a/envs/environment.yaml +++ b/envs/environment.yaml @@ -12,6 +12,7 @@ dependencies: - python - pip - pre-commit + - mamba # esp for windows build - pypsa>=0.17.1 - atlite=0.0.3 @@ -21,7 +22,7 @@ dependencies: - scikit-learn - pycountry - seaborn - - snakemake-minimal + - snakemake-minimal<=5.24.2 # until https://github.com/snakemake/snakemake/issues/635 closed - memory_profiler - yaml - pytables @@ -48,7 +49,7 @@ dependencies: - geopandas - rasterio - shapely - - libgdal + - libgdal<=3.0.2 # Solvers - gurobi:gurobi # until https://github.com/conda-forge/pypsa-feedstock/issues/4 closed diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index fc054a10..4ecd2e05 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -251,8 +251,8 @@ def busmap_for_n_clusters(n, n_clusters, solver_name, focus_weights=None, algori else: raise ValueError(f"`algorithm` must be one of 'kmeans', 'spectral' or 'louvain'. Is {algorithm}.") - return (n.buses.groupby(['country', 'sub_network'], group_keys=False, squeeze=True) - .apply(busmap_for_country).rename('busmap')) + return (n.buses.groupby(['country', 'sub_network'], group_keys=False) + .apply(busmap_for_country).squeeze().rename('busmap')) def clustering_for_n_clusters(n, n_clusters, aggregate_carriers=None, @@ -333,7 +333,7 @@ if __name__ == "__main__": renewable_carriers = pd.Index([tech for tech in n.generators.carrier.unique() - if tech.split('-', 2)[0] in snakemake.config['renewable']]) + if tech in snakemake.config['renewable']]) if snakemake.wildcards.clusters.endswith('m'): n_clusters = int(snakemake.wildcards.clusters[:-1]) diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index f790db8f..ac81955d 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -185,7 +185,8 @@ if __name__ == "__main__": for o in opts: oo = o.split("+") - if oo[0].startswith(tuple(n.carriers.index)): + suptechs = map(lambda c: c.split("-", 2)[0], n.carriers.index) + if oo[0].startswith(tuple(suptechs)): carrier = oo[0] cost_factor = float(oo[1]) if carrier == "AC": # lines do not have carrier