Skip to content

Commit f01378f

Browse files
committed
Merge remote-tracking branch 'eur/master' into merge-july
2 parents 2482b1f + 9529284 commit f01378f

File tree

9 files changed

+51
-5
lines changed

9 files changed

+51
-5
lines changed

config/test/config.myopic.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ sector:
4040
supplemental_heating:
4141
enable: true
4242
booster_heat_pump: true
43+
heat_pump_sources:
44+
urban central:
45+
- air
46+
- geothermal
47+
urban decentral:
48+
- air
49+
rural:
50+
- air
51+
- ground
4352
hydrogen_turbine: false
4453
regional_oil_demand: false
4554
regional_co2_sequestration_potential:

config/test/config.overnight.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ sector:
6868
booster_heat_pump: true
6969
ates:
7070
enable: true
71+
heat_pump_sources:
72+
urban central:
73+
- air
74+
- geothermal
75+
urban decentral:
76+
- air
77+
rural:
78+
- air
79+
- ground
7180
hydrogen_turbine: false
7281
regional_oil_demand: false
7382
regional_co2_sequestration_potential:

config/test/config.perfect.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ sector:
5151
booster_heat_pump: true
5252
ates:
5353
enable: true
54+
heat_pump_sources:
55+
urban central:
56+
- air
57+
- geothermal
58+
urban decentral:
59+
- air
60+
rural:
61+
- air
62+
- ground
5463
hydrogen_turbine: false
5564
regional_oil_demand: false
5665
regional_co2_sequestration_potential:

scripts/build_industrial_production_per_country_tomorrow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
al_primary_fraction = get(params["Al_primary_fraction"], investment_year)
8989
fraction_persistent_primary = (
90-
al_primary_fraction * total_aluminium.sum() / production[key_pri].sum()
90+
al_primary_fraction * total_aluminium.sum() / (production[key_pri].sum() or 1)
9191
)
9292

9393
production[key_pri] = fraction_persistent_primary * production[key_pri]

scripts/definitions/heat_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def heat_pump_costs_name(self, heat_source: str) -> str:
223223
str
224224
The name for the heat pump costs.
225225
"""
226-
if heat_source in ["ptes"]:
226+
if heat_source in ["ptes", "geothermal"]:
227227
return f"{self.central_or_decentral} excess-heat-sourced heat pump"
228228
else:
229229
return f"{self.central_or_decentral} {heat_source}-sourced heat pump"

scripts/prepare_network.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,23 @@
2929
import numpy as np
3030
import pandas as pd
3131
import pypsa
32-
from pypsa.common import expand_series
3332

3433
from scripts._helpers import (
34+
PYPSA_V1,
3535
configure_logging,
3636
get,
3737
set_scenario_config,
3838
update_config_from_wildcards,
3939
)
4040
from scripts.add_electricity import load_costs, set_transmission_costs
4141

42+
# Allow for PyPSA versions <0.35
43+
if PYPSA_V1:
44+
from pypsa.common import expand_series
45+
else:
46+
from pypsa.descriptors import expand_series
47+
48+
4249
idx = pd.IndexSlice
4350

4451
logger = logging.getLogger(__name__)

scripts/prepare_perfect_foresight.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
import numpy as np
1111
import pandas as pd
1212
import pypsa
13-
from pypsa.common import expand_series
1413
from six import iterkeys
1514

1615
from scripts._helpers import (
16+
PYPSA_V1,
1717
configure_logging,
1818
sanitize_custom_columns,
1919
set_scenario_config,
@@ -22,6 +22,12 @@
2222
from scripts.add_electricity import sanitize_carriers
2323
from scripts.add_existing_baseyear import add_build_year_to_new_assets
2424

25+
# Allow for PyPSA versions <0.35
26+
if PYPSA_V1:
27+
from pypsa.common import expand_series
28+
else:
29+
from pypsa.descriptors import expand_series
30+
2531
logger = logging.getLogger(__name__)
2632

2733

scripts/prepare_sector_network.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3382,6 +3382,7 @@ def add_heat(
33823382
n.add(
33833383
"Bus",
33843384
nodes,
3385+
location=nodes,
33853386
suffix=f" {heat_carrier}",
33863387
carrier=heat_carrier,
33873388
)

scripts/solve_network.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@
5454
)
5555

5656
logger = logging.getLogger(__name__)
57-
pypsa.network.power_flow.logger.setLevel(logging.WARNING)
57+
58+
# Allow for PyPSA versions <0.35
59+
if PYPSA_V1:
60+
pypsa.network.power_flow.logger.setLevel(logging.WARNING)
61+
else:
62+
pypsa.pf.logger.setLevel(logging.WARNING)
5863

5964

6065
class ObjectiveValueError(Exception):

0 commit comments

Comments
 (0)