Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove ignoring of DeprecationWarnings #184

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading