Closed AtiyahElsheikh closed 1 year ago
It is also possible to unify the calling to create* function by overloading such functions, e.g.
createX(pars::DemographyPars) = createX(populationPars(pars))
Proposed solution:
createPyramidPopulation(pars::DemographyPars) =
createPyramidPopulation_(populationParameters(pars))
function createPyramidPopulation_(pars) # The _ is to make the function internal to the module
# implementation
...
All the above lines makes it clear what is the type of the argument and unify the calls to Create functions*
Nothing against idiomatic code as long as code readability and safety is preserved (or even enhanced). There are many cases in the code where this is subject to improvements. As an example:
In Version 0.1.3, Create Module
The following APIs
function createTowns(pars) ...
function createPopulation(pars) ...
correspond to arguments of different parameter types. Two improvements could be followed:
either using clear identifier names
function createTowns(mappars) ...
or static typing
function createTowns(pars::MapPars) ...
The code shall be improved whenever possible and not just related to milestone V0.2