-
Notifications
You must be signed in to change notification settings - Fork 940
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
Update tutorials to use create_agents
and rng.integers
#2541
Update tutorials to use create_agents
and rng.integers
#2541
Conversation
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 the PR!
I did assign @ashish-nagmoti to issue #2537 by the way. Next time please do check if an issue is assigned, and if it is, ask first. @ashish-nagmoti would you like to review this PR instead? |
In the latest update I have changed the arguments to be more explicit in
to make positioning of agents better |
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.
I’m good, but let’s see if Jan also is.
I am fine with this, although I personally would prefer to move |
Personally I won't bother with updating the old spaces, we will replace them soon anyways. @DarshPareek Could you make your PR title and description a bit more clear/descriptive? |
Thank you for the suggestion! I'll revise the PR title and description to better reflect the changes made. Please let me know if there’s anything specific you'd like included. |
.pre-commit-config.yaml
Outdated
@@ -32,3 +32,7 @@ repos: | |||
"--ignore-words", | |||
".codespellignore", | |||
] | |||
exclude: > |
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.
Sorry, I totally missed this in earlier reviews. Why are we excluding all notebooks from Codespell?
If there’s a certain word you would like to use, you can add it to .codespellignore
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.
okay i will change that
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.
Could you please remove all changes to .codespellignore?
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.
If i don't add words to .codespellignore the pre-commit check fails on the branch, If I remove them is there any workaround the check?
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.
This still needs to be cleaned up
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.
I have cleaned it up.
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.
Final things done in f4b7eb6.
7063422
to
af14f2f
Compare
I have cleared the outputs and removed the words from .codespellignore, let me know if any further changes are needed. |
Cleaned up the final things, merging. Thanks @DarshPareek! |
create_agents
and rng.integers
Thanks! I would love to contribute in future. |
O### Summary
Updates the tutorials to align with Mesa 3.1's recommended practices for agent creation and random number generation.
Motive
The changes make the tutorials consistent with Mesa 3.1 by:
create_agents
class method instead of individual agent creation in loopsrandom.randrange
withrng.integers
for position generationImplementation
Made consistent updates across
intro_tutorial.ipynb
andMoneyModel.py
:Old approach:
New approach:
Old approach:
New approach:
Usage Examples
Example of the updated model initialization:
Closes #2537.