Open ed-p-may opened 1 year ago
Hi @PH-Tools ,
Sorry for the very late response here. You have the right idea here but your current proposal would result in the HVAC being scaled multiple times for each Room that it is applied to (given that it's often the same HVAC Python instance that is assigned to multiple Rooms).
The correct place to assign it is on the ModelEnergyProperties
and not the RoomEnergyProperties
. And you would have to call ModelEnergyProperties.hvacs
to get a list of all unique HVACs in the Model, which can then be scaled.
I think there's also probably a better way to get the extension attributes using an extension_attributes
property similar to what we do here in honeybee-core:
https://github.com/ladybug-tools/honeybee-core/blob/master/honeybee/properties.py#L31-L34
Lastly, if you implement this scale() capability, you should probably also implement it for the 4 other types of transforms that honeybee objects support, including:
If you put together a PR that addresses all of this, I am happy to review it and merge.
Hi @chriswmackey ,
Sorry for the crazy long delay on this! It fell off my critical TODO list, but has popped back up. If you are still open to it, I have opened a PR with the proposed changes.
I think I implemented everything the way you suggested, but of course let me know what you think?
thanks @ed-p-may
Hi all,
I wonder if you would be ok with revising the
RoomEnergyProperties.scale()
method in order to make it generalized to all it's attributes with a.scale
method?Scenario
As part of the Honeybee-PH plugin, we have few new objects which are part of the
room.properties.energy.hvac
androom.properties.energy.shw
attributes which actually carry along geometric information. Notably, some ventilation system ducting, and hot-water-piping objects. These objects have geometry (LadybugLineSegment3D
) and I would like to properly scale them during Honeybeemodel.scale()
operations.Right now, the
.scale()
method successfully passes down through the model, rooms, properties, but due to the currentRoomEnergyProperties.scale()
method, it 'stops' at theRoom.properties.energy
level, since right now onlydaylighting_control
gets scaled.Proposed Revision
Unless you think its a bad idea for some reason, I would proposed revising the
RoomEnergyProperties.scale()
method such that it will call.scale
on any of its child attributes which include the "scale" method name. So perhaps something very similar to the existing.scale()
implementation in honeybee's_Properties
, roughly like the following:I believe this would allow for any child objects to carry on the scale operation.
If you think this change would be ok, I can add PR with the proposed changes.
thanks! -Ed @PH-Tools