diff --git a/src/autora/state.py b/src/autora/state.py index e6bf16f3..99c362f4 100644 --- a/src/autora/state.py +++ b/src/autora/state.py @@ -1535,15 +1535,11 @@ def y(self) -> pd.DataFrame: @property def model(self): - if len(self.models) == 0: + """Alias for the last model in the `models`.""" + try: + return self.models[-1] + except IndexError: return None - # The property to access the backing field - return self.models[-1] - - @model.setter - def model(self, value): - # Control the setting behavior - self.models.append(value) X = TypeVar("X")