Skip to content

Conversation

@DaJansenGit
Copy link
Member

closes #779

@DaJansenGit DaJansenGit linked an issue Jan 6, 2025 that may be closed by this pull request
@DaJansenGit DaJansenGit self-assigned this Jan 6, 2025
Comment on lines 182 to 191
# 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
Copy link
Member

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.

Copy link
Member Author

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)
Copy link
Member

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?

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix tz aggregation attributes

3 participants