Docs: Fix ValueError in tutorial by adding default value to MoneyModel#2871
Merged
Docs: Fix ValueError in tutorial by adding default value to MoneyModel#2871
Conversation
Closed
tpike3
approved these changes
Nov 3, 2025
Member
There was a problem hiding this comment.
LGTM! Thanks @pragam-m25;
I went backwards and looked at the PR and then the issue.
I will let @EwoutH weigh in.
Right now my view is if this prevents a reoccurring issue with our dependencies then there is no harm in updating the tutorial with a default value, particularly the initial tutorial.
Contributor
Author
|
Hi @tpike3, thanks for the review and the approval! I'm glad this helps. |
EwoutH
approved these changes
Nov 3, 2025
Member
EwoutH
left a comment
There was a problem hiding this comment.
Sorry totally forgot, this is good to go. Thanks @pragam-m25!
Contributor
Author
|
No problem at all! Thanks for all your help and for getting it merged, @EwoutH! |
EwoutH
pushed a commit
that referenced
this pull request
Nov 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Problem:
The
MoneyModelclass defined in the "Introductory Tutorial" (0_first_model.ipynb) does not specify default values for its__init__parameters (e.g.,def __init__(self, n, seed=None):).This does not cause an error when running the tutorial notebook itself (as it calls
MoneyModel(10)), which is why the ReadTheDocs CI passes.However, it throws a
ValueError: Missing required model parameter: "n"when thisMoneyModelclass is used withModelPage(Solara), as Solara's visualization components require default values to build the UI. This error is reported in issue #2535.Solution:
This PR adds a default value (
n=10) to all three instances of theMoneyModel's__init__method in the tutorial, fixing the crash when used with Solara.Related Issue
Closes #2535
(This bug was not caught by CI, which is tracked in #2734)
Checklist