Skip to content

Conversation

@micah-prime
Copy link
Contributor

No description provided.

@micah-prime micah-prime mentioned this pull request Jul 3, 2025
4 tasks
@micah-prime micah-prime marked this pull request as ready for review July 8, 2025 19:35
@micah-prime micah-prime requested review from Copilot and micahjohnson150 and removed request for micahjohnson150 July 8, 2025 19:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_mocks and a read_json helper
  • 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

# 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:
Copy link

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants