-
Notifications
You must be signed in to change notification settings - Fork 928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only set model_parameters once #2505
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would there be a way to test this behavior as part of our unit tests?
That is a serious bug and something that had been nagging me but did not investigate yet. Great you spotted it and fixed it. I will put some effort on the logging stuff because that would have helped in spotting this earlier. |
Performance benchmarks:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching it and fixing it. I will do a backport + release as soon as you merge.
Anything else we'll want to include in the backport?
Not right now, at least not in an easy way. This would require a integration test that combined solara viz, ModelController and ModelCreator. We don't have that yet |
3.0.3 with this fix is released. |
Summary
While working on a seed widget I saw a major bug in solara viz. Model_parameters get reset on every model reset. This is pretty serious and I think we need another bug release soon.
Bug / Issue
Describe the bug
Hitting "reset" in the ui resets the model, but also resets the model_parameters to their initial value.
To Reproduce
Run Schelling example. Reduce agent density. Hit reset. Works as expected. Hit reset again. Density is now restored.
Implementation
Use solaras
use_effect
to initialize model_parameters only once.screen-capture.webm