Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Sep 22, 2022
1 parent ce285ac commit 9f54412
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions paramak/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ def export_solids_to_dagmc_h5m(
bounding_box_atol: float = 0.000001,
tags: List[str] = None,
):
if verbose:
print("solids", solids, "\n")
print("tags", tags, "\n")
if len(tags) != len(solids):
msg = (
"When specifying tags then there must be one tag for "
Expand All @@ -111,9 +114,19 @@ def export_solids_to_dagmc_h5m(
if hasattr(solid, "val"):
# if it is a compound then we need more material tags
if isinstance(solid.val(), cq.occ_impl.shapes.Compound):
compound_expanded_tags = compound_expanded_tags + [tag] * len(solid.val().Solids())
additional_tags = [tag] * len(solid.val().Solids())
compound_expanded_tags = compound_expanded_tags + additional_tags
else:
compound_expanded_tags.append(tag)
# if it is a compound then we need more material tags
elif isinstance(solid, cq.occ_impl.shapes.Compound):
additional_tags = [tag] * len(solid.Solids())
compound_expanded_tags = compound_expanded_tags + additional_tags
else:
compound_expanded_tags.append(tag)

if verbose:
print("compound_expanded_tags", compound_expanded_tags, "\n")

# a local import is used here as these packages need Moab to work
from brep_to_h5m import mesh_brep, mesh_to_h5m_in_memory_method
Expand All @@ -125,7 +138,7 @@ def export_solids_to_dagmc_h5m(
brep_file_part_properties = bpf.get_part_properties_from_shapes(brep_shape)

if verbose:
print("brep_file_part_properties", brep_file_part_properties)
print("brep_file_part_properties", brep_file_part_properties, "\n")

shape_properties = bpf.get_part_properties_from_shapes(solids)
# for counter, solid in enumerate(solids):
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_h5m/test_reactor_export_h5m.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_dagmc_h5m_export_with_graveyard(self):
named in the resulting h5m file, includes the optional graveyard"""

self.test_reactor_3.rotation_angle = 180
self.test_reactor_3.export_dagmc_h5m("dagmc_reactor.h5m", include_graveyard={"size": 250})
self.test_reactor_3.export_dagmc_h5m("dagmc_reactor.h5m", include_graveyard={"size": 250}, verbose=True)

vols = di.get_volumes_from_h5m("dagmc_reactor.h5m")
assert vols == [1, 2, 3, 4]
Expand Down

0 comments on commit 9f54412

Please sign in to comment.