When loading data for creating the fieldsets, we use the select_files function, defined in utils.py. There is a bug when trying to load in more than two years of data, caused by the line:
possible_files = sorted( glob(dirread + string_ % (yr0-1)) + glob(dirread + string_ % yr0) + glob(dirread + string_ % (yr0+1)) )
in the select_files function.
I will sort this out in the next pull request, but the solution is to replace this line with the following:
yrEnd = time_end.year
ragged_files = [glob(dirread + string_ % (yr0+i)) for i in range(-1,yrEnd-yr0+1)]
possible_files = []
for i in range(len(ragged_files)):
for file_ in ragged_files[i]:
possible_files.append(file_)
possible_files = sorted(possible_files)
When loading data for creating the fieldsets, we use the
select_files
function, defined inutils.py
. There is a bug when trying to load in more than two years of data, caused by the line:possible_files = sorted( glob(dirread + string_ % (yr0-1)) + glob(dirread + string_ % yr0) + glob(dirread + string_ % (yr0+1)) )
in theselect_files
function.I will sort this out in the next pull request, but the solution is to replace this line with the following: