Skip to content

Commit

Permalink
runtime error if you attempt to a duplicate to cfg is not default
Browse files Browse the repository at this point in the history
  • Loading branch information
DLWoodruff committed Oct 3, 2024
1 parent 3166c40 commit fef6943
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mpisppy/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ def add_and_assign(self, name, description, domain, default, value, complain=Tru
"""
if name in self:
if complain:
print(f"Duplicate {name=} will not be added to cfg to assign {value=}")
# raise RuntimeError(f"Trying to add duplicate {name} to self.")
raise RuntimeError(f"Trying to add duplicate {name=} to cfg {value=}")
else:
self.add_to_config(name, description, domain, default, argparse=False)
self[name] = value
Expand Down

0 comments on commit fef6943

Please sign in to comment.