Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove connection costs output #1031

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion rules/build_electricity.smk
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ rule simplify_network:
regions_onshore=resources("regions_onshore_elec_s{simpl}.geojson"),
regions_offshore=resources("regions_offshore_elec_s{simpl}.geojson"),
busmap=resources("busmap_elec_s{simpl}.csv"),
connection_costs=resources("connection_costs_s{simpl}.csv"),
log:
logs("simplify_network/elec_s{simpl}.log"),
benchmark:
Expand Down
2 changes: 2 additions & 0 deletions scripts/build_electricity_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ def manual_adjustment(load, fn_load, countries):
logger.info("Supplement missing data with synthetic data.")
fn = snakemake.input.synthetic
synthetic_load = pd.read_csv(fn, index_col=0, parse_dates=True)
# "UA" does not appear in synthetic load data
countries = list(set(countries) - set(["UA"]))
synthetic_load = synthetic_load.loc[snapshots, countries]
load = load.combine_first(synthetic_load)

Expand Down
12 changes: 2 additions & 10 deletions scripts/simplify_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _compute_connection_costs_to_bus(
return connection_costs_to_bus


def _adjust_capital_costs_using_connection_costs(n, connection_costs_to_bus, output):
def _adjust_capital_costs_using_connection_costs(n, connection_costs_to_bus):
connection_costs = {}
for tech in connection_costs_to_bus:
tech_b = n.generators.carrier == tech
Expand All @@ -228,14 +228,12 @@ def _adjust_capital_costs_using_connection_costs(n, connection_costs_to_bus, out
)
)
connection_costs[tech] = costs
pd.DataFrame(connection_costs).to_csv(output.connection_costs)


def _aggregate_and_move_components(
n,
busmap,
connection_costs_to_bus,
output,
aggregate_one_ports={"Load", "StorageUnit"},
aggregation_strategies=dict(),
exclude_carriers=None,
Expand All @@ -248,7 +246,7 @@ def replace_components(n, c, df, pnl):
if not df.empty:
import_series_from_dataframe(n, df, c, attr)

_adjust_capital_costs_using_connection_costs(n, connection_costs_to_bus, output)
_adjust_capital_costs_using_connection_costs(n, connection_costs_to_bus)

generator_strategies = aggregation_strategies["generators"]

Expand Down Expand Up @@ -281,7 +279,6 @@ def simplify_links(
length_factor,
p_max_pu,
exclude_carriers,
output,
aggregation_strategies=dict(),
):
## Complex multi-node links are folded into end-points
Expand Down Expand Up @@ -406,7 +403,6 @@ def split_links(nodes):
n,
busmap,
connection_costs_to_bus,
output,
aggregation_strategies=aggregation_strategies,
exclude_carriers=exclude_carriers,
)
Expand All @@ -419,7 +415,6 @@ def remove_stubs(
renewable_carriers,
length_factor,
simplify_network,
output,
aggregation_strategies=dict(),
):
logger.info("Removing stubs")
Expand All @@ -436,7 +431,6 @@ def remove_stubs(
n,
busmap,
connection_costs_to_bus,
output,
aggregation_strategies=aggregation_strategies,
exclude_carriers=simplify_network["exclude_carriers"],
)
Expand Down Expand Up @@ -556,7 +550,6 @@ def cluster(
params.length_factor,
params.p_max_pu,
params.simplify_network["exclude_carriers"],
snakemake.output,
params.aggregation_strategies,
)

Expand All @@ -569,7 +562,6 @@ def cluster(
params.renewable_carriers,
params.length_factor,
params.simplify_network,
snakemake.output,
aggregation_strategies=params.aggregation_strategies,
)
busmaps.append(stub_map)
Expand Down