Skip to content

Commit

Permalink
Fix rating for branches.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktehranchi committed Aug 26, 2024
1 parent b3faa53 commit 008ca9d
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/r2x/parser/plexos.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,21 +423,10 @@ def _construct_branches(self, default_model=MonitoredLine):
)
for line in lines_pivot.iter_rows(named=True):
line_properties_mapped = {self.property_map.get(key, key): value for key, value in line.items()}
valid_fields = {
k: v
for k, v in line_properties_mapped.items()
if k in default_model.model_fields
if v is not None
}
line_properties_mapped["rating_up"] = line_properties_mapped.pop("max_power_flow", None)
line_properties_mapped["rating_down"] = line_properties_mapped.pop("max_power_flow", None)

ext_data = {
k: v
for k, v in line_properties_mapped.items()
if k not in default_model.model_fields
if v is not None
}
if ext_data:
valid_fields["ext"] = ext_data
valid_fields, ext_data = self._field_filter(line_properties_mapped, default_model.model_fields)

from_bus_name = next(
membership
Expand Down

0 comments on commit 008ca9d

Please sign in to comment.