From deb3d69ecab8cd35e188db4cb7cfc085b197af30 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 18 Oct 2023 11:07:01 +0100 Subject: [PATCH] Ensure average_hit_number is sorted from low to high --- libgunshotmatch/consolidate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgunshotmatch/consolidate/__init__.py b/libgunshotmatch/consolidate/__init__.py index 596f160..cfa6f3e 100644 --- a/libgunshotmatch/consolidate/__init__.py +++ b/libgunshotmatch/consolidate/__init__.py @@ -634,7 +634,7 @@ def match_counter( ) # Sort consolidated hit list - hits_data = sorted(hits_data, key=lambda k: (len(k), k.match_factor, k.average_hit_number), reverse=True) + hits_data = sorted(hits_data, key=lambda k: (len(k), k.match_factor, -k.average_hit_number), reverse=True) # consolidated_peak = ConsolidatedPeak(rt_data, area_data, ms_data, peak_number=n, hits=hits_data, ms_comparison=ms_comp_data.loc[n]) consolidated_peak = ConsolidatedPeak( rt_data,