Skip to content

Commit

Permalink
Improve code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
stanmart committed Feb 1, 2024
1 parent 137d9fb commit 4af7de6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/glum/_glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4af7de6

Please sign in to comment.