histopath_bim_des.config.resources module

Resource configuration module for the histopath simulation model.

class histopath_bim_des.config.resources.ResourceSchedule(*, day_flags: Sequence[bool], allocation: Sequence[int])[source]

Bases: BaseModel

A resource allocation schedule.

day_flags: Sequence[bool]

True/1 if resource is scheduled for the day (MON to SUN), False/0 otherwise.

allocation: Sequence[int]

Number of resource units allocated for the day (in 30-min intervals), if the corresponding day flag is set to 1. The list length is expected to be 48.

static from_pd(df: DataFrame, row_name: str) ResourceSchedule[source]

Construct a resource schedule from a DataFrame row.

Parameters:
  • df – The dataframe containing the resource allocation information.

  • row_name – The name of the resource, matching a row index in the inputted dataframe.

class histopath_bim_des.config.resources.ResourceInfo(*, name: str, type: Literal['staff', 'machine'], schedule: ResourceSchedule)[source]

Bases: BaseModel

Contains information about a resource.

name: str

The name of the resource, e.g. β€œScanning machine”.

type: Literal['staff', 'machine']

Whether the resource is a staff or machine resource.

schedule: ResourceSchedule

A schedule defining the number of allocated resource units over the course of a week.

class histopath_bim_des.config.resources.ResourcesInfo(*, booking_in_staff: ResourceInfo, bms: ResourceInfo, cut_up_assistant: ResourceInfo, processing_room_staff: ResourceInfo, microtomy_staff: ResourceInfo, staining_staff: ResourceInfo, scanning_staff: ResourceInfo, qc_staff: ResourceInfo, histopathologist: ResourceInfo, bone_station: ResourceInfo, processing_machine: ResourceInfo, staining_machine: ResourceInfo, coverslip_machine: ResourceInfo, scanning_machine_regular: ResourceInfo, scanning_machine_megas: ResourceInfo)[source]

Bases: BaseModel

Dataclass for tracking the staff resources of a model.

The fields in this dataclass MUST match the rows of the configuration Excel template (β€œResources” tab), with all letters to lowercase, spaces to underscores, and other characters removed.

booking_in_staff: ResourceInfo
bms: ResourceInfo
cut_up_assistant: ResourceInfo
processing_room_staff: ResourceInfo
microtomy_staff: ResourceInfo
staining_staff: ResourceInfo
scanning_staff: ResourceInfo
qc_staff: ResourceInfo
histopathologist: ResourceInfo
bone_station: ResourceInfo
processing_machine: ResourceInfo
staining_machine: ResourceInfo
coverslip_machine: ResourceInfo
scanning_machine_regular: ResourceInfo
scanning_machine_megas: ResourceInfo
static from_workbook(wbook: Workbook) ResourcesInfo[source]

Construct a dataclass instance from an Excel workbook.

Parameters:

wbook – The Excel workbook to parse.

Returns:

The parsed dataclass instance.