Skip to content

Commit

Permalink
Merge branch 'main_origin' into make_generators_link
Browse files Browse the repository at this point in the history
  • Loading branch information
yerbol-akhmetov committed Nov 2, 2024
2 parents a44b893 + 1075456 commit 884f9d6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 35 deletions.
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,10 @@ The documentation is available here: [documentation](https://pypsa-earth.readthe
</a>
</td>
<td align="center">
<a href="https://github.com/carlosfv92">
<img src="https://avatars.githubusercontent.com/u/103258059?v=4" width="100;" alt="carlosfv92"/>
<a href="https://github.com/asolavi">
<img src="https://avatars.githubusercontent.com/u/131155817?v=4" width="100;" alt="asolavi"/>
<br />
<sub><b>Carlos Fernandez</b></sub>
<sub><b>Null</b></sub>
</a>
</td></tr>
<tr>
Expand All @@ -411,12 +411,19 @@ The documentation is available here: [documentation](https://pypsa-earth.readthe
</a>
</td>
<td align="center">
<a href="https://github.com/asolavi">
<img src="https://avatars.githubusercontent.com/u/131155817?v=4" width="100;" alt="asolavi"/>
<a href="https://github.com/danielelerede-oet">
<img src="https://avatars.githubusercontent.com/u/175011591?v=4" width="100;" alt="danielelerede-oet"/>
<br />
<sub><b>Null</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/carlosfv92">
<img src="https://avatars.githubusercontent.com/u/103258059?v=4" width="100;" alt="carlosfv92"/>
<br />
<sub><b>Carlos Fernandez</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/stephenjlee">
<img src="https://avatars.githubusercontent.com/u/11340470?v=4" width="100;" alt="stephenjlee"/>
Expand All @@ -437,15 +444,15 @@ The documentation is available here: [documentation](https://pypsa-earth.readthe
<br />
<sub><b>Null</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/juli-a-ko">
<img src="https://avatars.githubusercontent.com/u/126512394?v=4" width="100;" alt="juli-a-ko"/>
<br />
<sub><b>Juli-a-ko</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/squoilin">
<img src="https://avatars.githubusercontent.com/u/4547840?v=4" width="100;" alt="squoilin"/>
Expand Down Expand Up @@ -480,15 +487,15 @@ The documentation is available here: [documentation](https://pypsa-earth.readthe
<br />
<sub><b>Katherine M. Antonio</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/jessLryan">
<img src="https://avatars.githubusercontent.com/u/122939887?v=4" width="100;" alt="jessLryan"/>
<br />
<sub><b>Jess</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/jarry7">
<img src="https://avatars.githubusercontent.com/u/27745389?v=4" width="100;" alt="jarry7"/>
Expand Down
1 change: 1 addition & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ E.g. if a new rule becomes available describe how to use it `make test` and in o

* The computation of `hydro_profile.nc` in `build_renewable_profiles.py` is not differentiated whether alternative clustering is applied or not; the indexing of the different power plants in `add_electricity.py` is performed according to the bus either in case alternative clustering is applied or not and a `hydro_inflow_factor` is computed prior to the computation of `inflow_t` to split the inflow according to the capacity of each different unit of each power plant (if more units are present). `PR #1119 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1119>`_

* Fix bugs in `prepare_sector_network.py` related to links with H2 buses and bug of re-addition of H2 and battery carriers in present `PR #1145 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1145>`_

PyPSA-Earth 0.4.1
=================
Expand Down
51 changes: 27 additions & 24 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def H2_liquid_fossil_conversions(n, costs):
def add_hydrogen(n, costs):
"function to add hydrogen as an energy carrier with its conversion technologies from and to AC"

n.add("Carrier", "H2")
if not "H2" in n.carriers.index:
n.add("Carrier", "H2")

n.madd(
"Bus",
Expand Down Expand Up @@ -1065,7 +1066,9 @@ def add_aviation(n, cost):

def add_storage(n, costs):
"function to add the different types of storage systems"
n.add("Carrier", "battery")

if not "battery" in n.carriers.index:
n.add("Carrier", "battery")

n.madd(
"Bus",
Expand Down Expand Up @@ -1154,19 +1157,19 @@ def h2_hc_conversions(n, costs):
if snakemake.config["sector"]["hydrogen"]["hydrogen_colors"]:
n.madd(
"Bus",
nodes + " blue H2",
location=nodes,
spatial.nodes + " blue H2",
location=spatial.nodes,
carrier="blue H2",
x=n.buses.loc[list(nodes)].x.values,
y=n.buses.loc[list(nodes)].y.values,
x=n.buses.loc[list(spatial.nodes)].x.values,
y=n.buses.loc[list(spatial.nodes)].y.values,
)

n.madd(
"Link",
spatial.nodes,
suffix=" SMR CC",
bus0=spatial.gas.nodes,
bus1=nodes + " blue H2",
bus1=spatial.nodes + " blue H2",
bus2="co2 atmosphere",
bus3=spatial.co2.nodes,
p_nom_extendable=True,
Expand All @@ -1181,9 +1184,9 @@ def h2_hc_conversions(n, costs):

n.madd(
"Link",
nodes + " blue H2",
bus0=nodes + " blue H2",
bus1=nodes + " H2",
spatial.nodes + " blue H2",
bus0=spatial.nodes + " blue H2",
bus1=spatial.nodes + " H2",
carrier="blue H2",
capital_cost=0,
p_nom_extendable=True,
Expand All @@ -1196,7 +1199,7 @@ def h2_hc_conversions(n, costs):
spatial.nodes,
suffix=" SMR CC",
bus0=spatial.gas.nodes,
bus1=nodes + " H2",
bus1=spatial.nodes + " H2",
bus2="co2 atmosphere",
bus3=spatial.co2.nodes,
p_nom_extendable=True,
Expand All @@ -1213,18 +1216,18 @@ def h2_hc_conversions(n, costs):
if snakemake.config["sector"]["hydrogen"]["hydrogen_colors"]:
n.madd(
"Bus",
nodes + " grey H2",
location=nodes,
spatial.nodes + " grey H2",
location=spatial.nodes,
carrier="grey H2",
x=n.buses.loc[list(nodes)].x.values,
y=n.buses.loc[list(nodes)].y.values,
x=n.buses.loc[list(spatial.nodes)].x.values,
y=n.buses.loc[list(spatial.nodes)].y.values,
)

n.madd(
"Link",
nodes + " SMR",
spatial.nodes + " SMR",
bus0=spatial.gas.nodes,
bus1=nodes + " grey H2",
bus1=spatial.nodes + " grey H2",
bus2="co2 atmosphere",
p_nom_extendable=True,
carrier="SMR",
Expand All @@ -1236,9 +1239,9 @@ def h2_hc_conversions(n, costs):

n.madd(
"Link",
nodes + " grey H2",
bus0=nodes + " grey H2",
bus1=nodes + " H2",
spatial.nodes + " grey H2",
bus0=spatial.nodes + " grey H2",
bus1=spatial.nodes + " H2",
carrier="grey H2",
capital_cost=0,
p_nom_extendable=True,
Expand All @@ -1248,9 +1251,9 @@ def h2_hc_conversions(n, costs):
else:
n.madd(
"Link",
nodes + " SMR",
spatial.nodes + " SMR",
bus0=spatial.gas.nodes,
bus1=nodes + " H2",
bus1=spatial.nodes + " H2",
bus2="co2 atmosphere",
p_nom_extendable=True,
carrier="SMR",
Expand Down Expand Up @@ -1318,7 +1321,7 @@ def add_shipping(n, costs):
if options["shipping_hydrogen_liquefaction"]:
n.madd(
"Bus",
nodes,
spatial.nodes,
suffix=" H2 liquid",
carrier="H2 liquid",
location=spatial.nodes,
Expand Down Expand Up @@ -1347,7 +1350,7 @@ def add_shipping(n, costs):
):
n.madd(
"Load",
nodes,
spatial.nodes,
suffix=" H2 for shipping",
bus=shipping_bus,
carrier="H2 for shipping",
Expand Down

0 comments on commit 884f9d6

Please sign in to comment.