File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export interface OptimizePeaksOptions {
1313 */
1414 shape ?: Shape1D ;
1515 /**
16- * Number of times the width determining if the peaks have to be grouped and therefore optimized together
16+ * Number of times we should multiply the width determining if the peaks have to be grouped and therefore optimized together
1717 * @default 1
1818 */
1919 groupingFactor ?: number ;
Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ export function optimizePeaksWithLogs(
6262 ? data . y . subarray ( fromIndex , toIndex )
6363 : data . y . slice ( fromIndex , toIndex ) ;
6464
65+ const log = {
66+ range : { from, to } ,
67+ parameters : optimization ,
68+ groupSize : peakGroup . length ,
69+ time : Date . now ( ) - start ,
70+ } ;
71+
6572 if ( x . length > 5 ) {
6673 const {
6774 iterations,
@@ -81,20 +88,17 @@ export function optimizePeaksWithLogs(
8188 } ) ;
8289 }
8390 logs . push ( {
91+ ...log ,
8492 iterations,
8593 error,
86- parameters : optimization ,
8794 message : 'optimization successful' ,
88- groupSize : peakGroup . length ,
89- time : `${ Date . now ( ) - start } ms` ,
9095 } ) ;
9196 } else {
9297 results = results . concat ( peaks ) ;
9398 logs . push ( {
99+ ...log ,
94100 iterations : 0 ,
95101 message : 'x length too small for optimization' ,
96- groupSize : peakGroup . length ,
97- time : `${ Date . now ( ) - start } ms` ,
98102 } ) ;
99103 }
100104 } ) ;
You can’t perform that action at this time.
0 commit comments