Code Duplication    Length = 10-11 lines in 2 locations

mutis/astro.py 2 locations

@@ 352-362 (lines=11) @@
349
            # get points iside current rectangle for current date
350
            rect_idx = (x1 < x) & ( x < x2) & (y1 < y) & ( y < y2) & idx 
351
352
            if np.sum(rect_idx) > 0:
353
                textbox.set_val(label)
354
                selected_knot = label
355
                selected_x = x[rect_idx].ravel()
356
                selected_y = y[rect_idx].ravel()
357
                selected_ind = knots[label].index[rect_idx]
358
                log.debug(f'Selected {label} points  rect_idx {rect_idx} x {x[rect_idx]}, y {y[rect_idx]} with indices {selected_ind}')
359
                textbox.begin_typing(None)
360
                break # if we find selected components in this epoch, continue with renaming
361
            else:
362
                pass
363
364
        update(slider_date.val)
365
@@ 592-601 (lines=10) @@
589
            x = np.array(years)
590
            y = np.array(fluxes)
591
592
            if np.sum(rect_idx) > 0:
593
                textbox.set_val(label)
594
                selected_knot = label
595
                selected_x = x[rect_idx].ravel()
596
                selected_y = y[rect_idx].ravel()
597
                selected_ind = knots[label].index[rect_idx]
598
                log.debug(f'Selected {label} points  rect_idx {rect_idx} date {x[rect_idx]}, flux {y[rect_idx]} with indices {selected_ind}')
599
                break # if we find selected components in this epoch, continue with renaming
600
            else:
601
                pass
602
603
        update()
604