@@ -177,7 +177,7 @@ def metric_ids_to_metrics(self, metric_ids, metrics=None):
177
177
"""
178
178
if metrics is None :
179
179
metrics = self .metrics
180
- metrics = metrics [np .in1d (metrics ["metric_id" ], metric_ids )]
180
+ metrics = metrics [np .isin (metrics ["metric_id" ], metric_ids )]
181
181
return metrics
182
182
183
183
def metrics_to_metric_ids (self , metrics ):
@@ -267,7 +267,7 @@ def metrics_with_plot_type(self, plot_type="SkyMap", metrics=None):
267
267
if metrics is None :
268
268
metrics = self .metrics
269
269
# Identify the plots with the right plot_type, get their IDs.
270
- plot_match = self .plots [np .in1d (self .plots ["plot_type" ], plot_types )]
270
+ plot_match = self .plots [np .isin (self .plots ["plot_type" ], plot_types )]
271
271
# Convert those potentially matching metricIds to metrics,
272
272
# using the subset info.
273
273
metrics = self .metric_ids_to_metrics (plot_match ["metric_id" ], metrics )
@@ -295,7 +295,7 @@ def metrics_with_summary_stat(self, summary_stat_name="Identity", metrics=None):
295
295
if metrics is None :
296
296
metrics = self .metrics
297
297
# Identify the potentially matching stats.
298
- stats = self .stats [np .in1d (self .stats ["summary_metric" ], summary_stat_name )]
298
+ stats = self .stats [np .isin (self .stats ["summary_metric" ], summary_stat_name )]
299
299
# Identify the subset of relevant metrics.
300
300
metrics = self .metric_ids_to_metrics (stats ["metric_id" ], metrics )
301
301
# Re-sort metrics because at this point, probably want displayOrder
@@ -320,7 +320,7 @@ def metrics_with_stats(self, metrics=None):
320
320
if metrics is None :
321
321
metrics = self .metrics
322
322
# Identify metricIds which are also in stats.
323
- metrics = metrics [np .in1d (metrics ["metric_id" ], self .stats ["metric_id" ])]
323
+ metrics = metrics [np .isin (metrics ["metric_id" ], self .stats ["metric_id" ])]
324
324
metrics = self .sort_metrics (
325
325
metrics ,
326
326
order = [
@@ -548,7 +548,7 @@ def order_plots(self, sky_plots):
548
548
ordered_sky_plots .append (self .plot_dict (np .array ([sky_plot ])))
549
549
550
550
elif too_many_plots :
551
- metrics = self .metrics [np .in1d (self .metrics ["metric_id" ], sky_plots ["metric_id" ])]
551
+ metrics = self .metrics [np .isin (self .metrics ["metric_id" ], sky_plots ["metric_id" ])]
552
552
metrics = self .sort_metrics (metrics , order = ["display_order" ])
553
553
ordered_sky_plots = []
554
554
for m in metrics :
@@ -569,9 +569,9 @@ def get_sky_maps(self, metrics=None, plot_type="SkyMap"):
569
569
if metrics is None :
570
570
metrics = self .metrics
571
571
# Match the plots to the metrics required.
572
- plot_metric_match = self .plots [np .in1d (self .plots ["metric_id" ], metrics ["metric_id" ])]
572
+ plot_metric_match = self .plots [np .isin (self .plots ["metric_id" ], metrics ["metric_id" ])]
573
573
# Match the plot type (which could be a list)
574
- plot_match = plot_metric_match [np .in1d (plot_metric_match ["plot_type" ], plot_type )]
574
+ plot_match = plot_metric_match [np .isin (plot_metric_match ["plot_type" ], plot_type )]
575
575
return plot_match
576
576
577
577
# Set of methods to deal with summary stats.
@@ -631,7 +631,7 @@ def all_stat_names(self, metrics):
631
631
unique 'summary_metric' names in a default ordering.
632
632
"""
633
633
names = np .unique (
634
- self .stats ["summary_metric" ][np .in1d (self .stats ["metric_id" ], metrics ["metric_id" ])]
634
+ self .stats ["summary_metric" ][np .isin (self .stats ["metric_id" ], metrics ["metric_id" ])]
635
635
)
636
636
names = list (names )
637
637
# Add some default sorting.
0 commit comments