Skip to content

Commit

Permalink
add retrofit data and logic
Browse files Browse the repository at this point in the history
  • Loading branch information
longshuicy committed Dec 18, 2023
1 parent 514e93d commit b41ea0b
Show file tree
Hide file tree
Showing 4 changed files with 24,910 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ original/
*.json
!tests/data/*/*.json
!tests/data/*.json
!tests/data/retrofit/*.csv

# Seaside ipopt constants
pyincore/analyses/seasidecge/solverconstants/ipopt_cons.py
Expand Down
5 changes: 3 additions & 2 deletions pyincore/dfr3service.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ def match_inventory(self, mapping: MappingSet, inventories: list, entry_key: str
if inventory["properties"].get("guid") is not None and \
add_info_row.get("guid") is not None and \
inventory["properties"].get("guid") == add_info_row.get("guid"):
# convert {"retrofit_key":xxx, retrofit_value:yyy} to {xxx:yyy}
# convert {"retrofit_key":xxx, retrofit_value:yyy} to {retrofit_key:xxx, xxx:yyy}
inventory["properties"].update({
"retrofit_key": add_info_row["retrofit_key"],
add_info_row["retrofit_key"]: add_info_row["retrofit_value"]})
break # assume no duplicated guid

Expand All @@ -218,7 +219,7 @@ def match_inventory(self, mapping: MappingSet, inventories: list, entry_key: str
if self._property_match_legacy(rules=m.rules, properties=inventory["properties"]):
# if retrofit key exist, use retrofit key
if "retrofit_key" in inventory["properties"]:
entry_key = "retrofit_key"
entry_key = inventory["properties"]["retrofit_key"]

curve = m.entry[entry_key]
dfr3_sets[inventory['id']] = curve
Expand Down
Loading

0 comments on commit b41ea0b

Please sign in to comment.