Skip to content

Commit

Permalink
Make docs build happe
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelHu authored Sep 9, 2024
1 parent 5ce465d commit a844b14
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/legendoptics/pyg4utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,12 @@ def addConstPropertyPint(self, name, value):
g4.solid.OpticalSurface.addConstPropertyPint = addConstPropertyPint

# those units are supported by G4, but not by pyg4ometry...
if "nanometer" not in gdml_u.units:
gdml_u.units["nanometer"] = gdml_u.units["nm"]
if "micrometer" not in gdml_u.units:
gdml_u.units["micrometer"] = gdml_u.units["um"]
# the first check is ugly, but necessary: we have a mock import of gdml_u for the docs build.
if isinstance(gdml_u.units, dict):
if "nanometer" not in gdml_u.units:
gdml_u.units["nanometer"] = gdml_u.units["nm"]
if "micrometer" not in gdml_u.units:
gdml_u.units["micrometer"] = gdml_u.units["um"]


_patch_g4_pint_unit_support()
Expand Down

0 comments on commit a844b14

Please sign in to comment.