Day 2

scope
read
reproduce
Author

Amy Heather

Published

June 21, 2024

Note

Built environment and got Table 6 config 1 results. Total time used: 8h 51m (22%)

10.02-10.16: Archive scope on Zenodo

Archiving repository on Zenodo, now that have made consensus decision on scope following:

  • Discussion with Tom yesterday.
  • Emails with Alison this morning, who also had a look over paper and our planned scope, and confirmed that she felt it looked complete.

Before doing so, created entry in CHANGELOG.md and updated CITATION.cff to include myself, Tom and Alison, and to amend the version and title.

10.23-10.30 : Look over code

  • All code in PHC.py.
  • Salabim.
  • Model created using classes.
  • Function main() defines parameters (e.g. number of doctors) and runs model.
  • No random seed.
  • Saves results to .xlsx with lots of stats (can spot lots from Table 6). Also outputs the input parameters used.
  • Can’t spot code for defined scenarios or figures, so anticipating will need to create for self.

(Timings below): Set up environment

Timings for this section (provided as list rather than in header as often paused for time spent solving environment):

  • 10.31-10.47
  • 11.00-11.01
  • 11.03-11.04
  • 11.12-11.35

No environment file provided. Can’t spot Python or Salabim version in the paper, nor in README from prior commit. Therefore:

name: shoaib2022
channels:
  - defaults
dependencies:
  - matplotlib=3.3.4
  - numpy=1.20.1
  - pip=21.0.1
  - python=3.9
  - statistics=1.0.3.5
  - xlsxwriter=1.3.7
  - xlwt=1.3.0
  - pip:
    - salabim==21.0.2

Spent along time solving environment and looking for incompatable packages (which excluded from timing above). Had lots of conflicts:

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package libuuid conflicts for:
xlwt=1.3.0 -> python[version='>=3.11,<3.12.0a0'] -> libuuid[version='>=1.0.3,<2.0a0|>=1.41.5,<2.0a0']
statistics=1.0.3.5 -> python[version='>=3.10,<3.11.0a0'] -> libuuid[version='>=1.0.3,<2.0a0|>=1.41.5,<2.0a0']
xlsxwriter=1.3.7 -> python -> libuuid[version='>=1.0.3,<2.0a0|>=1.41.5,<2.0a0']

Package certifi conflicts for:
pip=21.0.1 -> setuptools -> certifi[version='>=2016.09|>=2016.9.26']
matplotlib=3.3.4 -> matplotlib-base[version='>=3.3.4,<3.3.5.0a0'] -> certifi[version='>=2020.06.20']

Package _libgcc_mutex conflicts for:
numpy=1.20.1 -> libgcc-ng[version='>=7.3.0'] -> _libgcc_mutex[version='*|0.1',build=main]
python=3.9 -> libgcc-ng[version='>=11.2.0'] -> _libgcc_mutex[version='*|0.1',build=main]

Package pip conflicts for:
numpy=1.20.1 -> python[version='>=3.9,<3.10.0a0'] -> pip
xlwt=1.3.0 -> python[version='>=3.11,<3.12.0a0'] -> pip
matplotlib=3.3.4 -> python[version='>=3.7,<3.8.0a0'] -> pip
xlsxwriter=1.3.7 -> python -> pip
pip=21.0.1
python=3.9 -> pip

Package wheel conflicts for:
python=3.9 -> pip -> wheel
pip=21.0.1 -> wheel

Package ca-certificates conflicts for:
xlwt=1.3.0 -> python[version='>=2.7,<2.8.0a0'] -> ca-certificates
python=3.9 -> openssl[version='>=3.0.13,<4.0a0'] -> ca-certificates
statistics=1.0.3.5 -> python[version='<3'] -> ca-certificates
xlsxwriter=1.3.7 -> python -> ca-certificates

Package setuptools conflicts for:
python=3.9 -> pip -> setuptools
matplotlib=3.3.4 -> matplotlib-base[version='>=3.3.4,<3.3.5.0a0'] -> setuptools
pip=21.0.1 -> setuptools

Package numpy conflicts for:
matplotlib=3.3.4 -> matplotlib-base[version='>=3.3.4,<3.3.5.0a0'] -> numpy[version='>=1.16.6,<2.0a0']
numpy=1.20.1The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.35=0
  - feature:|@/linux-64::__glibc==2.35=0
  - numpy=1.20.1 -> libgcc-ng[version='>=7.3.0'] -> __glibc[version='>=2.17']
  - python=3.9 -> libgcc-ng[version='>=11.2.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.35

Instead of going package by package, tried out a simpler approach of changing to only specify the Python version and none of the individual packages. Still found lots of conflicts:

Package expat conflicts for:
numpy -> python[version='>=3.12,<3.13.0a0'] -> expat[version='>=2.5.0,<3.0a0|>=2.6.2,<3.0a0']
xlsxwriter -> python[version='>=3.12,<3.13.0a0'] -> expat[version='>=2.5.0,<3.0a0|>=2.6.2,<3.0a0']
matplotlib -> python[version='>=3.12,<3.13.0a0'] -> expat[version='>=2.5.0,<3.0a0|>=2.6.2,<3.0a0']
pip -> python[version='>=3.12,<3.13.0a0'] -> expat[version='>=2.5.0,<3.0a0|>=2.6.2,<3.0a0']

Package numpy conflicts for:
numpy
matplotlib -> matplotlib-base[version='>=3.8.4,<3.8.5.0a0'] -> numpy[version='>=1.15.4,<2.0a0|>=1.16.6,<2.0a0|>=1.20|>=1.21.5,<2.0a0|>=1.21.6,<2.0a0|>=1.23.5,<2.0a0|>=1.26.4,<2.0a0|>=1.26.0,<2.0a0|>=1.22.3,<2.0a0|>=1.19.2,<2.0a0|>=1.21.2,<2.0a0']
matplotlib -> numpy[version='>=1.14.6,<2.0a0']

Package _libgcc_mutex conflicts for:
matplotlib -> libgcc-ng[version='>=7.3.0'] -> _libgcc_mutex[version='*|0.1',build=main]
numpy -> libgcc-ng[version='>=11.2.0'] -> _libgcc_mutex[version='*|0.1',build=main]
python=3.9 -> libgcc-ng[version='>=11.2.0'] -> _libgcc_mutex[version='*|0.1',build=main]

Package certifi conflicts for:
matplotlib -> tornado -> certifi[version='>=2016.09|>=2016.9.26|>=2020.06.20']
pip -> setuptools -> certifi[version='>=2016.09|>=2016.9.26']

Package python conflicts for:
pip -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.12,<3.13.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0']
python=3.9
pip -> wheel -> python
matplotlib -> cycler[version='>=0.10'] -> python[version='>=3|>=3.6']
xlsxwriter -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.12,<3.13.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.11,<3.12.0a0|>=3.4|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
xlwt -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0']
statistics -> docutils[version='>=0.3'] -> python[version='>=3.11,<3.12.0a0|>=3.12,<3.13.0a0|>=3.7,<3.8.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0']
matplotlib -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.12,<3.13.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0']
numpy -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.12,<3.13.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0']
statistics -> python[version='<3|>=3.10,<3.11.0a0|>=2.7,<2.8.0a0']

Package bzip2 conflicts for:
xlsxwriter -> python[version='>=3.12,<3.13.0a0'] -> bzip2[version='>=1.0.8,<2.0a0']
matplotlib -> python[version='>=3.11,<3.12.0a0'] -> bzip2[version='>=1.0.8,<2.0a0']
numpy -> python[version='>=3.10,<3.11.0a0'] -> bzip2[version='>=1.0.8,<2.0a0']
xlwt -> python[version='>=3.11,<3.12.0a0'] -> bzip2[version='>=1.0.8,<2.0a0']
statistics -> python[version='>=3.10,<3.11.0a0'] -> bzip2[version='>=1.0.8,<2.0a0']
pip -> python[version='>=3.11,<3.12.0a0'] -> bzip2[version='>=1.0.8,<2.0a0']

Package setuptools conflicts for:
python=3.9 -> pip -> setuptools
pip -> setuptools
matplotlib -> setuptools

Package wheel conflicts for:
pip -> wheel
python=3.9 -> pip -> wheelThe following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.35=0
  - matplotlib -> libgcc-ng[version='>=7.3.0'] -> __glibc[version='>=2.17']
  - numpy -> libgcc-ng[version='>=11.2.0'] -> __glibc[version='>=2.17']
  - python=3.9 -> libgcc-ng[version='>=11.2.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.35

Based on this stack overflow post, decided to instead try using mamba.

conda install -n base conda-forge::mamba

But then read that was not recommended so tried -

curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"

But that wasn’t working so deleted and tried these instructions -

wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh

bash Mambaforge-Linux-x86_64.sh

yes

yes

# Closed terminal then reopened terminal

Then, tried creating environment:

mamba env create -f environment.yml

This returned a more understandable message:

LibMambaUnsatisfiableError: Encountered problems while solving:
  - package statistics-1.0.3.5-py27_1 requires python >=2.7,<2.8.0a0, but none of the providers can be installed

Could not solve for environment specs
The following packages are incompatible
├─ python 3.9**  is requested and can be installed;
└─ statistics is not installable because there are no viable options
   ├─ statistics 1.0.3.5 would require
   │  └─ python [2.7* |>=2.7,<2.8.0a0 ], which conflicts with any installable versions previously reported;
   ├─ statistics 1.0.3.5 would require
   │  └─ python >=3.10,<3.11.0a0 , which conflicts with any installable versions previously reported;
   └─ statistics 1.0.3.5 would require
      └─ python <3 , which conflicts with any installable versions previously reported.

Appears from this message (and supported versions listed on pypi) that would need to switch to python 2.7. Environment then successfully installed, and update .yml to show versions it used.

name: shoaib2022
channels:
  - defaults
dependencies:
  - matplotlib=2.2.3
  - numpy=1.16.6
  - pip=19.3.1
  - python=2.7
  - statistics=1.0.3.5
  - xlsxwriter=3.0.1
  - xlwt=1.3.0
  - pip:
    - salabim==20.0.4

At a glance, all are lower than those I’d previously specified, except xlsxwriter, which is 3.0.1 (10 Aug 2021). As it would not be possible for them to have used this version, I set that to 1.3.7 and rebuilt environment.

This built quickly and with no issue.

11.51-11.57, 12.03-12.37: Running script and returning to environment

Copied PHC.py into reproduction/ and ran file with environment active.

ImportError: No module named pathlib. Installed latest version of pathlib (which is from 2014) into environment.

Then error:

Traceback (most recent call last):
  File "/home/amy/Documents/stars/stars-reproduce-shoaib-2022/reproduction/PHC.py", line 1, in <module>
    import salabim as sim
  File "/home/amy/mambaforge/envs/shoaib2022/lib/python2.7/site-packages/salabim/__init__.py", line 1, in <module>
    from .salabim import *
  File "/home/amy/mambaforge/envs/shoaib2022/lib/python2.7/site-packages/salabim/salabim.py", line 9451, in <module>
    class AnimateCombined(collections.UserList):
AttributeError: 'module' object has no attribute 'UserList'

Wanted to just explore basic salabim example first, to check environment is working, so made notebook that just imports salabim. Running required installation of ipykernel in environment. Excluded installation time for this from timings above. Then ran import salabim as sim, but this returned the same error as before just upon import.

Current salabim documentation lists a few different imports that might be required. Went to old documentation on their GitHub, to the 20.0.4 branch then PDF with documentation (which is 20.0.3, but likewise if you go to 20.0.5 branch): https://github.com/salabim/salabim/blob/20%2C0%2C4/salabim.pdf. Then ran:

pip install Pillow

Which didn’t have much impact. Error message seems to relate to collections not having UserList. Collections is a built-in module in base python. Tried to just import collections (which was fine), then run collections.UserList which returns same error.

Looking at documentation for Python 2.7.18, collections does not yet have UserList, but it does from 3.0.

Have realised mistake - that statistics on conda/PyPi is an import to allow it to work with 2.7, but actually, statistics is a built-in python module that was introduced in Python 3.4.

As such, deleted environment and removed statistics from the requirements, and just set requirement of Python 3.9 (as tried before) and built using mamba.

Environment prior:

name: shoaib2022
channels:
  - defaults
dependencies:
  - ipykernel=4.10.0
  - matplotlib=2.2.3
  - numpy=1.16.6
  - pathlib=1.0.1
  - pip=19.3.1
  - python=2.7
  - statistics=1.0.3.5
  - xlsxwriter=1.3.7
  - xlwt=1.3.0
  - pip:
    - salabim==20.0.4

Environment tried now:

name: shoaib2022
channels:
  - defaults
dependencies:
  - ipykernel
  - matplotlib
  - numpy
  - pathlib
  - pip
  - python=3.9
  - xlsxwriter
  - xlwt
  - pip:
    - salabim

Run:

conda deactivate
conda remove -n shoaib2022 --all
mamba env create -f environment.yml
conda activate shoaib2022

This quickly installed, and updated environment file with the versions it used:

name: shoaib2022
channels:
  - defaults
dependencies:
  - ipykernel=6.28.0
  - matplotlib=3.8.4
  - numpy=1.26.4
  - pathlib=1.0.1
  - pip=24.0
  - python=3.9.19
  - xlsxwriter=3.1.1
  - xlwt=1.3.0
  - pip:
    - salabim==24.0.6

Can see that several of these are more recent that would have been possible for the paper. But trying import of salabim now works. Decided to try running the script with this environment, just to see if it can work.

ModuleNotFoundError: No module named 'greenlet'

Can see this was suggested in the salabim documentation. Add greenlet to environment and remade environment with mamba env update -f environment.yml. This add greenlet==3.0.3. Then re-run PHC.py. Got:

Traceback (most recent call last):
  File "/home/amy/Documents/stars/stars-reproduce-shoaib-2022/reproduction/PHC.py", line 1300, in <module>
    main()
  File "/home/amy/Documents/stars/stars-reproduce-shoaib-2022/reproduction/PHC.py", line 932, in main
    Main(name='')
  File "/home/amy/mambaforge/envs/shoaib2022/lib/python3.9/site-packages/salabim/salabim.py", line 7131, in __init__
    raise ValueError(
ValueError: process may not be a generator (contain yield statements.)
Maybe this a non yieldless model. In that case:
- add sim.yieldless(False) or
- remove all yields or
- run salabim_unyield.py

13.17-15.07: Continued and got config1 table6 results (confirmed match)

Suspicious my error could be because I’m used versions that are more recent than I know possible. Hence, delete environment and this time rebuild as specified at start but without statistics, but with the new ones I know I need, with versions based on their release history. Exception was ipykernel, as that was something I’ve added to run notebooks, and not something the original study required.

name: shoaib2022
channels:
  - defaults
dependencies:
  - ipykernel
  - matplotlib=3.3.4
  - numpy=1.20.1
  - pathlib=1.0.1
  - pip=21.0.1
  - python=3.9.19
  - xlsxwriter=1.3.7
  - xlwt=1.3.0
  - pip:
    - greenlet==1.0.0
    - salabim==21.0.2

This built fine! So probably would’ve worked to begin with without statistics. Then ran PHC.py, and it started running fine, outputting No of replications done 0, No of replications done 1

Ensure is set up with correct parameters. Configuration 1 is (from Table 3 and 6):

  • 2 doctors: doc_cap = 2
  • 4 nurses: staff_nurse_cap = 3, NCD_nurse_cap = 1
  • 130 OPD cases, so OPD inter-arrival time 4: OPD_iat = 4
  • 0.5 IPD cases, so IPD inter-arrival time 2880: IPD_iat = 2880
  • 1 childbirth, so childbirth inter-arrival time 1440: delivery_iat = 1440
  • 1 ANC (patients), so ANC inter-arrival time 1440: ANC_iat = 1440
  • 6 inpatient beds: bed = sim.Resource("Bed", capacity=6)
  • 1 labour room: delivery_bed = sim.Resource("Del bed", capacity = 1)
  • 100 replications: replication = 10
  • 365 days: days = 365
  • Warm-up 180 days: warm_up = 180*24*60

Except for number of replications, all match up to configuration 1.

Produced Outputs.xlsx in main folder, which moved manually to reproduction/, and copied to logbook folder to display below. This ran ten replications, with results in each column.

import xlrd
import pandas as pd

model_path = 'Outputs.xls'

book = xlrd.open_workbook(model_path)
result = pd.read_excel(book, header=None, index_col=0)
result
1 2 3 4 5 6 7 8 9 10
0
OPD patients 32836.000000 33066.000000 33023.000000 32870.000000 33240.000000 33232.000000 33216.000000 33368.000000 33314.000000 33171.000000
IPD patients 174.000000 166.000000 171.000000 177.000000 198.000000 194.000000 206.000000 178.000000 198.000000 178.000000
ANC patients 368.000000 362.000000 386.000000 380.000000 388.000000 381.000000 372.000000 370.000000 350.000000 355.000000
Del patients 384.000000 367.000000 369.000000 361.000000 309.000000 360.000000 359.000000 397.000000 385.000000 339.000000
OPD Q wt 0.006038 0.008066 0.006059 0.006793 0.005244 0.010225 0.007012 0.016915 0.008484 0.018205
Pharmacy Q wt 1.047611 1.019909 1.011980 1.016690 1.006467 1.032219 1.020334 1.017687 1.017410 1.003815
Lab Q wt 2.063080 2.096727 2.121108 1.958464 2.096112 2.160190 2.039157 2.069498 2.135470 2.139755
doc occ 0.269761 0.271455 0.265695 0.271491 0.266211 0.269985 0.269385 0.274394 0.270916 0.264823
Lab patient list 34553.000000 68973.000000 103851.000000 137618.000000 172163.000000 206714.000000 241073.000000 275273.000000 309924.000000 344492.000000
OPD q len 0.005855 0.009359 0.004993 0.007724 0.005061 0.011423 0.005998 0.010305 0.010064 0.017429
ipd occ 0.100000 0.100000 0.100000 0.100000 0.090000 0.100000 0.090000 0.100000 0.100000 0.100000
opd q len 0.000531 0.000713 0.000535 0.000598 0.000462 0.000909 0.000619 0.001494 0.000751 0.001609
pharmacy q len 0.091809 0.089833 0.089091 0.089266 0.088519 0.091496 0.089756 0.089564 0.089736 0.088452
lab q len 0.093966 0.095058 0.097672 0.087332 0.095604 0.098494 0.092430 0.093381 0.097421 0.097366
NCD occ 0.856243 0.876655 0.868920 0.862815 0.875444 0.864627 0.873573 0.882904 0.885179 0.851488
lab occ 0.559366 0.552778 0.566939 0.550767 0.558711 0.559475 0.554049 0.557318 0.562513 0.553164
pharm occ 0.637989 0.643297 0.639525 0.638504 0.644518 0.642726 0.645787 0.647810 0.647879 0.641500
staff nurse occ 0.328762 0.322683 0.321956 0.321020 0.305951 0.322970 0.323056 0.335735 0.331135 0.312820
del occ 0.280000 0.290000 0.300000 0.290000 0.260000 0.290000 0.280000 0.300000 0.300000 0.280000
del referred 58.000000 53.000000 56.000000 54.000000 44.000000 55.000000 55.000000 62.000000 72.000000 47.000000
NCD occ 0.856243 0.876655 0.868920 0.862815 0.875444 0.864627 0.873573 0.882904 0.885179 0.851488
ipd bed occ 0.101028 0.091502 0.097690 0.092269 0.082897 0.094390 0.091500 0.098772 0.092360 0.090019

Add xlrd and pandas to environment (quarto and reproduction) so can import the .xls files produced and process them.

Processed this in reproduce.ipynb so can match up results to Table 6 (as use different label names), and calculate proportion of childbirth referred.

Confirmed that values all matched up with only apx. 1% difference at most, which is great!

15.23-16.17: Second results spreadsheet

There is REPLICATION = xlsxwriter.Workbook("Config_3(2).xlsx") with results that I didn’t get. Tried uncommenting REPLICATION.close() and reran PHC.py.

Also, changed save location of the output files, so they go into reproduction/outputs/ rather than main folder, by modifying PHC.py.

In reproduction.ipynb, compared results from that to the processed Outputs.xls. To import .xlsx file using pd.read_excel, had to add openpyxl to environment.

compare = pd.read_csv('t6_mean_compare.csv')
compare
t6_outcome simple_outcome full_outcome t6_result simple_result full_result
0 Doctor utilisation doc occ Doctor Occupancy 0.268 0.269412 0.269358
1 NCD Nurse utilisation NCD occ NCD Nurse Occupancy 0.865 0.869785 0.860000
2 Staff nurse utilisation staff nurse occ Staff nurse Occupancy 0.323 0.322609 0.330000
3 Pharmacist utilisation pharm occ Pharmacist Occupancy 0.643 0.642954 0.642419
4 Lab utilisation lab occ Lab Occupancy 0.559 0.557508 0.680000
5 Inpatient bed utilisation ipd bed occ Bed occupancy 0.093 0.093243 0.090000
6 Labour bed utilisation del occ NaN 0.283 0.287000 NaN
7 Mean length of OPD queue (number of patients) OPD q len Mean length of OPD queue 0.000 0.008821 0.000900
8 OPD queue waiting time (minutes) OPD Q wt OPD queue waiting time 0.009 0.009304 0.009700
9 Mean length of pharmacy queue (number of patie... pharmacy q len Mean length of pharmacy queue 0.090 0.089752 0.090000
10 Pharmacy queue waiting time (minutes) Pharmacy Q wt Pharmacy queue waiting time 1.025 1.019412 1.030000
11 Mean length of Lab queue (number of patients) lab q len Mean length of Lab queue 0.094 0.094872 0.100000
12 Lab queue waiting time (minutes) Lab Q wt Lab queue waiting time 2.084 2.087956 2.080000
13 Fraction of childbirth cases referred prop_del_referred NaN 0.156 0.153168 NaN

This had similar results but observations:

  • Different labels again
  • Also does not have fraction of childbirth cases referred
  • Can’t spot labour bed utilisation in the larger results table

The results are not an exact match but all are likely due to rounding differences. As the outputs one was processed additionally using spreadsheet with replication results, feel its better to use the full results spreadsheet they create, as that works with the raw results (and not potentially rounded results in the spreadsheet).

Match:

  • doctor utilisation
  • pharmacist utilisation

Don’t match:

  • ncd nurse utilisation (rounding?)
  • staff nurse utilisation (rounding?)
  • lab utilisation (rounding?)
  • bed occupancy (rounding?)
  • mean OPD queue length (rounding as simple results using replication spreadsheet which might have rounding)
  • OPD queue waiting times (rounding?)
  • mean pharmacy queue length (rounding?)
  • pharacy queue waiting tim (rounding?)
  • lab queue waiting time (rounding?)

However, that doesn’t have the standard deviation for all the results included - and its missing labour bed utilisation and fraction of childbirth cases. Also, the full result is potentially more rounded than the reported, and as it was commented out in the .py file originally, that lends me to suspect that results could likely be based on the replication spreadsheet results.

Decision: Use replication spreadsheet results.

16.22-16.48: Setting parameter values from notebook

In order to run the different scenarios without needing to change the PHC.py itself each time, worked to modify the function main() so that the parameters provided to that function are inputs.

Then ran the model from reproduce.ipynb.

Timings

import sys
sys.path.append('../')
from timings import calculate_times

# Minutes used prior to today
used_to_date = 239

# Times from today
times = [
    ('10.02', '10.16'),
    ('10.23', '10.30'),
    ('10.31', '10.47'),
    ('11.00', '11.01'),
    ('11.03', '11.04'),
    ('11.12', '11.35'),
    ('11.51', '11.57'),
    ('12.03', '12.37'),
    ('13.17', '15.07'),
    ('15.23', '16.17'),
    ('16.22', '16.48')]

calculate_times(used_to_date, times)
Time spent today: 292m, or 4h 52m
Total used to date: 531m, or 8h 51m
Time remaining: 1869m, or 31h 9m
Used 22.1% of 40 hours max