Skip to content

Commit

Permalink
Merge pull request #77 from cgq-qgc/rework_print_msg_when_reading_grid
Browse files Browse the repository at this point in the history
PR: Rework print message when reading grid data
  • Loading branch information
jnsebgosselin committed Mar 17, 2022
2 parents 999f370 + 10c64db commit 4125f84
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pyhelp/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,14 @@ def load_input_grid(self):
By default, the input grid data file must be saved in the working
directory and named :file:`input_grid.csv`.
"""
print('Reading input data grid from csv...', end=' ')
print('Reading grid data from input csv file...')
grid_fname = osp.join(self.workdir, INPUT_GRID_FNAME)
self.grid = load_grid_from_csv(grid_fname)
print('done')
if not osp.exists(grid_fname):
self.grid = None
print("Grid input csv file does not exist.")
else:
self.grid = load_grid_from_csv(grid_fname)
print('Grid data read successfully from input csv file.')

def load_weather_input_data(self):
"""
Expand All @@ -136,7 +140,7 @@ def load_weather_input_data(self):
respectively, :file:`precip_input_data.csv`,
:file:`airtemp_input_data.csv`, and :file:`solrad_input_data.csv`.
"""
print('Reading input weather data from csv...', end=' ')
print('Reading input weather data from csv...')
self.precip_data = load_weather_from_csv(
osp.join(self.workdir, INPUT_PRECIP_FNAME))
self.airtemp_data = load_weather_from_csv(
Expand Down Expand Up @@ -527,8 +531,6 @@ def load_grid_from_csv(path_togrid):
Load the csv that contains the infos required to evaluate regional
groundwater recharge with HELP.
"""
if not osp.exists(path_togrid):
return None
grid = pd.read_csv(path_togrid)

fname = osp.basename(path_togrid)
Expand Down

0 comments on commit 4125f84

Please sign in to comment.