Skip to content

Commit

Permalink
Merge pull request #184 from ManuelHu/patch-3
Browse files Browse the repository at this point in the history
remove ignoring of DeprecationWarnings
  • Loading branch information
stewartboogert authored Sep 25, 2024
2 parents 21837f2 + e6c578e commit d2f54c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = ["error", "ignore::DeprecationWarning"]
filterwarnings = "error"
log_cli_level = "info"
testpaths = "tests"

Expand Down
10 changes: 4 additions & 6 deletions src/pyg4ometry/fluka/fluka_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from collections import OrderedDict as _OrderedDict
from collections.abc import MutableMapping as _MutableMapping

from itertools import count as _count

import numpy as _np
import pandas as _pd
import pyg4ometry.geant4 as _g4
Expand Down Expand Up @@ -566,9 +564,8 @@ class RotoTranslationStore(_MutableMapping):

def __init__(self):
self._nameMap = _OrderedDict()
# internal infinite counter generating new unique
# transformation indices.
self._counter = _count(start=2000, step=1000)
# internal counter generating new unique transformation indices.
self._counter = 2000

def __getitem__(self, name):
return self._nameMap[name]
Expand Down Expand Up @@ -603,7 +600,8 @@ def addRotoTranslation(self, rtrans):
# adding of RotoTranslations easier.
recur = _RecursiveRotoTranslation(name, [rtrans])
if not rtrans.transformationIndex:
recur.transformationIndex = next(self._counter)
recur.transformationIndex = self._counter
self._counter += 1000
elif rtrans.transformationIndex in self.allTransformationIndices():
msg = "transformation index matches another ROT-DEFI with a different name. Change the transformationIndex and try again."
raise KeyError(msg)
Expand Down
2 changes: 1 addition & 1 deletion src/pyg4ometry/fluka/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def visit_UnaryOp(self, node):
return op(operand)

def visit_Constant(self, node):
return node.n
return node.value

def visit_Name(self, node):
name = node.id
Expand Down

0 comments on commit d2f54c4

Please sign in to comment.