only calculate Aggregated TZ attributes if existing and use to_aggregation method#780
Open
DaJansenGit wants to merge 13 commits intodevelopmentfrom
Open
only calculate Aggregated TZ attributes if existing and use to_aggregation method#780DaJansenGit wants to merge 13 commits intodevelopmentfrom
DaJansenGit wants to merge 13 commits intodevelopmentfrom
Conversation
…ation for all attributes
veronikarichter
requested changes
Jan 9, 2025
Co-authored-by: Veronika Richter <48535180+veronikarichter@users.noreply.github.com>
Co-authored-by: Veronika Richter <48535180+veronikarichter@users.noreply.github.com>
veronikarichter
requested changes
May 16, 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 |
Member
There was a problem hiding this comment.
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.
| functions=[_intensive_list_calc], | ||
| dependant_elements='elements' | ||
| ) | ||
| t_set_cool = bps.ThermalZone.t_set_cool.to_aggregation(_intensive_calc) |
Member
There was a problem hiding this comment.
How do these work and hy do you use them instead of the previous attributes? Do they still have the same functionality as before?
Member
Author
There was a problem hiding this comment.
the functionality is show in the to_aggregation function of the attributeclass. Its just a new attribute with the same functionality.
veronikarichter
requested changes
May 16, 2025
Co-authored-by: Veronika Richter <48535180+veronikarichter@users.noreply.github.com>
Co-authored-by: Veronika Richter <48535180+veronikarichter@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #779