-
Notifications
You must be signed in to change notification settings - Fork 3
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
Speed up HBJSON_to_PHPP #47
base: main
Are you sure you want to change the base?
Conversation
Hi @gjtorikian ! This is fantastic! Thank you so much for all this! I love it. The one item I'm not 100% sure about is the Just as an example: the def write_project_opaque_surfaces(self, phx_project: project.PhxProject) -> None:
"""Write all of the opaque surfaces from a PhxProject to the PHPP 'Areas' worksheet."""
surfaces: List[areas_surface.SurfaceRow] = []
for phx_variant in phx_project.variants:
for opaque_component in phx_variant.building.opaque_components:
for phx_polygon in opaque_component.polygons:
surfaces.append(
areas_surface.SurfaceRow(
self.shape.AREAS,
phx_polygon,
opaque_component,
#---
#--- Reads from U-Values worksheet here
#---
self.u_values.get_constructor_phpp_id_by_name(
opaque_component.assembly.display_name, _use_cache=True
#---
#---
),
)
) So I'm not sure, but it seems like perhaps if the U-Value write hasn't executed, this may cause an error? I'm not sure if that's how There are a couple spots like that: For sure some like climate, lighting, appliances and others can be out of order and won't affect it though. I'll try and run some test scenarios and see what I find. |
One other item I notice on I think maybe the new |
Shucks, I was worried about that. In those cases, yes, absolutely,
Sounds good, I'll take care of it. |
Good idea. They are all buried inside the
I think that's all of them actually? The rest are more or less independent I think. Although: It's also possible this could all be re-designed as well? I was just trying to avoid maintaining a duplicate record of all the PHPP entries / locations / values, and so I was just using those 'read' operations in lieu of keeping track myself within the Python app. But if there is a significant performance reason, its certainly possible to add some form of local record keeping as well? |
👋 Hello! A friend of mine contacted me to see if I could help speed up his conversion of HBJSON to PHPP in Grasshopper. I traced the plugin back to your project, and was able to reproduce some of the performance issues locally.
In this PR, I propose two changes:
async
/await
. Since we don't actually care when the writing happens, we can perform it asynchronously.With this, I was able to drop a five minute run down to an average of a minute-thirty. Happy to make any additional changes necessary here! Thanks for keeping the project very well organized, it was easy to pull it apart and poke around.