Skip to content

Commit

Permalink
Merge branch 'hybit' into features/hybit_pw_constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
birgits committed Aug 16, 2024
2 parents f74a78c + 1f4f317 commit fa3f55e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions etrago/tools/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import math
import os

from geoalchemy2.shape import to_shape # noqa: F401
from pyomo.environ import Constraint, PositiveReals, Var
import geoalchemy2
import numpy as np
import pandas as pd
import pypsa
Expand Down Expand Up @@ -1126,9 +1126,16 @@ def agg_parallel_lines(l0):
lines_2["bus0"] = bus_max
lines_2["bus1"] = bus_min
lines_2.reset_index(inplace=True)

lines_2["geom"] = lines_2.apply(
lambda x: None if x.geom is None else x.geom.wkt, axis=1
lambda x: (
x.geom.wkt
if isinstance(x.geom, geoalchemy2.elements.WKBElement)
else None
),
axis=1,
)

network.lines = (
lines_2.groupby(["bus0", "bus1"])
.apply(agg_parallel_lines)
Expand Down

0 comments on commit fa3f55e

Please sign in to comment.