Open
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR replaces the old SOAP/Zeep-based SNOTEL client with a REST-based implementation using requests, updates tests to use JSON fixtures and requests.get mocks, and reorganizes the sensor/variable modules and import paths accordingly.
- Switch SNOTEL client from Zeep/SOAP to REST API (
requests) - Add JSON fixtures under
tests/data/snotel_mocksand aread_jsonhelper - Refactor variable definitions and module imports; remove Zeep dependency
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils.py | Add read_json helper to load JSON fixtures |
| tests/test_snotel.py | Refactor tests to mock requests.get and drive from JSON files |
| tests/data/snotel_mocks/semimonthly_swe.json | New semimonthly SWE mock |
| tests/data/snotel_mocks/hourly_swe.json | New hourly SWE mock |
| tests/data/snotel_mocks/hourly_soil.json | New hourly soil-temperature mock |
| tests/data/snotel_mocks/hourly_precip.json | New hourly precipitation mock |
| tests/data/snotel_mocks/daily.json | New daily data mock |
| setup.py | Remove zeep dependency |
| metloom/variables.py | Simplify variable exports; import new SnotelVariables |
| metloom/sensors.py | Introduce shared SensorDescription and VariableBase |
| metloom/pointdata/base.py | Update imports to use sensors.py |
| metloom/pointdata/snotel/snotel_client.py | Implement REST-based SNOTEL client with requests |
| metloom/pointdata/snotel/snotel.py | Refactor SnotelPointData to use REST endpoints and cached metadata |
metloom/pointdata/snotel/snotel.py
Outdated
| # if we wanted to. We would need to be careful of the meas height | ||
| if len(data) == 1: | ||
| result_map[variable] = data[0] | ||
| elif len(data["data"]) > 1: |
There was a problem hiding this comment.
The code checks len(data["data"]) but data is a list, so data["data"] will raise a TypeError. It should check len(data) > 1 to detect multiple results.
Suggested change
| elif len(data["data"]) > 1: | |
| elif len(data) > 1: |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.