Commit eaba4ec4 authored by hazrmard's avatar hazrmard
Browse files

read weeks +1 files to handle edge cases when a new empty csv is created when a new week starts

parent 7e91527f
......@@ -110,7 +110,7 @@ def weeklysolardata(datafolder: str = './energyfreqanalysis/', weeks: int = 4):
# the controller would create a new file to store measurements for the week
# beginning on monday. The sunday data will belong to the earlier calandar week.
data_files = glob(os.path.join(datafolder, '*store.csv'))
flist = sorted(data_files, key=os.path.getctime, reverse=True)[:weeks]
flist = sorted(data_files, key=os.path.getctime, reverse=True)[:weeks+1]
if len(flist) == 0:
warnings.warn('No *store.csv files found containing historical measurements.')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment