Skip to content

Commit 1a8f3d1

Browse files
authored
Merge pull request #172 from VirtualPlantLab/julia-docs-mini-addendum
Small addendum to the list of PlantSimEngine Julia errors
2 parents 9a4d9d4 + 8620923 commit 1a8f3d1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

docs/src/troubleshooting_and_testing/plantsimengine_and_julia_troubleshooting.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ The syntax for an empty NamedTuple is `NamedTuple()`. If instead one types `()`
9999
100100
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.
101101
102+
### ModelList/Mapping : providing a type name instead of an constructed instance
103+
104+
```julia
105+
m = ModelList(day=MyToyModel, week=MyToyModel2)
106+
```
107+
This line is incorrect and will return
108+
```julia
109+
MethodError: no method matching inputs_(::Type{MyToyDayModel})
110+
```
111+
112+
The correct syntax is (assuming the corresponding constructor exists) :
113+
```julia
114+
m = ModelList(day=MyToyModel(), week=MyToyModel2())
115+
```
116+
102117
### Implementing a model: forgetting to import or prefix functions
103118
104119
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.

0 commit comments

Comments
 (0)