From 8620923d9c71443f52def4cf57860c18f974352a Mon Sep 17 00:00:00 2001 From: Samuel-AMAP Date: Thu, 4 Dec 2025 14:30:56 +0100 Subject: [PATCH] Small addendum to the list of PlantSimEngine Julia errors, also used to trigger the benchmarks yml --- .../plantsimengine_and_julia_troubleshooting.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/src/troubleshooting_and_testing/plantsimengine_and_julia_troubleshooting.md b/docs/src/troubleshooting_and_testing/plantsimengine_and_julia_troubleshooting.md index 06fca8d05..7a2be1c95 100644 --- a/docs/src/troubleshooting_and_testing/plantsimengine_and_julia_troubleshooting.md +++ b/docs/src/troubleshooting_and_testing/plantsimengine_and_julia_troubleshooting.md @@ -99,6 +99,21 @@ The syntax for an empty NamedTuple is `NamedTuple()`. If instead one types `()` Most of the following errors occur exclusively in multi-scale simulations, which has a slightly more complex API, but some are common to both single- and multi-scale simulations. +### ModelList/Mapping : providing a type name instead of an constructed instance + +```julia +m = ModelList(day=MyToyModel, week=MyToyModel2) +``` +This line is incorrect and will return +```julia +MethodError: no method matching inputs_(::Type{MyToyDayModel}) +``` + +The correct syntax is (assuming the corresponding constructor exists) : +```julia +m = ModelList(day=MyToyModel(), week=MyToyModel2()) +``` + ### Implementing a model: forgetting to import or prefix functions When implementing a model, you need to make sure that your implementation is correctly recognised as extending `PlantSimEngine` methods and types, and not writing new independent ones.