-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from PHX.model.project import PhxProject, PhxVariant | ||
|
||
|
||
def _total_num_polygons(variant: PhxVariant) -> int: | ||
"""Calculate the total number of Polygons in a variant.""" | ||
return len( | ||
[ | ||
p for c in variant.building.all_components | ||
for p in c.polygons | ||
] | ||
) | ||
|
||
def test_building_has_same_number_of_polygons( | ||
create_phx_project_from_hbjson: PhxProject, | ||
create_phx_project_from_wufi_xml: PhxProject, | ||
) -> None: | ||
for hbjson_variant, wufi_xml_variant in zip( | ||
create_phx_project_from_hbjson.variants, | ||
create_phx_project_from_wufi_xml.variants, | ||
): | ||
num_hbjson_polygons = _total_num_polygons(hbjson_variant) | ||
num_xml_polygons = _total_num_polygons(wufi_xml_variant) | ||
assert num_hbjson_polygons == num_xml_polygons |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from PHX.model.project import PhxProject, PhxVariant | ||
|
||
|
||
def _total_num_vertices(variant: PhxVariant) -> int: | ||
"""Calculate the total number of vertices in a variant.""" | ||
return len( | ||
[ | ||
v for c in variant.building.all_components | ||
for p in c.polygons | ||
for v in p.vertices | ||
] | ||
) | ||
|
||
def test_building_has_same_number_of_vertices( | ||
create_phx_project_from_hbjson: PhxProject, | ||
create_phx_project_from_wufi_xml: PhxProject, | ||
) -> None: | ||
for hbjson_variant, wufi_xml_variant in zip( | ||
create_phx_project_from_hbjson.variants, | ||
create_phx_project_from_wufi_xml.variants, | ||
): | ||
num_hbjson_vertices = _total_num_vertices(hbjson_variant) | ||
num_xml_vertices = _total_num_vertices(wufi_xml_variant) | ||
assert num_hbjson_vertices == num_xml_vertices |
File renamed without changes.
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.