Skip to content

Commit

Permalink
Fixed bug with random_state type check. (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfcrenshaw committed Mar 20, 2024
1 parent 215620d commit 100e603
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions photerr/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,7 @@ def __call__(
pd.DataFrame
"""
# set the rng
if isinstance(random_state, np.random.Generator):
rng = random_state
elif isinstance(random_state, int) or random_state is None:
rng = np.random.default_rng(random_state)
else:
raise TypeError(
"random_state must be a numpy random generator, an int, or None."
)
rng = np.random.default_rng(random_state)

# get the bands we will calculate errors for
bands = [band for band in catalog.columns if band in self._bands]
Expand Down

0 comments on commit 100e603

Please sign in to comment.