cesaraustralia / Dispersal.jl

Tools for simulating organism dispersal
Other
21 stars 3 forks source link

cleanup rule syntax #85

Closed rafaqz closed 3 years ago

rafaqz commented 3 years ago

Description

This PR is proposing a simpler more mathy syntax to use for rules. After writing the paper I realise it's a lot easier to read. Nothing is changed logically except some unused return values for applyrule! that needed change with this syntax, but should be nothing, not state or N.

So: I've used N everywhere to represent populations, as in classic growth formulas. Rates are represented with r. Carrying capacity is k. But in the structs they have the full name, so the code self documents instead of being indecipherable math:

k = get(data, rule.carrycap, I...) 

Also, I is for the cell index, following Julia standard syntax for a tuple of indices.

@virgile-baudrot we are moving to having code review of any changes in Dispersal.jl so that no one person is totally responsible for formulations being correct (me right now). These are just minor issues with no actual changes to get that started. But In future formulations should all be reviewed by someone else before they are merged, not that we will add or change things here very often.

Checklist:

rafaqz commented 3 years ago

using letters rather than names, we should make sure it's always the same physical object behind? Or maybe it has only to be relevant within an applyrule?

You mean accross the package? I think yes as much as possible... the variable names should mean the same thing in every applyrule method. It does make it easier to understand.

I think also for non-canonical names we should still use a name instead of a letter. Maybe only use letters if there is a familiar precedent?