PyShift Work Schedule
Work Schedule for Python
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
rotation.Rotation Class Reference

Class Rotation maintains a sequenced list of shift and off-shift time periods. More...

Inheritance diagram for rotation.Rotation:

Public Member Functions

def __init__ (self, str name, str description)
 Construct a shift rotation. More...
 
[] getPeriods (self)
 Get the shifts and off-shifts in the rotation. More...
 
int getDayCount (self)
 Get the number of days in the rotation. More...
 
timedelta getDuration (self)
 Get the duration of this rotation. More...
 
timedelta getWorkingTime (self)
 Get the shift rotation's total working time. More...
 
RotationSegment addSegment (self, Shift startingShift, int daysOn, int daysOff)
 Add a working period to this rotation. More...
 
str __str__ (self)
 

Static Public Member Functions

DayOff getDayOff ()
 Create or return the day off period. More...
 

Public Attributes

 rotationSegments
 
 periods
 

Static Public Attributes

 dayOff = None
 

Detailed Description

Class Rotation maintains a sequenced list of shift and off-shift time periods.

Constructor & Destructor Documentation

◆ __init__()

def rotation.Rotation.__init__ (   self,
str  name,
str  description 
)

Construct a shift rotation.

Parameters
nameName of rotation
descriptionDescription of rotation

Member Function Documentation

◆ addSegment()

RotationSegment rotation.Rotation.addSegment (   self,
Shift  startingShift,
int  daysOn,
int  daysOff 
)

Add a working period to this rotation.

A working period starts with a shift and specifies the number of days on and days off

Parameters
startingShiftShift that starts the period
daysOnNumber of days on shift
daysOffNumber of days off shift
Returns
RotationSegment

◆ getDayCount()

int rotation.Rotation.getDayCount (   self)

Get the number of days in the rotation.

Returns
Day count

◆ getDayOff()

DayOff rotation.Rotation.getDayOff ( )
static

Create or return the day off period.

Returns
the day off period

◆ getDuration()

timedelta rotation.Rotation.getDuration (   self)

Get the duration of this rotation.

Returns
timedelta duration

◆ getPeriods()

[] rotation.Rotation.getPeriods (   self)

Get the shifts and off-shifts in the rotation.

Returns
List of periods

◆ getWorkingTime()

timedelta rotation.Rotation.getWorkingTime (   self)

Get the shift rotation's total working time.

Returns
timedelta of working time

The documentation for this class was generated from the following file: