forked from open-energy-transition/pypsa-eur
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathpixi.toml
More file actions
253 lines (232 loc) · 8.88 KB
/
Copy pathpixi.toml
File metadata and controls
253 lines (232 loc) · 8.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# SPDX-FileCopyrightText: Contributors to Open-TYNDP <https://github.com/open-energy-transition/open-tyndp>
# SPDX-FileCopyrightText: Contributors to PyPSA-Eur <https://github.com/pypsa/pypsa-eur>
#
# SPDX-License-Identifier: MIT
[workspace]
authors = ["Contributors to Open-TYNDP"]
channels = ["conda-forge", "bioconda", "gurobi", "https://repo.prefix.dev/open-tyndp"]
name = "pypsa-eur"
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
version = "v0.7.1"
exclude-newer = "7d"
[target.win-64.activation.env]
# Local snakemake jobs often fail with status code 120, due to stdout/stderr interleaving
# on windows, running python unbuffered works around the issue. Ideally we would stop using
# stdout/stderr and use a proper logging infrastructure
PYTHONUNBUFFERED = "1"
[tasks]
reset = """bash -c '
read -p "Do you really wanna continue? This will remove all contents of \
logs, resources, benchmarks, results, and .snakemake directories except \
.gitkeep files (config/config.yaml will not be deleted) (y/n): " ans && \
case $ans in \
[Yy]*) \
for dir in ./logs ./resources ./benchmarks ./results ./.snakemake; do \
find "$dir" -mindepth 1 ! -name ".gitkeep" -delete 2>/dev/null || true; \
done; \
echo "Reset completed.";; \
[Nn]*) \
echo "Reset cancelled.";; \
*) \
echo "Please answer yes or no."; exit 1;; \
esac'
"""
update-dags = """
snakemake results/networks/base_s_128_elec_.nc -F --dag | sed -n "/digraph/,/}/p" | dot -Tsvg -o doc/img/intro-workflow.svg && \
snakemake --rulegraph -F | sed -n "/digraph/,/}/p" | dot -Tsvg -o doc/img/workflow.svg && \
snakemake --dag --configfile config/test/config.electricity.yaml | sed -n '/^digraph/,$ p' | dot -Tsvg -o doc/img/dag_electricity.svg && \
snakemake --dag --configfile config/test/config.overnight.yaml | sed -n '/^digraph/,$ p' | dot -Tsvg -o doc/img/dag_overnight.svg && \
snakemake --dag --configfile config/test/config.myopic.yaml | sed -n '/^digraph/,$ p' | dot -Tsvg -o doc/img/dag_myopic.svg
"""
generate-config = "python -c 'from scripts.lib.validation.config import generate_config_defaults, generate_config_schema; generate_config_defaults(); generate_config_schema()'"
sync-locks = """
pixi install -e default && \
pixi workspace export conda-explicit-spec -e default envs && \
bash -c 'for f in envs/*_conda_spec*; do mv "$f" "${f/_conda_spec/.pin}"; done' && \
pixi workspace export conda-environment -e default envs/environment.yaml -n pypsa-eur
"""
[dependencies]
atlite = ">=0.3,!=0.5.0"
bokeh = ">=3.8.0"
cartopy = ">=0.25.0"
copernicusmarine = ">=2.2.4"
country_converter = ">=1.3.2"
dask = ">=2025.10.0"
descartes = ">=1.1.0"
entsoe-py = ">=0.7.8"
fiona = ">=1.10.1"
folium = ">=0.20.0"
geojson = ">=3.2.0"
geopandas = ">=1"
geopy = ">=2.4.1"
glpk = ">=5.0"
graphviz = ">=12.2.1"
gurobi = ">=12.0.3"
highspy = ">=1.12.0"
ipython = ">=9.7.0"
jpype1 = ">=1.6.0"
libgdal-netcdf = ">=3.10.3"
linopy = ">=0.6.1,<0.7.0" # remove <0.7.0 with pypsa >= 1.2.2
lxml = ">=6.0.2"
matplotlib = ">=3.10.7"
memory_profiler = ">=0.61.0"
netcdf4 = ">=1.7.2,!=1.7.4"
networkx = ">=3.5"
numpy = ">=1.26.4"
openpyxl = ">=3.1.5"
pandas = ">=2.1"
plotly = ">=6.4.0"
powerplantmatching = ">=0.5.15"
pydantic = ">=2"
python-dotenv = ">=1.0"
proj = ">=9.6.2"
pydeck = ">0.6" # pypsa fails to import with pydeck <0.6, lower bound was only added from pypsa 1.0.6
pypsa = "<1.2"
pyscipopt = ">=5.6.0"
pytables = ">=3.10.2"
python = ">=3.10"
pytz = ">=2025.2"
pyxlsb = ">=1.0.10"
rasterio = ">=1.4.3"
rasterstats = ">=0.10.3"
rioxarray = ">=0.20.0"
"ruamel.yaml" = ">=0.18.0"
scipy = ">=1.16.3"
seaborn = ">=0.13.2"
shapely = ">=2.0"
snakemake-executor-plugin-cluster-generic = ">=1.0.9"
snakemake-minimal = ">=9"
snakemake-storage-plugin-http = ">=0.3"
tenacity = ">=9.1.2"
tqdm = ">=4.67.1"
tsam = ">=2.3.1"
xarray = ">=2024.3.0,<2025.7.0"
xlrd = ">=2.0.2"
yaml = ">=0.2.5"
snakemake-storage-plugin-cached-http = ">=0.2.1"
pandera = ">=0.28.1"
natsort = ">=8.4.0"
snakemake-logger-plugin-pypsa = ">=0.1.0"
pydeflate = ">=2.3.4"
grpcio = "<1.78"
snakemake-logger-plugin-snkmt = "==0.1.6" # For better pypsa-app integration
[target.unix.dependencies]
snakemake-executor-plugin-slurm = ">=1.9.2"
[feature.dev.dependencies]
pre-commit = ">=4.3.0"
pylint = ">=4.0.2"
ruff = ">=0.14.3"
jupyter = ">=1.1.1"
[feature.doc.tasks.build-docs]
cmd = "mkdocs build -d {{ dir }}/html"
args = ["dir"]
[feature.doc.dependencies]
atlite = "==0.4.1"
cartopy = "==0.25.0"
dask = "==2025.11.0"
descartes = "==1.1.0"
fiona = "==1.10.1"
graphviz = "==13.1.2"
matplotlib = "==3.10.7"
memory_profiler = "==0.61.0"
mkdocs = ">=1.6"
mkdocs-material = ">=9.5"
mkdocstrings = ">=0.29"
mkdocstrings-python = ">=1.16"
mkdocs-bibtex = ">=2.16"
pymdown-extensions = ">=10.0"
mkdocs-macros-plugin = ">=1.0"
mkdocs-table-reader-plugin = ">=3.1"
snakemake-minimal = ">=9"
powerplantmatching = "==0.7.1"
pydot = "==4.0.1"
pypsa = "==1.0.3"
pytables = "==3.10.2"
python = "==3.12.12"
pyyaml = "==6.0.3"
requests = "==2.32.5"
scikit-learn = "==1.7.2"
seaborn = "==0.13.2"
tabula-py = "==2.7.0"
tenacity = "==9.1.2"
tsam = "==2.3.9"
[feature.test.tasks]
integration-tests = """
snakemake -call solve_elec_networks --configfile config/test/config.electricity.yaml &&
snakemake -call --configfile config/test/config.overnight.yaml &&
snakemake -call --configfile config/test/config.myopic.yaml &&
snakemake -call resources/test-elec-clusters/networks/base_s_adm.nc --configfile config/test/config.clusters.yaml &&
snakemake -call --configfile config/test/config.scenarios.yaml -n &&
snakemake -call plot_power_networks_clustered --configfile config/test/config.tyndp.yaml &&
echo "All tests completed successfully."
"""
clean-tests = """
snakemake -call solve_elec_networks --configfile config/test/config.electricity.yaml --delete-all-output ;
snakemake -call --configfile config/test/config.overnight.yaml --delete-all-output ;
snakemake -call --configfile config/test/config.myopic.yaml --delete-all-output ;
snakemake -call resources/test-elec-clusters/networks/base_s_adm.nc --configfile config/test/config.clusters.yaml --delete-all-output ;
snakemake -call --configfile config/test/config.scenarios.yaml -n --delete-all-output ;
snakemake -call plot_power_networks_clustered --configfile config/test/config.tyndp.yaml --delete-all-output ;
echo "All test outputs have been cleaned up."
"""
unit-tests = "pytest test"
all-tests = {depends-on = ["integration-tests", "clean-tests", "unit-tests"]}
[feature.test.dependencies]
pytest = ">=8.4.2"
[feature.open-tyndp.tasks]
tyndp-sb-test = """bash -c '
snakemake -call --configfile config/test/config.tyndp.yaml "$@" && \
snakemake -call --configfile config/config.tyndp.yaml -n
' --
"""
tyndp-cba-test = """bash -c '
snakemake -call cba --configfile config/test/config.tyndp.yaml "$@" && \
snakemake -call cba --configfile config/config.tyndp.yaml -n \
' --
"""
tyndp-cyears-test = """bash -c '
snakemake -call --configfile config/test/config.cyears.yaml "$@"
' --
"""
create-tyndp-graphs = """
snakemake -call rulegraphs filegraphs --configfile config/config.tyndp.yaml
"""
tyndp-sb = """
snakemake -call --configfile config/config.tyndp.yaml
"""
tyndp-checkpoint = """
snakemake -call cba --configfile config/config.tyndp.yaml --until clean_projects
"""
tyndp-cba = """
snakemake -call cba --configfile config/config.tyndp.yaml
"""
launch-presolved-explorer = """
snakemake -call launch_presolved_explorer --configfile config/config.tyndp.yaml
"""
close-explorers = """
snakemake -call close_explorers --configfile config/config.tyndp.yaml
"""
clean-tyndp = """
snakemake -call --configfile config/test/config.tyndp.yaml --delete-all-output ;
snakemake -call cba --configfile config/test/config.tyndp.yaml --delete-all-output ;
snakemake -call --configfile config/test/config.cyears.yaml --delete-all-output ;
snakemake -call --configfile config/config.tyndp.yaml --delete-all-output ;
snakemake -call cba --configfile config/config.tyndp.yaml --delete-all-output ;
echo "All tyndp outputs have been cleaned up."
"""
all-tests = {depends-on = ["tyndp-sb-test", "tyndp-cba-test", "clean-tyndp", "integration-tests", "clean-tests", "unit-tests"]}
[feature.open-tyndp.dependencies]
# open-tyndp channel contains vendored versions of snakemake with patches for mainly windows compatibility not merged into upstream snakemake yet
snakemake-minimal = { version = ">=9.14.6", channel = "https://repo.prefix.dev/open-tyndp" }
snakemake-storage-plugin-cached-http = ">=0.3"
pypsa-explorer = ">=0.1.1"
pixi-pycharm = ">=0.0.9"
python-calamine = ">=0.6.1"
[feature.open-tyndp.target.win-64.dependencies]
git = ">=2.52.0"
cachetools = ">=5"
[environments]
doc = { features = ["doc"], no-default-feature = true }
test = ["test", "dev"]
dev = ["dev"]
open-tyndp = ["open-tyndp", "test"] # for ease, we include test deps in our working environment