Skip to content

Commit

Permalink
use sfms uploads first
Browse files Browse the repository at this point in the history
  • Loading branch information
brettedw committed Oct 24, 2024
1 parent 9a001c9 commit 4cd212d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api/app/sfms/date_range_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from app.utils.geospatial import GDALResamplingMethod, export_to_geotiff
from app.utils.s3 import all_objects_exist, get_client, set_s3_gdal_config
from app.utils.time import get_utc_now
from app.weather_models.rdps_filename_marshaller import model_run_for_hour

Check warning on line 18 in api/app/sfms/date_range_processor.py

View check run for this annotation

Codecov / codecov/patch

api/app/sfms/date_range_processor.py#L11-L18

Added lines #L11 - L18 were not covered by tests

logger = logging.getLogger(__name__)

Check warning on line 20 in api/app/sfms/date_range_processor.py

View check run for this annotation

Codecov / codecov/patch

api/app/sfms/date_range_processor.py#L20

Added line #L20 was not covered by tests

Expand Down Expand Up @@ -44,16 +45,17 @@ async def process_bui(self):
weather_keys_exist = await all_objects_exist(temp_key, rh_key, precip_key)

Check warning on line 45 in api/app/sfms/date_range_processor.py

View check run for this annotation

Codecov / codecov/patch

api/app/sfms/date_range_processor.py#L45

Added line #L45 was not covered by tests

if not weather_keys_exist:
logging.warning(f"No weather keys found for {model_run_for_hour(self.start_datetime.hour):02} model run")
break

Check warning on line 49 in api/app/sfms/date_range_processor.py

View check run for this annotation

Codecov / codecov/patch

api/app/sfms/date_range_processor.py#L47-L49

Added lines #L47 - L49 were not covered by tests

dc_key = raster_addresser.get_calculated_index_key(previous_fwi_datetime, FWIParameter.DC)
dmc_key = raster_addresser.get_calculated_index_key(previous_fwi_datetime, FWIParameter.DMC)
dc_key = raster_addresser.get_uploaded_index_key(previous_fwi_datetime, FWIParameter.DC)
dmc_key = raster_addresser.get_uploaded_index_key(previous_fwi_datetime, FWIParameter.DMC)

Check warning on line 52 in api/app/sfms/date_range_processor.py

View check run for this annotation

Codecov / codecov/patch

api/app/sfms/date_range_processor.py#L51-L52

Added lines #L51 - L52 were not covered by tests

fwi_keys_exist = await all_objects_exist(dc_key, dmc_key)

Check warning on line 54 in api/app/sfms/date_range_processor.py

View check run for this annotation

Codecov / codecov/patch

api/app/sfms/date_range_processor.py#L54

Added line #L54 was not covered by tests

if not fwi_keys_exist:
dc_key = raster_addresser.get_uploaded_index_key(previous_fwi_datetime, FWIParameter.DC)
dmc_key = raster_addresser.get_uploaded_index_key(previous_fwi_datetime, FWIParameter.DMC)
dc_key = raster_addresser.get_calculated_index_key(previous_fwi_datetime, FWIParameter.DC)
dmc_key = raster_addresser.get_calculated_index_key(previous_fwi_datetime, FWIParameter.DMC)

Check warning on line 58 in api/app/sfms/date_range_processor.py

View check run for this annotation

Codecov / codecov/patch

api/app/sfms/date_range_processor.py#L56-L58

Added lines #L56 - L58 were not covered by tests

fwi_keys_exist = await all_objects_exist(dc_key, dmc_key)

Check warning on line 60 in api/app/sfms/date_range_processor.py

View check run for this annotation

Codecov / codecov/patch

api/app/sfms/date_range_processor.py#L60

Added line #L60 was not covered by tests

Expand Down

0 comments on commit 4cd212d

Please sign in to comment.