-
Notifications
You must be signed in to change notification settings - Fork 21
only calculate Aggregated TZ attributes if existing and use to_aggregation method #780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
…ation for all attributes
Co-authored-by: Veronika Richter <[email protected]>
Co-authored-by: Veronika Richter <[email protected]>
| # only calculate intensive calc if all zones have this attribute | ||
| if all([getattr(tz, name) is not None for tz in self.elements]): | ||
| prop_bool = False | ||
| for tz in self.elements: | ||
| prop = getattr(tz, name) | ||
| if prop is not None: | ||
| if prop: | ||
| prop_bool = True | ||
| break | ||
| return prop_bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your comment says that you only want to calculate the calc if all zones have this attribute.
But what if they have different values (some set to true, some set to false)? Here, you set the attribute to True if the first occurrence is True. Please add a note that this might be an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a comment.
| functions=[_intensive_list_calc], | ||
| dependant_elements='elements' | ||
| ) | ||
| t_set_cool = bps.ThermalZone.t_set_cool.to_aggregation(_intensive_calc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do these work and hy do you use them instead of the previous attributes? Do they still have the same functionality as before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the functionality is show in the to_aggregation function of the attributeclass. Its just a new attribute with the same functionality.
Co-authored-by: Veronika Richter <[email protected]>
Co-authored-by: Veronika Richter <[email protected]>
closes #779