You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve robustness of reference year range handling
Added input validation to ensure all year variables are integers and within a valid order.
Normalized start/end pairs so reversed inputs (e.g. y1 > y2, ref_start_yr > ref_final_yr) are automatically swapped.
Recorded the original custom reference range (ref_y1, ref_y2) and clamped it to the available reference window for safe fallback.
Refined the adjustment logic so:
If availability fully covers the analysis period, use [y1, y2].
Otherwise, prefer the clamped custom range and trim only if it extends beyond the analysis window.
If custom and analysis don’t overlap, fall back to the overlap of availability ∩ analysis.
If no overlap exists, fall back to the clamped custom, and finally the full available window.
Ensured final ref_y1 ≤ ref_y2 and applied zero-padding formatting once at the end.
0 commit comments