some small adjustments to run as single node model (#1183)

* some small adjustments to run as single node model

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Fabian Neumann 2024-07-31 11:53:20 +02:00 committed by GitHub
parent e9e0a0da20
commit 4c1ec3559d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 6 deletions

View File

@ -58,6 +58,9 @@ def build_clustered_gas_network(df, bus_regions, length_factor=1.25):
# drop pipes within the same region
df = df.loc[df.bus1 != df.bus0]
if df.empty:
return df
# recalculate lengths as center to center * length factor
df["length"] = df.apply(
lambda p: length_factor

View File

@ -2775,10 +2775,11 @@ def add_industry(n, costs):
)
domestic_navigation = pop_weighted_energy_totals.loc[
nodes, "total domestic navigation"
nodes, ["total domestic navigation"]
].squeeze()
international_navigation = (
pd.read_csv(snakemake.input.shipping_demand, index_col=0).squeeze() * nyears
pd.read_csv(snakemake.input.shipping_demand, index_col=0).squeeze(axis=1)
* nyears
)
all_navigation = domestic_navigation + international_navigation
p_set = all_navigation * 1e6 / nhours
@ -3946,12 +3947,11 @@ if __name__ == "__main__":
snakemake = mock_snakemake(
"prepare_sector_network",
# configfiles="test/config.overnight.yaml",
simpl="",
opts="",
clusters="37",
ll="v1.0",
sector_opts="730H-T-H-B-I-A-dist1",
clusters="1",
ll="vopt",
sector_opts="",
planning_horizons="2050",
)