From 4af7de69106155161407dbac048b419619cdcb89 Mon Sep 17 00:00:00 2001 From: Martin Stancsics Date: Thu, 1 Feb 2024 14:51:01 +0100 Subject: [PATCH] Improve code readability --- src/glum/_glm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/glum/_glm.py b/src/glum/_glm.py index 9c9fb53d..e490550d 100644 --- a/src/glum/_glm.py +++ b/src/glum/_glm.py @@ -940,7 +940,9 @@ def _set_up_for_fit(self, y: np.ndarray) -> None: elif (self.lower_bounds is None) and (self.upper_bounds is None): if np.all(np.asarray(self.l1_ratio) == 0): self._solver = "irls-ls" - elif getattr(self, "alpha", 1) == 0 and not self.alpha_search: + elif ( + hasattr(self, "alpha") and self.alpha == 0 and not self.alpha_search + ): self._solver = "irls-ls" else: self._solver = "irls-cd"