Skip to content
Open
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
12 changes: 7 additions & 5 deletions LION/models/LIONmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
# =============================================================================


#%% This is a base class for LION models.
# %% This is a base class for LION models.
#
# All classes must derive from this one.
# It definest a bunch of auxiliary functions
#

#%% Imports
# %% Imports

# You will want to import LIONParameter, as all models must save and use Parameters.
from enum import Enum
Expand Down Expand Up @@ -49,7 +49,7 @@
class ModelInputType(int, Enum):
SINOGRAM = 0
NOISY_RECON = 1
IMAGE = 1
IMAGE = 2


# Class for Model parameters that should be true for all models
Expand Down Expand Up @@ -83,8 +83,10 @@ def __init__(
f"Expected geometry to be of type Geometry or None, but got {type(geometry).__name__}. "
"If you passed positional arguments to the model, please verify their order matches the model's __init__ signature."
)

if model_parameters is not None and not isinstance(model_parameters, LIONModelParameter):

if model_parameters is not None and not isinstance(
model_parameters, LIONModelParameter
):
raise TypeError(
f"Expected model_parameters to be of type LIONModelParameter or None, but got {type(model_parameters).__name__}. "
"Ensure you are not accidentally passing a Geometry object as model_parameters."
Expand Down
Loading