Skip to content

Commit

Permalink
HRRR - FileLoader - Rename parameter to from output_dir to input_dir
Browse files Browse the repository at this point in the history
Rename this parameter since we are reading and not writing files.
  • Loading branch information
jomey committed Apr 23, 2021
1 parent 7e3826e commit 14031ef
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/data/hrrr/test_file_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def setUpClass(cls):
cls.subject = FileLoader()

def test_parameters(self, _data_patch, _df_patch):
self.subject.get_saved_data(*self.METHOD_ARGS, output_dir='path')
self.subject.get_saved_data(*self.METHOD_ARGS, input_dir='path')

self.assertEqual(self.START_DATE, self.subject.start_date)
self.assertEqual(self.END_DATE, self.subject.end_date)
Expand Down
2 changes: 1 addition & 1 deletion tests/data/hrrr/test_hrrr_gold.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def testHRRRGribLoad(self):
self.END_DATE,
self.BBOX,
file_type='grib2',
output_dir=self.hrrr_dir.as_posix(),
input_dir=self.hrrr_dir.as_posix(),
force_zone_number=self.UTM_ZONE_NUMBER
)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_hrrr_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_pre_process(self):
pd.to_datetime('2018-07-22 03:00'),
self.BBOX,
file_type='grib2',
output_dir=self.output_path.as_posix(),
input_dir=self.output_path.as_posix(),
force_zone_number=self.UTM_ZONE_NUMBER)

self.assertCountEqual(
Expand Down
8 changes: 4 additions & 4 deletions weather_forecast_retrieval/data/hrrr/file_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def file_type(self):

def get_saved_data(self,
start_date, end_date, bbox,
output_dir=None, file_type='grib2',
input_dir=None, file_type='grib2',
force_zone_number=None,
var_keys=None):
"""
Expand All @@ -61,7 +61,7 @@ def get_saved_data(self,
start_date: datetime for the start
end_date: datetime for the end
bbox: list of [lonmin,latmin,lonmax,latmax]
output_dir: Base path to location of files
input_dir: Base path to location of files
file_type: 'grib' or 'netcdf', determines how to read the file
force_zone_number: UTM zone number to convert datetime to
var_keys: which keys to grab from smrf variables,
Expand Down Expand Up @@ -98,8 +98,8 @@ def get_saved_data(self,

self.force_zone_number = force_zone_number

if output_dir is not None:
self.output_dir = output_dir
if input_dir is not None:
self.output_dir = input_dir

self.log.info('Getting saved data')
self.get_data(var_map)
Expand Down

0 comments on commit 14031ef

Please sign in to comment.