Code Duplication    Length = 10-11 lines in 2 locations

mutis/astro.py 2 locations

@@ 432-442 (lines=11) @@
429
            # get points iside current rectangle for current date
430
            rect_idx = (x1 < x) & ( x < x2) & (y1 < y) & ( y < y2) & idx 
431
432
            if np.sum(rect_idx) > 0:
433
                textbox.set_val(label)
434
                
435
                selected_knot = label
436
                selected_x = x[rect_idx].ravel()
437
                selected_y = y[rect_idx].ravel()
438
                selected_ind = knots[label].index[rect_idx]
439
                
440
                log.debug(f'Selected {label} points  rect_idx {rect_idx} x {x[rect_idx]}, y {y[rect_idx]} with indices {selected_ind}')
441
            
442
                textbox.begin_typing(None)
443
                break # if we find selected components in this epoch, continue with renaming
444
            else:
445
                pass
@@ 696-705 (lines=10) @@
693
            x = np.array(years)
694
            y = np.array(fluxes)
695
696
            if np.sum(rect_idx) > 0:
697
                textbox.set_val(label)
698
                selected_knot = label
699
                selected_x = x[rect_idx].ravel()
700
                selected_y = y[rect_idx].ravel()
701
                selected_ind = knots[label].index[rect_idx]
702
                log.debug(f'Selected {label} points  rect_idx {rect_idx} date {x[rect_idx]}, flux {y[rect_idx]} with indices {selected_ind}')
703
                break # if we find selected components in this epoch, continue with renaming
704
            else:
705
                pass
706
707
        # print epoch of selected points:
708
        if selected_knot is not None: