Switch WQP default profile from legacy to WQX3.0#230
Conversation
Change all WQP functions from legacy=True to legacy=False so that get_results, what_sites, and what_activities route to WQX3.0 endpoints by default. Functions without a WQX3.0 equivalent now emit a UserWarning instead of silently returning legacy data. legacy=True still works but triggers a DeprecationWarning. Closes DOI-USGS#121. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolved conflicts in wqp.py: PR 230's intent (default legacy=False) already preserved in function signatures. Upstream/main refactored the inline UserWarning blocks for WQX3.0-unavailable services into the _legacy_only_url() helper; took upstream's version everywhere. All 12 wqp tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Closing this PR after auditing the R R's position (verified against the local clone)R defaults all WQP functions to legacy and treats WQX3 as opt-in beta:
What this PR proposed vs. what R does
The "WQX3 is no longer experimental" claim is inconsistent with what the R team — and per them, the WQP team itself — currently believe. RecommendationHold off on flipping the default until the WQP team marks WQX3 GA. R will likely flip first; we mirror them when it happens. Meanwhile, Possible small follow-up (separate)
|
Closes #121
Summary
legacy=Truetolegacy=Falseget_results,what_sites, andwhat_activitiesnow route to WQX3.0 endpoints by defaultwhat_organizations,what_projects,what_detection_limits,what_habitat_metrics,what_project_weights,what_activity_metrics) emit aUserWarningwhen called with the defaultlegacy=False, making it clear the user is getting legacy datalegacy=Truestill works but triggers aDeprecationWarningdirecting users to remove it_warn_wqx3_use()function (WQX3.0 is no longer experimental)Behavior change demo (live API)
Test plan
test_what_sitesandtest_what_activitiesto mock WQX3.0 URLstest_get_results_legacyto verifylegacy=TruetriggersDeprecationWarningget_resultscall routes to/wqx3/Result/searchand returns data;legacy=Trueroutes to/data/Result/Searchand emits the expectedDeprecationWarning.