update_neighbours
Boundary Adjustment Utilities
Functions for adjusting segment boundaries when neighboring segments are updated.
update_next_segment
update_next_segment(i, new_end, segments, segments_refined)
Adjusts the start of the next segment if it overlaps with the updated end.
Skips adjustment if the next segment is classified as 'abrupt', preserving its precision.
Parameters:
-
(iint) –Index of the current segment.
-
(new_endstr) –Updated end date of the current segment.
-
(segmentslist) –Original segment list.
-
(segments_refinedlist) –Refined segment list being modified.
Source code in pytrendy/post_processing/segments_refine/update_neighbours.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
update_prev_segment
update_prev_segment(i, new_start, segments, segments_refined)
Adjusts the end of the previous segment if it overlaps with the updated start.
Skips adjustment if the previous segment is classified as 'abrupt' or 'noise', preserving its precision.
Parameters:
-
(iint) –Index of the current segment.
-
(new_startstr) –Updated start date of the current segment.
-
(segmentslist) –Original segment list.
-
(segments_refinedlist) –Refined segment list being modified.
Source code in pytrendy/post_processing/segments_refine/update_neighbours.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |