Open drheinheimer opened 4 years ago
Here's an example:
if self.model.mode == 'scheduling':
month = timestep.month
day = timestep.day
if (2, 10) <= (month, day) <= (5, 31):
start_day = 10
else:
start_day = 1
if 2 <= month <= 5 and day <= 9:
start_month = month - 1
else:
start_month = month
start_date = '{}-{}'.format(start_month, start_day)
ifr_val = schedule.at[start_date, WYT_str]
else:
ifr_val = schedule.at[self.datetime.month, WYT_str]
In this example, the start_date
is somewhat complex, but overall straightforward. Most IFR schedules are less complex.
Many IFRs with a lookup table in Stanislaus are currently very poorly coded. We need to identify ways to improve performance to be able to achive the modeling vision.
I've posted some initial tips in the Wiki.
The general plan is to refactor along these lines: