It means that the interval returned by clnd(tenure) extends until the last day of the calendar. For the employees still working at the company, the second element of tenure tuple is None. This method finds out what portion of the second operand (the year 2017) is contained within the first operand (the working period of a person). Interval.what_portion_of() is called by proxy of the division operator / in lines 5.The latter call returns an interval which is bounded by the two dates supplied in tenure tuple: the day when the employee entered the company, and the day when he or she left. The former call returns the interval which corresponds to the calendar year 2017. Timeboard.get_interval() is called in line 3 disguised as clnd('2017', period='A') and in line 5 as clnd(tenure).
We use () to round up the end time of a workshift to the beginning of the next base unit of the timeboard.
WHERE IS TIMEBOARD IN MIDICO GENERATOR
Interval.workshifts() in line 6 returns a generator yielding all on-duty workshifts of the interval.In line 3 clnd('17 April 2017', period='A') is a call of Timeboard.get_interval() returning an interval of shifts which belong to the calendar week 17-23 of April.In line 2 the schedule for team ‘A’ is retrieved.
Timeboard.schedules is a dictionary of schedules registered for our timeboard.For example, note that rollforward(1) called on Friday, (the end of Development stage), returns Monday,, which becomes the start of Acceptance stage. This is done in lines 7 and 8 where operator + is used as a shortcut for rollforward. When called with an integer argument, rollforward(n) moves n days toward the future skipping weekends and holidays. In Russia, the first 8 days of January 2017 were holidays, hence, clnd('').rollforward() returns. It may be either project_start date itself or the next working day if project_start is a weekend or a holiday. In terms of our calendar, this means the nearest business day. When called without arguments (line 5) rollforward() returns the nearest on-duty workshift. Workshift.rollforward() is called by name in line 5 and by proxy of operator + in lines 7 and 8.It puts the start date of the project into the context of the timeline of the calendar and returns the corresponding workshift. Timeboard.get_workshift() is called in line 5 disguised as clnd(project_start).Two timeboard methods are used in this example: