Skip to content

Commit

Permalink
Removed dead code and allowed 0 as a number.
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahGale committed Nov 27, 2024
1 parent 4d34ad6 commit afbd1c2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions montepy/_singleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class SingletonGroup(ABC):

def __new__(cls, *args, **kwargs):
kwargs_t = tuple([(k, v) for k, v in kwargs.items()])
if len(args + kwargs_t) == 0:
return super().__new__(cls)
try:
return cls._instances[args + kwargs_t]
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion montepy/data_inputs/data_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def __enforce_name(self, input):
if self._has_number():
try:
num = classifier.number.value
assert num > 0
assert num >= 0
except (AttributeError, AssertionError) as e:
raise MalformedInputError(
input,
Expand Down
2 changes: 0 additions & 2 deletions montepy/input_parser/material_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ def mat_data(self, p):
datum = p.mat_datum
if isinstance(datum, tuple):
ret.append_nuclide(datum)
elif isinstance(datum, list):
[ret.append_nuclide(n) for n in datum]
elif isinstance(datum, syntax_node.ListNode):
[ret.append_nuclide(n) for n in self._convert_to_isotope(datum)]
else:
Expand Down

0 comments on commit afbd1c2

Please sign in to comment.