Code Duplication    Length = 10-11 lines in 2 locations

mutis/astro.py 2 locations

@@ 366-376 (lines=11) @@
363
            # get points iside current rectangle for current date
364
            rect_idx = (x1 < x) & ( x < x2) & (y1 < y) & ( y < y2) & idx 
365
366
            if np.sum(rect_idx) > 0:
367
                textbox.set_val(label)
368
                selected_knot = label
369
                selected_x = x[rect_idx].ravel()
370
                selected_y = y[rect_idx].ravel()
371
                selected_ind = knots[label].index[rect_idx]
372
                log.debug(f'Selected {label} points  rect_idx {rect_idx} x {x[rect_idx]}, y {y[rect_idx]} with indices {selected_ind}')
373
                textbox.begin_typing(None)
374
                break # if we find selected components in this epoch, continue with renaming
375
            else:
376
                pass
377
378
        update(slider_date.val)
379
@@ 603-612 (lines=10) @@
600
            x = np.array(years)
601
            y = np.array(fluxes)
602
603
            if np.sum(rect_idx) > 0:
604
                textbox.set_val(label)
605
                selected_knot = label
606
                selected_x = x[rect_idx].ravel()
607
                selected_y = y[rect_idx].ravel()
608
                selected_ind = knots[label].index[rect_idx]
609
                log.debug(f'Selected {label} points  rect_idx {rect_idx} date {x[rect_idx]}, flux {y[rect_idx]} with indices {selected_ind}')
610
                break # if we find selected components in this epoch, continue with renaming
611
            else:
612
                pass
613
614
        update()
615