From 35fa3a36f0334aabda93972e9ba46a330f5e881f Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Sat, 10 Aug 2024 14:25:06 -0400 Subject: [PATCH 1/3] remove model as property since it is implemented as alias --- src/autora/state.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/autora/state.py b/src/autora/state.py index e6bf16f3..4e2257c2 100644 --- a/src/autora/state.py +++ b/src/autora/state.py @@ -1533,17 +1533,6 @@ def y(self) -> pd.DataFrame: return pd.DataFrame() return self.experiment_data[self.dv_names] - @property - def model(self): - if len(self.models) == 0: - 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") From e7d0a6c0c130f49b6f78ea226452b85663b6391d Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Sat, 10 Aug 2024 14:30:29 -0400 Subject: [PATCH 2/3] chore: make pre-commit run --- src/autora/state.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/autora/state.py b/src/autora/state.py index 4e2257c2..6667bb87 100644 --- a/src/autora/state.py +++ b/src/autora/state.py @@ -1534,7 +1534,6 @@ def y(self) -> pd.DataFrame: return self.experiment_data[self.dv_names] - X = TypeVar("X") Y = TypeVar("Y") XY = TypeVar("XY") From 06e7d703d44f7892a24ba56088aa39f2455285a1 Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Sat, 10 Aug 2024 14:43:11 -0400 Subject: [PATCH 3/3] fix: add back in property (needed), but setter is not needed --- src/autora/state.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/autora/state.py b/src/autora/state.py index 6667bb87..99c362f4 100644 --- a/src/autora/state.py +++ b/src/autora/state.py @@ -1533,6 +1533,14 @@ def y(self) -> pd.DataFrame: return pd.DataFrame() return self.experiment_data[self.dv_names] + @property + def model(self): + """Alias for the last model in the `models`.""" + try: + return self.models[-1] + except IndexError: + return None + X = TypeVar("X") Y = TypeVar("Y")