Commit 18f831f
Deprecate remaining active nwis functions ahead of 2027-05-06 removal (#271)
The module-level "use waterdata instead" warning has been firing on
import for a while; this PR makes the migration guidance actionable
by emitting a per-function DeprecationWarning that names the specific
waterdata replacement the user should switch to.
Every active nwis function has a waterdata replacement, so all nine of them are deprecated here:
nwis.get_dv -> waterdata.get_daily()
nwis.get_iv -> waterdata.get_continuous()
nwis.get_info -> waterdata.get_monitoring_locations()
nwis.what_sites -> waterdata.get_monitoring_locations()
nwis.get_stats -> waterdata.get_stats_por() /
waterdata.get_stats_date_range()
nwis.get_discharge_peaks -> waterdata.get_peaks()
nwis.get_ratings -> waterdata.get_ratings()
nwis.get_record -> the appropriate waterdata.get_*()
nwis.query_waterdata -> a high-level waterdata.get_*() helper
nwis.query_waterservices -> a high-level waterdata.get_*() helper
(get_qwdata, get_discharge_measurements, get_gwlevels, get_pmcodes,
and get_water_use are already defunct and raise NameError.)
Implementation follows the nadp deprecation template (#243): a small
_REPLACEMENTS dict + a _warn_deprecated(func_name) helper called as
the first line of each public function. stacklevel=3 makes the
warning point at the caller's code, not the helper's frame.
Removal date is set to 2027-05-06. Maintainer can adjust if desired.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fca3d6c commit 18f831f
3 files changed
Lines changed: 157 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 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 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
56 | 113 | | |
57 | 114 | | |
58 | 115 | | |
| |||
163 | 220 | | |
164 | 221 | | |
165 | 222 | | |
| 223 | + | |
166 | 224 | | |
167 | 225 | | |
168 | 226 | | |
| |||
240 | 298 | | |
241 | 299 | | |
242 | 300 | | |
| 301 | + | |
243 | 302 | | |
244 | 303 | | |
245 | 304 | | |
| |||
301 | 360 | | |
302 | 361 | | |
303 | 362 | | |
| 363 | + | |
304 | 364 | | |
305 | 365 | | |
306 | 366 | | |
| |||
346 | 406 | | |
347 | 407 | | |
348 | 408 | | |
| 409 | + | |
349 | 410 | | |
350 | 411 | | |
351 | 412 | | |
| |||
409 | 470 | | |
410 | 471 | | |
411 | 472 | | |
| 473 | + | |
412 | 474 | | |
413 | 475 | | |
414 | 476 | | |
| |||
480 | 542 | | |
481 | 543 | | |
482 | 544 | | |
| 545 | + | |
483 | 546 | | |
484 | 547 | | |
485 | 548 | | |
| |||
595 | 658 | | |
596 | 659 | | |
597 | 660 | | |
| 661 | + | |
598 | 662 | | |
599 | 663 | | |
600 | 664 | | |
| |||
678 | 742 | | |
679 | 743 | | |
680 | 744 | | |
| 745 | + | |
681 | 746 | | |
682 | 747 | | |
683 | 748 | | |
| |||
735 | 800 | | |
736 | 801 | | |
737 | 802 | | |
| 803 | + | |
738 | 804 | | |
739 | 805 | | |
740 | 806 | | |
| |||
767 | 833 | | |
768 | 834 | | |
769 | 835 | | |
770 | | - | |
771 | 836 | | |
772 | 837 | | |
773 | 838 | | |
774 | 839 | | |
775 | 840 | | |
776 | 841 | | |
777 | 842 | | |
| 843 | + | |
778 | 844 | | |
779 | 845 | | |
780 | 846 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
121 | 209 | | |
122 | 210 | | |
123 | 211 | | |
| |||
0 commit comments