Skip to content

Commit bd96388

Browse files
committed
np.in1d --> np.isin
1 parent cba6688 commit bd96388

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

halotools/empirical_models/phase_space_models/subhalo_based_models/subhalo_selection_kernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def calculate_satellite_selection_mask(subhalo_hostids, satellite_occupations, h
119119
those rare subhalos with no matching host halo
120120
(this situation occurs in <0.1% for typical Rockstar catalogs).
121121
122-
>>> matched_mask = np.in1d(halocat.halo_table['halo_hostid'], halocat.halo_table['halo_id'])
122+
>>> matched_mask = np.isin(halocat.halo_table['halo_hostid'], halocat.halo_table['halo_id'])
123123
>>> halos = halocat.halo_table[matched_mask]
124124
125125
Now we will sort the catalog by the ``sorting_keys`` list.

halotools/utils/array_indexing_manipulations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def calculate_entry_multiplicity(sorted_repeated_hostids, unique_possible_hostid
337337

338338
unique_appearances_of_hostid, unique_entry_multiplicity = (
339339
np.unique(sorted_repeated_hostids, return_counts=True))
340-
hostid_has_match = np.in1d(unique_possible_hostids, unique_appearances_of_hostid,
340+
hostid_has_match = np.isin(unique_possible_hostids, unique_appearances_of_hostid,
341341
assume_unique=True)
342342

343343
entry_multiplicity = np.zeros_like(unique_possible_hostids)

halotools/utils/crossmatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def crossmatch(x, y, skip_bounds_checking=False):
162162
unique_xvals, counts = np.unique(x_sorted, return_counts=True)
163163

164164
# Determine which of the unique x values has a match in y
165-
unique_xval_has_match = np.in1d(unique_xvals, y_sorted, assume_unique=True)
165+
unique_xval_has_match = np.isin(unique_xvals, y_sorted, assume_unique=True)
166166

167167
# Create a boolean array with True for each value in x with a match, otherwise False
168168
idx_x = np.repeat(unique_xval_has_match, counts)

0 commit comments

Comments
 (0)