Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
conbrad committed Oct 31, 2023
1 parent f71c153 commit ea38419
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 19 deletions.
4 changes: 2 additions & 2 deletions api/app/tests/fixtures/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def guess_filename(self, url: str, params: dict):
if params:
filename = filename + '_'
for key, value in params.items():
if type(value) == str:
if type(value) == str: # noqa: E721
value = value.replace(' ', '_')
filename = '{}_{}_{}'.format(filename, key, value)
filename = filename[:200] + '.json'
Expand All @@ -110,7 +110,7 @@ def lookup_fixture_filename(self,
lookup = nested_defaultdict(lookup)
fixture = lookup[url][verb][str(params)][str(data)]

if type(fixture) is not str:
if type(fixture) is not str: # noqa: E721
if config.get('AUTO_MAKE_FIXTURES'):
logger.warning('inserting fixture into lookup')
lookup[url][verb][str(params)][str(data)] = self.guess_filename(url, params)
Expand Down
4 changes: 0 additions & 4 deletions api/app/tests/weather_models/test_env_canada_gdps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import pytest
import requests
from sqlalchemy.orm import Session
from shapely import wkt
from app.jobs import env_canada
from app.jobs import common_model_fetchers
import app.utils.time as time_utils
Expand Down Expand Up @@ -48,9 +47,6 @@ def mock_get_actuals_left_outer_join_with_predictions(monkeypatch):
@pytest.fixture()
def mock_database(monkeypatch):
""" Mocked out database queries """
geom = ("POLYGON ((-120.525 50.77500000000001, -120.375 50.77500000000001,-120.375 50.62500000000001,"
" -120.525 50.62500000000001, -120.525 50.77500000000001))")
shape = wkt.loads(geom)
gdps_url = ('https://dd.weather.gc.ca/model_gem_global/15km/grib2/lat_lon/00/000/'
'CMC_glb_TMP_TGL_2_latlon.15x.15_2020052100_P000.grib2')
gdps_processed_model_run = ProcessedModelRunUrl(url=gdps_url)
Expand Down
5 changes: 0 additions & 5 deletions api/app/tests/weather_models/test_env_canada_hrdps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing import Optional
import pytest
import requests
import shapely
import datetime
from sqlalchemy.orm import Session
from pytest_mock import MockerFixture
Expand All @@ -29,10 +28,6 @@
@pytest.fixture()
def mock_database(monkeypatch):
""" Mocked out database queries """
geom = ("POLYGON ((-120.525 50.77500000000001, -120.375 50.77500000000001,-120.375 50.62500000000001,"
" -120.525 50.62500000000001, -120.525 50.77500000000001))")
shape = shapely.wkt.loads(geom)

hrdps_url = 'https://dd.weather.gc.ca/model_hrdps/continental/2.5km/' \
'00/001/20200521T00Z_MSC_HRDPS_RH_AGL-2m_RLatLon0.0225_PT001H.grib2'
hrdps_processed_model_run = ProcessedModelRunUrl(url=hrdps_url)
Expand Down
5 changes: 0 additions & 5 deletions api/app/tests/weather_models/test_env_canada_rdps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest
import requests
from typing import Optional
from shapely import wkt
from sqlalchemy.orm import Session
import app.utils.time as time_utils
import app.weather_models.process_grib
Expand All @@ -24,10 +23,6 @@
@pytest.fixture()
def mock_database(monkeypatch):
""" Mocked out database queries """
geom = ("POLYGON ((-120.525 50.77500000000001, -120.375 50.77500000000001,-120.375 50.62500000000001,"
" -120.525 50.62500000000001, -120.525 50.77500000000001))")
shape = wkt.loads(geom)

rdps_url = ('https://dd.weather.gc.ca/model_gem_regional/10km/grib2/00/034/'
'CMC_reg_RH_TGL_2_ps10km_2020052100_P034.grib2')
rdps_processed_model_run = ProcessedModelRunUrl(url=rdps_url)
Expand Down
2 changes: 1 addition & 1 deletion api/app/tests/wildfire_one/test_schema_parsers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import List
from app.schemas.morecast_v2 import StationDailyFromWF1, WeatherDeterminate, WeatherIndeterminate
from app.schemas.morecast_v2 import StationDailyFromWF1, WeatherDeterminate
from app.wildfire_one.schema_parsers import (WF1RecordTypeEnum, parse_noon_forecast,
parse_hourly_actual,
unique_weather_stations_mapper, weather_indeterminate_list_mapper,
Expand Down
2 changes: 0 additions & 2 deletions api/app/weather_models/precip_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import logging
import math
from datetime import datetime
from typing import List
from app.weather_models.linear_model import LinearModel
from app.weather_models.regression_model import RegressionModelBase

Expand Down

0 comments on commit ea38419

Please sign in to comment.