Skip to content

Commit

Permalink
Merge pull request #216 from ManuelHu/patch-1
Browse files Browse the repository at this point in the history
LogicalVolume: do not set material registry if addRegistry=False and registry=None
  • Loading branch information
stewartboogert authored Dec 9, 2024
2 parents d84f5c1 + 326ddfb commit ebbcc37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pyg4ometry/geant4/LogicalVolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def __init__(self, solid, material, name, registry=None, addRegistry=True, **kwa

if isinstance(material, _mat.Material):
self.material = material
self.material.set_registry(registry, dontWarnIfAlreadyAdded=True)
if registry and addRegistry:
self.material.set_registry(registry, dontWarnIfAlreadyAdded=True)
elif isinstance(material, str):
# If the material is registered already, use it
if registry and material in registry.materialDict:
Expand Down

0 comments on commit ebbcc37

Please sign in to comment.