Skip to content

Commit

Permalink
added .get() to settings class
Browse files Browse the repository at this point in the history
  • Loading branch information
faberno committed Nov 7, 2024
1 parent 6949c2c commit 63b09d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions simpa/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ def __delitem__(self, key):
except KeyError:
raise KeyError("The key '{}' is not in the Settings dictionary".format(key)) from None

def get(self, key, default=None):
if self.__contains__(key):
return self[key]
return default

def get_volume_dimensions_voxels(self):
"""
returns: tuple
Expand Down

0 comments on commit 63b09d7

Please sign in to comment.