Repository navigation
docs: fix outdated snippets in overview, best-practices and visualization API pages - #3895
Merged
Merged
Conversation
Update docs that still used removed APIs or broken code: - best-practices: use Agent(model) and rng= instead of seed=/_seed - overview: replace removed mesa.space.ContinuousSpace with mesa.experimental.continuous_space, pass method to shuffle_do, add missing Slider/AgentPortrayalStyle imports - apis/visualization: use rng=None and fix tutorial links Fixes mesa#3894
tpike3
approved these changes
Sep 30, 2026
tpike3
left a comment
Member
There was a problem hiding this comment.
Thanks @Shivansh1205! Any more help with the tutorials would be greatly appreciated to include testing binder and colab links and functioning.
EwoutH
pushed a commit
that referenced
this pull request
Oct 28, 2026
…3895) Update docs that still used removed APIs or broken code: - best-practices: use Agent(model) and rng= instead of seed=/_seed - overview: replace removed mesa.space.ContinuousSpace with mesa.experimental.continuous_space, pass method to shuffle_do, add missing Slider/AgentPortrayalStyle imports - apis/visualization: use rng=None and fix tutorial links Fixes #3894 (cherry picked from commit 2ac2da6)
EwoutH
added a commit
that referenced
this pull request
Oct 28, 2026
The backport of #3895 said mesa.space has been removed, which is only true on main (4.0). In 3.5.x it is still available in maintenance-only mode.
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.
Pre-PR Checklist
Summary
Several docs pages still show code that fails on current Mesa: removed APIs (
Model(seed=...),mesa.space), ashuffle_do()call with no method, missing imports, and broken tutorial links.Bug / Issue
Fixes #3894
The migration guide already documents that
seedandmesa.spacewere removed, butoverview.md,best-practices.mdandapis/visualization.mdwere never updated. Copying their snippets givesTypeErrororModuleNotFoundError.Implementation
docs/best-practices.md__init__(self, model, ...)/super().__init__(model).rng=instead ofseed=, drops the nonexistentmodel._seed, mentionsself.rng, and correctly says unseeded runs draw from OS entropy.docs/overview.mdmesa.experimental.continuous_space.ContinuousSpace/ContinuousSpaceAgentwith the[[0, x_max], [0, y_max]]dimensions format, as in the boid_flockers example.mesa.spacehas been removed instead of calling it "maintenance-only".agent_group.shuffle_do()is nowagent_group.shuffle_do("step").SliderandAgentPortrayalStyleimports to the visualization example.docs/apis/visualization.mdseed=Noneis nowrng=None.6_visualization_basic,7_visualization_dynamic_agentsand10_visualization_custom.Testing
I ran a script against this branch (
uv run --with-editable ".[viz,network]"). It checks that each old snippet fails and each new snippet works:The imports
Slider,SolaraViz,make_space_component,make_plot_componentandAgentPortrayalStyleall resolve. The new link targets exist underdocs/tutorials/.Additional Notes
Docs-only change, no code changes. I left
docs/migration_guide.mdalone: itsseed=/unique_idexamples are intentional historical "before" snippets.