Skip to content

Commit

Permalink
Merge branch 'master' into ltes_storage_units
Browse files Browse the repository at this point in the history
  • Loading branch information
amos-schledorn authored Jan 15, 2025
2 parents 82b4178 + 62afc9e commit d0d541e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 31 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ install: _conda_check
$(CONDA_OR_MAMBA) run -n $(or $(name), pypsa-eur) pre-commit install
# Install pinned environment
install-pinned-linux: _conda_check
$(CONDA_OR_MAMBA) env create -f envs/pinned-linux.yaml -n $(or $(name), pypsa-eur)
$(CONDA_OR_MAMBA) env create -f envs/linux-pinned.yaml -n $(or $(name), pypsa-eur)
$(CONDA_OR_MAMBA) run -n $(or $(name), pypsa-eur) pre-commit install
install-pinned-windows: _conda_check
$(CONDA_OR_MAMBA) env create -f envs/pinned-windows.yaml -n $(or $(name), pypsa-eur)
$(CONDA_OR_MAMBA) env create -f envs/windows-pinned.yaml -n $(or $(name), pypsa-eur)
$(CONDA_OR_MAMBA) run -n $(or $(name), pypsa-eur) pre-commit install
install-pinned-macos: _conda_check
$(CONDA_OR_MAMBA) env create -f envs/pinned-macos.yaml -n $(or $(name), pypsa-eur)
$(CONDA_OR_MAMBA) env create -f envs/macos-pinned.yaml -n $(or $(name), pypsa-eur)
$(CONDA_OR_MAMBA) run -n $(or $(name), pypsa-eur) pre-commit install


Expand Down
1 change: 0 additions & 1 deletion matplotlibrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
#
# SPDX-License-Identifier: CC0-1.0
font.family: sans-serif
font.sans-serif: Ubuntu, DejaVu Sans
image.cmap: viridis
figure.autolayout : True
42 changes: 15 additions & 27 deletions rules/retrieve.smk
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,11 @@ if config["enable"]["retrieve"]:
if config["enable"]["retrieve"] and (
config["electricity"]["base_network"] == "osm-prebuilt"
):
# Dictionary of prebuilt versions, e.g. 0.3 : "13358976"
osm_prebuilt_version = {
OSM_VERSION = config["electricity"]["osm-prebuilt-version"]
OSM_COMPONENTS = ["buses", "converters", "lines", "links", "transformers"]
if OSM_VERSION >= 0.6:
OSM_COMPONENTS.append("map")
OSM_ZENODO_IDS = {
0.1: "12799202",
0.2: "13342577",
0.3: "13358976",
Expand All @@ -552,37 +555,22 @@ if config["enable"]["retrieve"] and (
# update rule to use the correct version
rule retrieve_osm_prebuilt:
input:
buses=storage(
f"https://zenodo.org/records/{osm_prebuilt_version[config['electricity']['osm-prebuilt-version']]}/files/buses.csv"
),
converters=storage(
f"https://zenodo.org/records/{osm_prebuilt_version[config['electricity']['osm-prebuilt-version']]}/files/converters.csv"
),
lines=storage(
f"https://zenodo.org/records/{osm_prebuilt_version[config['electricity']['osm-prebuilt-version']]}/files/lines.csv"
),
links=storage(
f"https://zenodo.org/records/{osm_prebuilt_version[config['electricity']['osm-prebuilt-version']]}/files/links.csv"
),
transformers=storage(
f"https://zenodo.org/records/{osm_prebuilt_version[config['electricity']['osm-prebuilt-version']]}/files/transformers.csv"
),
map=storage(
f"https://zenodo.org/records/{osm_prebuilt_version[config['electricity']['osm-prebuilt-version']]}/files/map.html"
),
[
storage(
f"https://zenodo.org/records/{OSM_ZENODO_IDS[OSM_VERSION]}/files/{component}.csv"
)
for component in OSM_COMPONENTS
],
output:
buses=f"data/osm-prebuilt/{config['electricity']['osm-prebuilt-version']}/buses.csv",
converters=f"data/osm-prebuilt/{config['electricity']['osm-prebuilt-version']}/converters.csv",
lines=f"data/osm-prebuilt/{config['electricity']['osm-prebuilt-version']}/lines.csv",
links=f"data/osm-prebuilt/{config['electricity']['osm-prebuilt-version']}/links.csv",
transformers=f"data/osm-prebuilt/{config['electricity']['osm-prebuilt-version']}/transformers.csv",
map=f"data/osm-prebuilt/{config['electricity']['osm-prebuilt-version']}/map.html",
[
f"data/osm-prebuilt/{OSM_VERSION}/{component}.csv"
for component in OSM_COMPONENTS
],
log:
"logs/retrieve_osm_prebuilt.log",
threads: 1
resources:
mem_mb=500,
retries: 2
run:
for key in input.keys():
move(input[key], output[key])
Expand Down

0 comments on commit d0d541e

Please sign in to comment.