Contributing

Bug reports and pull requests are welcome on GitHub.

Running the tests

Add your checkout with Pkg.develop, then run these from Julia's default environment:

julia --startup-file=no test/current.jl unit        # quick tests of the parts
julia --startup-file=no test/current.jl             # everything
julia --startup-file=no test/current.jl benchmark   # recovery from noisy data on full-size models
julia --startup-file=no test/current.jl examples    # estimates the example models

Run the full suite for any change that touches estimation. unit is for quick iteration and does not replace it.

examples estimates each model in ODEParameterEstimation.Examples with default options and checks the answer against test/example_expectations.jl. It takes about twenty minutes. A few models take many minutes each; those are in a group of their own, examples_slow, which estimates each model in a Julia process of its own. Both run weekly. Every push runs examples_ci, five models chosen in that file. A new example model needs an entry there.

To check that the package installs and passes with dependencies taken from the registry only, with none of your local development versions:

julia --startup-file=no test/registered.jl

Precompiling

While the package is precompiled it estimates a small model, so that most of what estimate needs is compiled before anyone calls it. With that step, precompiling takes about six minutes every time src changes. Without it, it takes half a minute. To skip it while you work, put this in a LocalPreferences.toml beside the Project.toml of the environment you develop in:

[ODEParameterEstimation]
precompile_workload = false

Julia also reads that file from your default environment when another environment is active, so a setting left there reaches every environment that does not set its own.

Take it out again before you time anything or run the tests for the last time. While it is there, they run on a package precompiled without that step.

Building this manual

julia --startup-file=no --project=docs -e 'using Pkg; Pkg.instantiate()'
julia --startup-file=no --project=docs docs/make.jl

The pages are in docs/src. Their examples run during the build, so a page that builds is a page whose code works. Open docs/build/index.html to read the result.

Writing code

  • Functions and variables are snake_case, types are PascalCase.
  • Tolerances are abstol and reltol. A function that takes the problem or the model takes it as its first argument.
  • Use OrderedDict for parameters and states, so their order is fixed.
  • Give each function a docstring with Arguments and Returns sections.
  • A change a user can see needs its page in this manual and its docstring changed with it. ?EstimationOptions names every option, and a test checks that it does.

Engineering notes

docs/internal has a few notes for people working on the package: how the polynomial systems are built and solved, why the precompile step and the column scaling work as they do, and where the code adapted from other packages came from.