Skip to content

Commit b7f43a6

Browse files
committed
docs(log): update log
1 parent 2c3086d commit b7f43a6

File tree

1 file changed

+38
-12
lines changed

1 file changed

+38
-12
lines changed

docs/log.md

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Used [llm_simpy/notebooks/03_stroke/00_stress/](https://github.com/pythonhealthd
2020

2121
Renamed and created environment.
2222

23-
> **Reflections:**
24-
>
23+
> 💡 **Reflections...**
24+
>
2525
> * Could encourage / suggestion Allyon 2021 [Keeping modelling notebooks with TRACE: Good for you and good for environmental research and management support](https://www.sciencedirect.com/science/article/pii/S1364815220309890).
2626
> * Template README could have space for orcid.
2727
> * Would have been handy for template README to give an example of giving credit to template.
@@ -172,27 +172,53 @@ Also, we could import these values from a file as well? For now though, will sti
172172

173173
Then I ran pylint, and add pylint disablers for too many arguments.
174174

175-
> **Reflections:**
176-
>
177-
> * Handy to consider this way of structuring, for models with lots of parameters (which can be fairly common).
175+
> 💡Handy to consider this way of structuring, for models with lots of parameters (which can be fairly common).
178176
179177
## Clearing out
180178

181179
I removed most files... it was overwhelming and tricky to work with, if I am changing and breaking things, and that breaks all my tests, and so on.
182180

183-
> **Reflections:**
184-
>
185-
> I realise the templates are a little daunting - and I wrote them! Getting started with this, I did the strategy of essentially "clearing things away" - and then referring back to them as I got set up again. Perhaps a more useable / accessible version of these templates would be structuring them as step-by-step quarto books. Because that's essentially how am I treating them - AND that is how I learnt best, when I was learning DES, is working through step-by-step with the HSMA book, building it up. So these templates are me having worked out how to implement everything we want - and then the applied examples is stress testing / real life testing, figuring out how we work through, where we make changes - and using all that then to write step-by-step tutorial books. One for Python, one for R. Step-by-step walkthough of RAP DES in XYZ.
181+
> 💡 I realise the templates are a little daunting - and I wrote them! Getting started with this, I did the strategy of essentially "clearing things away" - and then referring back to them as I got set up again. Perhaps a more useable / accessible version of these templates would be structuring them as step-by-step quarto books. Because that's essentially how am I treating them - AND that is how I learnt best, when I was learning DES, is working through step-by-step with the HSMA book, building it up. So these templates are me having worked out how to implement everything we want - and then the applied examples is stress testing / real life testing, figuring out how we work through, where we make changes - and using all that then to write step-by-step tutorial books. One for Python, one for R. Step-by-step walkthough of RAP DES in XYZ.
186182
187183
## Back to parameters
188184

185+
### Refactoring
186+
187+
With so many parameters, I feel like it maybe makes sense to seperate out the code more than I did in the template, so have changed from `model.py` to `parameters.py`
188+
189+
> 💡 Could the location of functions in the template do with reorganising? What is clearest?
190+
191+
### Playing with them
192+
193+
I wanted to try out using the classes to make sure they work. I created a disposable notebook to play around with them in.
194+
195+
> 💡 Should be clear how we do this early on, so can play about with it.
196+
197+
I realised dataclasses don't allow you to call ASUArrivals(stroke=4), as they are recognised as attributes, but only recognised as parameters when you type hint ie.
198+
199+
```
200+
@dataclass
201+
class ASUArrivals:
202+
stroke: float = 1.2
203+
tia: float = 9.3
204+
neuro: float = 3.6
205+
other: float = 3.2
206+
207+
ASUArrivals(stroke=4)
208+
```
209+
210+
I don't want this weird/hidden-feeling behaviour, especially as people say type hints shouldn't functionally affect your code in Python, and so will stick with normal classes.
211+
189212
### Preventing addition of new attributes
190213

191214
From writing the templates, I know how important it is that we prevent the addition of new attributes.
192215

193216
In python, I do this using a method in the parameter class. This is also possible in R if set up as a R6Class, but I chose to use a function for simplicity, so that instead checks the parameters when they are input to model. The downside of that approach as it will check every time the model is called (i.e. with each replication).
194217

195-
> **Reflections:**
196-
>
197-
> * Emphasising the importance of this, that it's not just something to drop.
198-
> * Using the dataclasses, our provided method for preventing the addition of new attributes no longer works.
218+
However, an alternative would be for my parameter classes to **inherit** from a main class with that functionality.
219+
220+
> 💡 Emphasise the importance of this, that it's not just something to drop.
221+
222+
> 💡 When using the dataclasses, our provided method for preventing the addition of new attributes no longer works.
223+
224+
I set up the **parent class**, and then add **tests** which check this is functioning properly.

0 commit comments

Comments
 (0)