-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes to enable daily calibration frequency #4
base: develop
Are you sure you want to change the base?
Conversation
elif cfg.calibration_freq == r'daily': | ||
index = pd.to_datetime(pd.date_range(start, end, freq='24H'), format='%d/%m/%Y %H:%M', errors='raise') | ||
else: | ||
raise Exception('Calibration freq {} not supported'.format(cfg.calibration_freq)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@doc78 , I'm wondering if it wouldn't be cleaner to put the if statement for the calibration_freq in the config and then use the value to derive directly the step when constructing the time series:
it would give something like:
index = pd.to_datetime(pd.date_range(start, end, freq='{}H'.format(cfg.freq_hours)), format='%d/%m/%Y %H:%M', errors='raise')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could even put a value in minutes to be more future proof.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree
simulated_streamflow.index = [(datetime.strptime(start, "%d/%m/%Y %H:%M") + timedelta(hours=24*i)).strftime('%d/%m/%Y %H:%M') for i in range(len(simulated_streamflow.index))] | ||
else: | ||
raise Exception('Calibration freq {} not supported'.format(self.cfg.calibration_freq)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, it would give:
simulated_streamflow.index = [(datetime.strptime(start, "%d/%m/%Y %H:%M") + timedelta(hours=cfg.freq_hours*i)).strftime('%d/%m/%Y %H:%M') for i in range(len(simulated_streamflow.index))]
Merge in CEFL/lisflood-calibration from damienWorking to develop * commit '61b118e42b9c390bae325a7fd7c146f2021c142e': modified aux scripts (all but CAL_7)
No description provided.