Skip to content

Commit

Permalink
fix: use TransformProfile when we add new plants, even without scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
danielolsen committed Dec 8, 2020
1 parent 7c73652 commit 645e9f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion powersimdata/scenario/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ def prepare_profile(self, kind, profile_as=None):
profile = TransformProfile(
self._data_access, self._scenario_info, self.grid, self.ct
)
if bool(profile.scale_keys[kind] & set(self.ct.keys())):
if "new_plant" in self.ct.keys():
new_plant_types = {plant["type"] for plant in self.ct["new_plant"]}
if bool(profile.scale_keys[kind] & (new_plant_types | set(self.ct.keys()))):
self._prepare_scaled_profile(kind, profile)
else:
self._create_link_to_base_profile(kind)
Expand Down

0 comments on commit 645e9f9

Please sign in to comment.