Skip to content

Commit

Permalink
Merge pull request #1247 from DavidT3/bug/corePntSourceClusterSampleI…
Browse files Browse the repository at this point in the history
…ssue

Fixing a mistake in type checking in ClusterSample
  • Loading branch information
DavidT3 authored Nov 5, 2024
2 parents fd1394f + a9425ca commit a9a36fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xga/samples/extended.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ def __init__(self, ra: np.ndarray, dec: np.ndarray, redshift: np.ndarray, name:
from xga.sas import evselect_image, eexpmap, emosaic

# We do a quick check on the length of certain arguments (if they are not just a single value)
if include_core_pnt_srcs is not bool and isinstance(include_core_pnt_srcs, (list, np.ndarray)):
if type(include_core_pnt_srcs) != bool and isinstance(include_core_pnt_srcs, (list, np.ndarray)):
if len(include_core_pnt_srcs) != len(ra):
raise ValueError("If passing a non-scalar value for 'include_core_pnt_srcs', there must be an "
"entry for each source.")
elif any([en is not bool for en in include_core_pnt_srcs]):
elif any([type(en) != bool for en in include_core_pnt_srcs]):
raise TypeError("You must pass a bool or list/array of bools to the 'include_core_pnt_srcs' argument.")
elif include_core_pnt_srcs is not bool:
elif type(include_core_pnt_srcs) != bool:
# If we get to this point then someone has passed something illegal
raise TypeError("You must pass a bool or list/array of bools to the 'include_core_pnt_srcs' argument.")

Expand Down

0 comments on commit a9a36fc

Please sign in to comment.