Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/codecov/codecov-ac…
Browse files Browse the repository at this point in the history
…tion-5
  • Loading branch information
stewartboogert authored Dec 9, 2024
2 parents 9598560 + 4aace5e commit 6db66ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ build:
python: "3.10"
jobs:
post_install:
- pip install --upgrade --upgrade-strategy only-if-needed furo sphinx>=7.2.2 sphinx-autoapi sphinx-copybutton sphinx-inline-tabs
- pip install --upgrade --upgrade-strategy only-if-needed furo "sphinx>=7.2.2" "sphinx-autoapi<3.4.0" sphinx-copybutton sphinx-inline-tabs
5 changes: 5 additions & 0 deletions src/pyg4ometry/gdml/Defines.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numbers as _numbers
import numpy as _np
import re as _re
from . import Units as _Units


Expand Down Expand Up @@ -28,6 +29,10 @@ def __init__(self, name, expressionString, registry):
self.registry = registry

def eval(self):
# short-cut for expressions only having a numeric path
if _re.match(r"-?[0-9]+(?:\.[0-9]+)$", self.expressionString):
return float(self.expressionString)

expressionParser = self.registry.getExpressionParser()
self.parseTree = expressionParser.parse(self.expressionString)
value = expressionParser.evaluate(self.parseTree, self.registry.defineDict)
Expand Down
6 changes: 3 additions & 3 deletions src/pyg4ometry/visualisation/VtkViewerNew.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def clear(self):
self.clippers = [] # clip filters
self.axes = [] # axes actors

self.pdNameDict = {} # polydata to LV name
self.instanceNameDict = {} # instance transformation to PV name

self.bBuiltPipelines = False
Expand Down Expand Up @@ -326,7 +325,6 @@ def buildPipelinesAppend(self):
pd = _Convert.pycsgMeshToVtkPolyData(self.localmeshes[k])
# pd.SetObjectName(k)
self.polydata[k] = pd
self.pdNameDict[pd] = k

appFltDict = {}
visOptDict = {}
Expand Down Expand Up @@ -708,7 +706,9 @@ def rightButtonPressEvent(self, obj, event):
pdmin = pd
pdamin = pda

lvName = self.vtkviewer.pdNameDict[pdamin.GetInputAlgorithm().GetInput()]
for name, pd in self.vtkviewer.polydata.items():
if pd == pdamin.GetInputAlgorithm().GetInput():
lvName = name
pvName = self.vtkviewer.instanceNameDict[pdamin]
pvTrans = pdamin.GetTransform()
[mtra, tra] = _Convert.vtkTransformation2PyG4(pvTrans.GetConcatenatedTransform(0))
Expand Down

0 comments on commit 6db66ae

Please sign in to comment.