Repository navigation
feat(trends): add fixed window water level trend layers 5 10 20 years (DIE-400) - #154
Conversation
Every trend is now tested on one value per calendar month: the median for depth-to-water, the mean for analytes. A single analyte flag picks both the aggregate and the method text, so they always agree. Trend collections can be limited to a trailing window of whole calendar months before the run month, using one run date per Dagster run. Features carry trend_period, window_years, window_start/window_end and an insufficient_reason when the minimum-data rule fails.
Add nm_waterlevel_trends_5yr/_10yr/_20yr. nm_waterlevel_trends is relabeled as the full-record (overall) trend; its id is unchanged. Analyte trend abstracts now describe the monthly mean.
|
Your pull request is automatically being deployed to Dagster Cloud.
|
jacob-a-brown
left a comment
There was a problem hiding this comment.
Overall I think it looks! I made one comment about slope in feet per year. If you agree with my comment then the same update needs to be applied elsewhere. I just didn't want to litter this PR with the same comment throughout.
| with the Mann-Kendall test (alpha = 0.05), with the rate given as a Theil-Sen | ||
| slope in feet per year. Wells need at least 10 monthly values, or at least 4 |
There was a problem hiding this comment.
if this is tested on monthly data wouldn't it be slope per month?
There was a problem hiding this comment.
The series is now aggregated to monthly, but I believe the Theil-Sen slope is fit against year timestamps slope_per_year = float(theilslopes(values, years)[0]), so the slopes are ft/yr.
jacob-a-brown
left a comment
There was a problem hiding this comment.
put a developer's note in here that the trend is per year because the values on the x axis were converted to decimal years. this is just for our own edification and understanding for our future selves and other developers who will read and maintain this code
Ok, added a note in |
Why
This PR addresses the following problem / context:
How
Implementation summary: the following was changed / added / removed:
nm_waterlevel_trends_5yr,_10yrand_20yr. Each window covers whole calendar months before the run month and is the same for every well.nm_waterlevel_trendsis retitled "Full Record" to mark it as the overall trend. Its id is unchanged.trend_period,window_years,window_start,window_end,insufficient_reason.Author Checklist
Reviewer Checklist
nm_waterlevel_trendsid while retitling it is acceptable.Notes
Any special considerations, known limitations, risks, workarounds, or follow-up work to note?