Bugs in SolaraViz?
Closed this issue · 2 comments
quaquel commented
I started working on #2427 and have run into three issues:
- If the model takes one or more arguments and those arguments are not part of the user-controllable parameters that are set from the UI, stuff will crash immediately
- Strangely, it crashes immediately even though we started SolaraViz with a valid model instance, so this points to a second bug: at the moment, the model shown after starting the UI is not the same as the original model with which the UI was initialized. Again, this is easy to reproduce. In the boltzman wealth model, in app.py, start the model with say a width and height of 20. Next, start Solara, and in the GUI, you'll see that the actual model has reverted back to 10 by 10 (as specified in
model_params
). - Seed is currently handled differently from other parameters. With #1940 merged, this is no longer needed, and seed can just be integrated into the user-specifiable parameters.
Corvince commented
Yes from looking at the code I can confirm these bugs. If user-setable parameters are provided the ModelCreator is set up and initializes a new model. This should not happen initially. But this raises the question how to work with models that need parameters, but those are not provided. Should reset just be disabled or should we create a helpful error message?
quaquel commented
- We should add to the docs that it is recommended to only use keyword argument in
Model.__ini__
- We should have an informative error. It might even be possible to use reflection to check the signature of the
__init__
and raise the exception immediately. I would advocate against aligning inputs from the UI with the order of arguments in the__init__
: when in doubt refuse the temptation to guess.