Skip to content

Commit

Permalink
Coordinates and timestamp updated to valid items. fixes #178
Browse files Browse the repository at this point in the history
  • Loading branch information
kryuchkd authored and orion-junkins committed Dec 4, 2023
2 parents c645a36 + 529cdbb commit 2acb3f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions demos/demo_aws_weather_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rlf.forecasting.data_fetching_utilities.weather_provider.aws_weather_provider import AWSWeatherProvider

# Declare coordinates
coordinates = [Coordinate(lon=-120.75, lat=44.25), Coordinate(lon=-121.0, lat=44.5)]
coordinates = [Coordinate(lon=-122.4, lat=45.8), Coordinate(lon=-122.3, lat=45.8)]

# Create an AWSDispatcher
aws_dispatcher = AWSDispatcher(bucket_name="all-weather-data", directory_name="open-meteo")
Expand All @@ -35,7 +35,7 @@

# %% ------------------------------
# Supply a timestamp to the AWSWeatherProvider
weather_provider.set_timestamp("22-12-04_09-09")
weather_provider.set_timestamp("23-09-15_12-00")

# Fetch 'current' data logged at the given timestamp
datums = weather_provider.fetch_current()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def test_get_historical_columns_subset(fake_coordinate, fake_start_date, fake_en
adapter = OpenMeteoAdapter()
response = adapter.get_historical(coordinate=fake_coordinate, start_date=fake_start_date, end_date=fake_end_date, columns=["temperature_2m"])
assert response.status_code == 200
assert pytest.approx(110.0) == response.data["longitude"]
assert pytest.approx(30.0) == response.data["latitude"]
assert pytest.approx(110.0, rel=1e-2) == response.data["longitude"]
assert pytest.approx(30.0, rel=1e-2) == response.data["latitude"]
assert len(response.data["hourly"]) == 2 # Time column and 'temperature_2m' column
assert len(response.data["hourly_units"]) == 2

Expand Down

0 comments on commit 2acb3f2

Please sign in to comment.