Skip to content

Commit 75fb52a

Browse files
committed
Logbook and environment from trying out webplot, searching for code to reproduce scope, and creating environment
1 parent 76d1081 commit 75fb52a

File tree

3 files changed

+102
-6
lines changed

3 files changed

+102
-6
lines changed

evaluation/posts/2024_05_23/index.qmd

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,84 @@ More details on sim/ folder:
118118

119119
:::
120120

121+
### Untimed: Trying out WebPlotDigitizer
122+
123+
Tried using version 4, found it worked really well except:
124+
125+
* It couldn't differentiate confidence interval lines from the primary lines, which makes the resulting points hard to use.
126+
* The points extracted from these charts don't necessarily align with the points obtained from the simulation (i.e. line chart draws line through the days but points are at specific locations and not completely continuous).
127+
128+
Hence, I'm going to suggest that I don't think it is worth trying to use this tool, and that a simpler and more standardised approach would be visual comparison of figures, or overlaying of the figures when possible.
129+
130+
### NA: Compile items in scope
131+
132+
All items are figures, so no actions required.
133+
134+
### 12.10-12.15 Search for code that produces item in scope
135+
136+
`Capacity_Model_Template.ipynb` creates figures incredibly similar to the article. Can spot a few slight differences likely due to different parameters. Some examples:
137+
* Figure 2, slightly wider confidence intervals in the notebook
138+
* Figure 4 number of displaced patients, different "bumps" in the line
139+
140+
### 12.15-12.16 Identify dependencies
141+
142+
From article:
143+
144+
* DES on Intel i9-7980XE CPU with 64GB RAM running Ubuntu 19.10 Linux
145+
* Python 3.8
146+
147+
Within environment.yaml, can see packages and versions, to create a conda environment.
148+
149+
### 12.19-12.29 Create environment
150+
151+
Copied environment.yaml file into reproduction. Run the command `conda env create --name covid19 --file environment.yaml` from terminal within reproduction folder to create environment.
152+
153+
Found that:
154+
155+
* Received error CondaEnvException: Pip failed, for installing pip dependencies, Pip subprocess error: ImportError: libffi.so.7: cannot open shared object file: No such file or directory
156+
* Noticed it was including Spyder in the environment which is an IDE so removed that.
157+
158+
This was then successful, and built quickly (within 30s). A quick glance over the environment confirmed that it looked to have the correct python version and packages.
159+
160+
## Timings
161+
162+
```{python}
163+
from datetime import datetime
164+
165+
# --------------------------------------------------------------
166+
# Modify this section:
167+
168+
# Time in minutes that has been used prior to this day
169+
used_to_date = 73
170+
171+
# List of times from today (as string tuples in list)
172+
times = [
173+
('10.24', '11.00'),
174+
('12.10', '12.16'),
175+
('12.19', '12.29')]
176+
# --------------------------------------------------------------
177+
178+
FMT = '%H.%M'
179+
total_min = 0
180+
for t in times:
181+
# Convert to datetime object
182+
h0 = datetime.strptime(t[0], FMT)
183+
h1 = datetime.strptime(t[1], FMT)
184+
# Find difference in minutes and add to total
185+
total_min += (h1 - h0).total_seconds() / 60
186+
187+
# Time in hours and minutes
188+
print(f'Time spent today: {int(total_min)//60}h {int(total_min)%60}m')
189+
190+
# Find time remaining
191+
max = 40*60
192+
remain_min = max - total_min - used_to_date
193+
print(f'Time remaining: {int(remain_min//60)}h {int(remain_min%60)}m')
194+
195+
# Find proportion out of 40 hours
196+
print(f'Used {round((total_min+used_to_date)/max*100,1)}% of 40 hours max')
197+
```
198+
121199
## Suggested changes for protocol/template
122200

123201
✅ = Made the change.
@@ -126,6 +204,12 @@ Protocol:
126204

127205
* 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.
128206
* 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
207+
* Remove sugestion of WebPlotDigitizer etc., and instead suggest standardised approach of visually comparing the figures (with overlaying where possible done to support that - need to explore simplest way of doing that).
208+
* To end of 3.2.3, suggest displaying those within the scope page also (that would be untimed though? although currently time writing out of scope above as that is just part of defining scope... so maybe just include for simplicity?)
209+
* Modify 3.2.4 - as we describe the scope during 3.2.2
210+
* RE: reproduction package, having the figures created within the notebooks if really handy when spotting what parts of the code create figures from article
211+
* With regards to creating the environment, I think taking the simplest approach is appropriate - so using their environment file (or creating based on packages), and not worrying about operating system used. Could consider that with regards to troubleshooting though.
212+
* For 3.4.2, this is the first time we might start using and modifying materials, so important to note that we should COPY over any environment stuff into our reproduction folder/, and not directly run scripts in original_study/, those should stay untouched.
129213

130214
Thoughts as reading through code:
131215

reproduction/environment.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: covid19
2+
channels:
3+
- defaults
4+
dependencies:
5+
- jupyterlab=1.2.6
6+
- matplotlib=3.1.3
7+
- notebook=6.0.3
8+
- numpy=1.18.1
9+
- pandas=1.0.1
10+
- pip=20.0.2
11+
- pytest=5.3.5
12+
- python=3.8.1
13+
- scipy=1.4.1
14+
- seaborn=0.10.0
15+
- statsmodels=0.11.0
16+
- pip:
17+
- simpy==3.0.11
18+

reproduction/requirements.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)