Skip to content

Commit

Permalink
Merge pull request #643 from openego/fix/#642-export-segmentation-tim…
Browse files Browse the repository at this point in the history
…eseries

Fix export of information when using segmentation
  • Loading branch information
KathiEsterl authored May 10, 2023
2 parents 84abdc0 + 3fed014 commit b71505b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions etrago/cluster/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,10 @@ def run(
)

if segmentation != False:
timeseries.to_csv(
pd.DataFrame(
timeseries.reset_index(),
columns=["dates", "SegmentNo", "SegmentDuration"],
).set_index("SegmentNo").to_csv(
"timeseries_segmentation=" + str(segment_no) + ".csv"
)
else:
Expand Down Expand Up @@ -698,7 +701,7 @@ def prepare_pypsa_timeseries(network):
Timeseries to be considered when clustering.
"""

loads = network.loads_t.p_set.copy()
loads.columns = "L" + loads.columns

Expand Down Expand Up @@ -795,7 +798,7 @@ def skip_snapshots(self):
None.
"""

# save second network for optional dispatch disaggregation
if (
self.args["temporal_disaggregation"]["active"] == True
Expand All @@ -806,7 +809,6 @@ def skip_snapshots(self):
n_skip = self.args["skip_snapshots"]

if n_skip:

last_weight = (
int(
(
Expand Down Expand Up @@ -834,4 +836,3 @@ def skip_snapshots(self):
self.network.snapshot_weightings.loc[
self.network.snapshot_weightings.index[-1]
]["generators"] = last_weight

0 comments on commit b71505b

Please sign in to comment.