-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplify spread_spores
and nested functions
#37
Comments
Are you combining events in one_day function? If so, all these events can't possibly happen in a day. I checked the functions code, they seem logical in this order. Also, in the field spores are spread from infested stubble by rain splash and then they fall on host/get intercepted and finally infect. I am not if random integer from real is important. spores_each_wet_hour ->-> potentially_effective_spores ->-> spores_from_1_element ->-> splash_distance->-> splash_angle ->-> wind_distance ->-> wind_angle ->-> address_from_center_distance -> -> address_from_center_distance ->-> interception_probability ->-> adjust_for_interception ->-> successful_infections . I think it might be easier to divide functions based on |
Or you meant one_season function? |
I mean to keep most of the functions but organise them so they are not nested to the extent they currently are. So dropping down 3-4 layers of functions instead of the 7 as partially described above I think this will make it easier to maintain and make the code more readable. ie something like this New |
Okay. I'd change infected to spores. That is, spread_spores and intercept_spores because spores are being spread and intercepted (disease can't possibly be intercepted, once diseased, the story is over). That said, spore interception function may not be very relevant in our case as we're studying in splash dispersal within paddock, so spores should always fall on chickpea/host |
|
Thanks Adam! |
@IhsanKhaliq can you post a link to the graphic you have of the model please |
https://digital.library.adelaide.edu.au/dspace/bitstream/2440/75702/8/02whole.pdf Graphics are at the end of chapter 7 for of this thesis. I have already cut chapter 7 from the whole thesis for convenience |
Done in |
I am wondering if we need to have all the following functions nested within the function
spread_spores
. It might be easier to code it all into fewer nestings and cut down on passing parameters from the top function to the bottom function.Nesting as follows
trace_asco
->
one_day
->->
spread_spores
->->->
interception_probability
->->->
spores_each_wet_hour
->->->->
spores_from_1_element
->->->->->
potentially_effective_spores
->->->->->
wind_distance
->->->->->
splash_distance
->->->->->
splash_angle
->->->->->
address_from_center_distance
->->->->->
adjust_for_interception
->->->->->->
successful_infections
->->->->->->->
interception_probability
->->->->->->->
random_integer_from_real
each "->" indicates how many functions the named function is nested in
TBC....
The text was updated successfully, but these errors were encountered: