PyShift Work Schedule
Work Schedule for Python
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
team.Team Class Reference

Class Team is a named group of individuals who rotate through a shift schedule. More...

Inheritance diagram for team.Team:

Public Member Functions

 __init__ (self, str name, str description, Rotation rotation, date rotationStart)
 Construct a team.
 
timedelta getRotationDuration (self)
 Get the duration of the shift rotation.
 
float getPercentageWorked (self)
 Get the shift rotation's working time as a percentage of the rotation duration.
 
float getAverageHoursWorkedPerWeek (self)
 Get the average number of hours worked each week by this team.
 
int getDayInRotation (self, date day)
 Get the day number in the rotation for this date.
 
ShiftInstance getShiftInstanceForDay (self, date day)
 Get the ShiftInstance for the specified day.
 
bool isDayOff (self, date day)
 Check to see if this day is a day off.
 
timedelta calculateWorkingTime (self, datetime fromTime, datetime toTimeOfDay)
 Calculate the team working time between the specified dates and times of day.
 
str __str__ (self)
 
 addMember (self, TeamMember member)
 Add a member to this team.
 
 removeMember (self, TeamMember member)
 Remove a member from this team.
 
bool hasMember (self, TeamMember member)
 True if member is assigned to this team.
 
 addMemberException (self, TeamMemberException memberException)
 Add a member exception to this team.
 
 removeMemberException (self, TeamMemberException memberException)
 Remove a member exception from this team.
 
 buildMemberCache (self)
 
List[TeamMember] getMembers (self, datetime shiftStart)
 Build a list of team members for the specified shift start.
 

Public Attributes

 rotation
 
 rotationStart
 
 assignedMembers
 
 memberExceptions
 
 exceptionCache
 

Detailed Description

Class Team is a named group of individuals who rotate through a shift schedule.

Constructor & Destructor Documentation

◆ __init__()

team.Team.__init__ ( self,
str name,
str description,
Rotation rotation,
date rotationStart )

Construct a team.

Parameters
nameName of team
descriptionDescription of team
rotationRotation of this team
rotationStartDate that the rotation starts for this team

Member Function Documentation

◆ addMember()

team.Team.addMember ( self,
TeamMember member )

Add a member to this team.

Parameters
memberTeamMember to add

◆ addMemberException()

team.Team.addMemberException ( self,
TeamMemberException memberException )

Add a member exception to this team.

Parameters
memberExceptionTeamMemberException to add

◆ calculateWorkingTime()

timedelta team.Team.calculateWorkingTime ( self,
datetime fromTime,
datetime toTimeOfDay )

Calculate the team working time between the specified dates and times of day.

Parameters
fromTimeStarting date and time of day
toTimeEnding date and time of day
Returns
Duration of working time as timedelta

◆ getAverageHoursWorkedPerWeek()

float team.Team.getAverageHoursWorkedPerWeek ( self)

Get the average number of hours worked each week by this team.

Returns
average hours worked per week

◆ getDayInRotation()

int team.Team.getDayInRotation ( self,
date day )

Get the day number in the rotation for this date.

Parameters
daydate
Returns
day number in the rotation, starting at 1

◆ getMembers()

List[TeamMember] team.Team.getMembers ( self,
datetime shiftStart )

Build a list of team members for the specified shift start.

Parameters
shiftStartShift instance starting date and time
Returns
List of [TeamMember]

◆ getPercentageWorked()

float team.Team.getPercentageWorked ( self)

Get the shift rotation's working time as a percentage of the rotation duration.

Returns
Percentage worked

◆ getRotationDuration()

timedelta team.Team.getRotationDuration ( self)

Get the duration of the shift rotation.

Returns
Duration as timedelta

◆ getShiftInstanceForDay()

ShiftInstance team.Team.getShiftInstanceForDay ( self,
date day )

Get the ShiftInstance for the specified day.

Parameters
daydate with a shift instance
Returns
ShiftInstance

◆ isDayOff()

bool team.Team.isDayOff ( self,
date day )

Check to see if this day is a day off.

Parameters
daydate to check
Returns
True if a day off

◆ removeMember()

team.Team.removeMember ( self,
TeamMember member )

Remove a member from this team.

Parameters
memberTeamMember to remove

◆ removeMemberException()

team.Team.removeMemberException ( self,
TeamMemberException memberException )

Remove a member exception from this team.

Parameters
memberExceptionTeamMemberException to remove

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