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
@@ 693-702 (lines=10) @@
690
            x = np.array(years)
691
            y = np.array(fluxes)
692
693
            if np.sum(rect_idx) > 0:
694
                textbox.set_val(label)
695
                selected_knot = label
696
                selected_x = x[rect_idx].ravel()
697
                selected_y = y[rect_idx].ravel()
698
                selected_ind = knots[label].index[rect_idx]
699
                log.debug(f'Selected {label} points  rect_idx {rect_idx} date {x[rect_idx]}, flux {y[rect_idx]} with indices {selected_ind}')
700
                break # if we find selected components in this epoch, continue with renaming
701
            else:
702
                pass
703
704
        # print epoch of selected points:
705
        if selected_knot is not None: