|
| 1 | +--- |
| 2 | +title: "Day 2" |
| 3 | +author: "Amy Heather" |
| 4 | +date: "2024-05-23" |
| 5 | +categories: [read] |
| 6 | +--- |
| 7 | + |
| 8 | +::: {.callout-note} |
| 9 | + |
| 10 | +## Total time elapsed |
| 11 | + |
| 12 | +TBC |
| 13 | + |
| 14 | +::: |
| 15 | + |
| 16 | +## Work log |
| 17 | + |
| 18 | +### 10.24-11.00 - Describe code/data |
| 19 | + |
| 20 | +Looked over code and data from original study, taking notes below. |
| 21 | + |
| 22 | +::: {.callout-note appearance="minimal" collapse=true} |
| 23 | + |
| 24 | +## Notes from looking over their code and data |
| 25 | + |
| 26 | +Code files in main folder: |
| 27 | + |
| 28 | +* **Capacity_Model_Template.ipynb** - explain DES model, input files, code example importing `sim_replicate.py` and using functions from that |
| 29 | +* **sim_replicate.py** - importing from sim/, single and multiple runs of model, and multiple runs of prescribed scenarios, and function to get audit results from multiple runs, and parameters |
| 30 | +* **sim_single.py** - single run of model |
| 31 | + |
| 32 | +Other files in main folder: |
| 33 | + |
| 34 | +* **CONTRIBUTING.md** - lists Mike and Tom as the contributors |
| 35 | +* **environment.yaml** - conda environment |
| 36 | +* **.gitignore** |
| 37 | +* **LICENSE** - MIT |
| 38 | +* **README.md** - Instructs to use environment and then refer to `.ipynb` files |
| 39 | +* **Transport_Model_Template.ipynb** - Monte Carlo Model |
| 40 | +* **main_vrp.py** - importing from vrp/, but otherwise very similar to part of sim_replicate (single and multiple runs, and parameters). VRP = vehicle routing problem? |
| 41 | + |
| 42 | +Other folders: |
| 43 | + |
| 44 | +* **output/** - empty |
| 45 | +* **patient_geography_data/** - patient data |
| 46 | +* **sim/** - Discrete event |
| 47 | +* **vrp/** - Monte Carlo |
| 48 | + |
| 49 | +```bash |
| 50 | +├── output |
| 51 | +│ └── ... |
| 52 | +├── patient_geography_data |
| 53 | +│ └── ... |
| 54 | +├── sim |
| 55 | +│ └── ... |
| 56 | +├── vrp |
| 57 | +│ └── ... |
| 58 | +├── .gitignore |
| 59 | +├── CONTRIBUTING.md |
| 60 | +├── Capacity_Model_Template.ipynb |
| 61 | +├── LICENSE |
| 62 | +├── README.md |
| 63 | +├── Transport_Model_Template.ipynb |
| 64 | +├── environment.yaml |
| 65 | +├── main_vrp.py |
| 66 | +├── sim_replicate.py |
| 67 | +└── sim_single.py |
| 68 | +``` |
| 69 | + |
| 70 | +More details on patient_geography_data/ folder: |
| 71 | + |
| 72 | +* **patient_counts_no_home_or_IOW.csv** - ? counts per postcode |
| 73 | +* **patients.csv** - table of patients with type, postcode, site, first day, and blank COVID status column |
| 74 | +* **travel_matrix_distance_km.csv** - travel distance (km) between postcodes |
| 75 | +* **travel_matrix_time_min.csv** - travel time (min) between postcodes |
| 76 | + |
| 77 | +```bash |
| 78 | +├── patient_geography_data |
| 79 | +│ ├── patient_counts_no_home_or_IOW.csv |
| 80 | +│ ├── patients.csv |
| 81 | +│ ├── travel_matrix_distance_km.csv |
| 82 | +│ └── travel_matrix_time_min.csv |
| 83 | +``` |
| 84 | + |
| 85 | +More details on sim/ folder: |
| 86 | + |
| 87 | +* **allocation.py** - methods to allocate patients to units and shifts |
| 88 | +* **audit.py** - audit on patient and unit metrics |
| 89 | +* **end_trial_analysis.py** - analysis after replicates, creates charts |
| 90 | +* **helper_functions.py** - expands multi-index |
| 91 | +* **__init__.py** - blank, to initalise as package |
| 92 | +* **model.py** - model classes to hold patients, simulation model class |
| 93 | +* **parameters.py** - classes for normal and uniform distributions, and class with parameters for scenario |
| 94 | +* **patient.py** - patient class |
| 95 | +* **patients.csv** - looks similar to patients.csv in main folder |
| 96 | +* **travel_matrix.csv** - patient travel times to each of the units |
| 97 | +* **units.csv** - information on each of the units |
| 98 | +* **units.py** - unit information from CSV |
| 99 | + |
| 100 | +```bash |
| 101 | +├── sim |
| 102 | +│ ├── allocation.py |
| 103 | +│ ├── audit.py |
| 104 | +│ ├── end_trial_analysis.py |
| 105 | +│ ├── helper_functions.py |
| 106 | +│ ├── __init__.py |
| 107 | +│ ├── .ipynb_checkpoints |
| 108 | +│ │ ├── end_trial_analysis-checkpoint.py |
| 109 | +│ │ └── helper_functions-checkpoint.py |
| 110 | +│ ├── model.py |
| 111 | +│ ├── parameters.py |
| 112 | +│ ├── patient.py |
| 113 | +│ ├── patients.csv |
| 114 | +│ ├── travel_matrix.csv |
| 115 | +│ ├── units.csv |
| 116 | +│ └── units.py |
| 117 | +``` |
| 118 | + |
| 119 | +::: |
| 120 | + |
| 121 | +## Suggested changes for protocol/template |
| 122 | + |
| 123 | +✅ = Made the change. |
| 124 | + |
| 125 | +Protocol: |
| 126 | + |
| 127 | +* Just suggestion not requirement to make notes about study, and make the notes within the logbook, as purpose is familiarising with study, and at this stage, may get details wrong! So rather than it be a seperate page where we're worried about getting it right, do it in logbook as still learning. |
| 128 | +* There's a balance between trying to understand the code, and just trying to run the code. Reading through and making notes on files is more along the lines of understanding, but without a direct purpose. Do we like it or not? It feels like a necessity, but it also feels a little unclear? Although perhaps that is ok. It felt like well used time to me, but would suggest not making it as prespective as I'd suggested, and that you and read and take notes if you like |
| 129 | + |
| 130 | +Thoughts as reading through code: |
| 131 | + |
| 132 | +* PEP8 of code (?) |
| 133 | +* Commenting/docstrings (if not already) in code (?) |
| 134 | +* Data not all stored in one place, mixing scripts and data |
| 135 | +* README stating what folders mean (e.g. vrp, took me a little while to realise this stood for vehicle routing problem) |
| 136 | +* Locations of parameters for simulation and finding them - convention is storing data seperately, but can be a little harder to spot where those parameters are |
0 commit comments