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

Add get() to Settings #396

Merged
merged 5 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,4 @@ Gröhl, Janek, Kris K. Dreher, Melanie Schellenberg, Tom Rix, Niklas Holzwarth,

This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No. [101002198]).

![ERC](docs/source/images/LOGO_ERC-FLAG_EU_.jpg "ERC")
![ERC](https://github.com/IMSY-DKFZ/simpa/raw/main/docs/source/images/LOGO_ERC-FLAG_EU_.jpg "ERC")
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]
faberno marked this conversation as resolved.
Show resolved Hide resolved
return default

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