Merge branch 'master' into fneum/line-rating
This commit is contained in:
commit
f0057614b3
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@ -80,8 +80,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Test snakemake workflow
|
- name: Test snakemake workflow
|
||||||
run: |
|
run: |
|
||||||
conda activate pypsa-eur
|
|
||||||
conda list
|
|
||||||
snakemake -call solve_elec_networks --configfile config/test/config.electricity.yaml --rerun-triggers=mtime
|
snakemake -call solve_elec_networks --configfile config/test/config.electricity.yaml --rerun-triggers=mtime
|
||||||
snakemake -call all --configfile config/test/config.overnight.yaml --rerun-triggers=mtime
|
snakemake -call all --configfile config/test/config.overnight.yaml --rerun-triggers=mtime
|
||||||
snakemake -call all --configfile config/test/config.myopic.yaml --rerun-triggers=mtime
|
snakemake -call all --configfile config/test/config.myopic.yaml --rerun-triggers=mtime
|
||||||
|
@ -280,13 +280,13 @@ def add_EQ_constraints(n, o, scaling=1e-1):
|
|||||||
float_regex = "[0-9]*\.?[0-9]+"
|
float_regex = "[0-9]*\.?[0-9]+"
|
||||||
level = float(re.findall(float_regex, o)[0])
|
level = float(re.findall(float_regex, o)[0])
|
||||||
if o[-1] == "c":
|
if o[-1] == "c":
|
||||||
ggrouper = n.generators.bus.map(n.buses.country).to_xarray()
|
ggrouper = n.generators.bus.map(n.buses.country)
|
||||||
lgrouper = n.loads.bus.map(n.buses.country).to_xarray()
|
lgrouper = n.loads.bus.map(n.buses.country)
|
||||||
sgrouper = n.storage_units.bus.map(n.buses.country).to_xarray()
|
sgrouper = n.storage_units.bus.map(n.buses.country)
|
||||||
else:
|
else:
|
||||||
ggrouper = n.generators.bus.to_xarray()
|
ggrouper = n.generators.bus
|
||||||
lgrouper = n.loads.bus.to_xarray()
|
lgrouper = n.loads.bus
|
||||||
sgrouper = n.storage_units.bus.to_xarray()
|
sgrouper = n.storage_units.bus
|
||||||
load = (
|
load = (
|
||||||
n.snapshot_weightings.generators
|
n.snapshot_weightings.generators
|
||||||
@ n.loads_t.p_set.groupby(lgrouper, axis=1).sum()
|
@ n.loads_t.p_set.groupby(lgrouper, axis=1).sum()
|
||||||
@ -300,7 +300,7 @@ def add_EQ_constraints(n, o, scaling=1e-1):
|
|||||||
p = n.model["Generator-p"]
|
p = n.model["Generator-p"]
|
||||||
lhs_gen = (
|
lhs_gen = (
|
||||||
(p * (n.snapshot_weightings.generators * scaling))
|
(p * (n.snapshot_weightings.generators * scaling))
|
||||||
.groupby(ggrouper)
|
.groupby(ggrouper.to_xarray())
|
||||||
.sum()
|
.sum()
|
||||||
.sum("snapshot")
|
.sum("snapshot")
|
||||||
)
|
)
|
||||||
@ -309,7 +309,7 @@ def add_EQ_constraints(n, o, scaling=1e-1):
|
|||||||
spillage = n.model["StorageUnit-spill"]
|
spillage = n.model["StorageUnit-spill"]
|
||||||
lhs_spill = (
|
lhs_spill = (
|
||||||
(spillage * (-n.snapshot_weightings.stores * scaling))
|
(spillage * (-n.snapshot_weightings.stores * scaling))
|
||||||
.groupby(sgrouper)
|
.groupby(sgrouper.to_xarray())
|
||||||
.sum()
|
.sum()
|
||||||
.sum("snapshot")
|
.sum("snapshot")
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user