Skip to content

docs: Add Mesa 3.3+ version warnings to visualization tutorials#2949

Merged
quaquel merged 4 commits intomesa:mainfrom
Srinath0916:fix-issue-2837-visualization-version-warning
Jan 6, 2026
Merged

docs: Add Mesa 3.3+ version warnings to visualization tutorials#2949
quaquel merged 4 commits intomesa:mainfrom
Srinath0916:fix-issue-2837-visualization-version-warning

Conversation

@Srinath0916
Copy link
Copy Markdown
Contributor

  • Add prominent version requirement warnings to tutorials 4-8
  • Include upgrade instructions and alternative solutions
  • Resolves confusion for users on Mesa 3.2 following 3.3+ tutorials
  • Addresses missing classes like SpaceRenderer and AgentPortrayalStyle

Fixes #2837

Summary

Users following Mesa visualization tutorials encounter import errors when using Mesa 3.2 because the tutorials use classes introduced in Mesa 3.3, but don't clearly state version requirements.

Bug / Issue

Fixes #2837 - Users report confusion and import errors when following visualization tutorials. The tutorials use SpaceRenderer, AgentPortrayalStyle, and SolaraViz classes that don't exist in Mesa 3.2, but tutorials don't warn about version requirements.

Implementation

  • Added prominent version requirement warnings at the top of all visualization tutorials (4, 5, 6, 7, 8)
  • Each warning clearly states "Mesa 3.3 or later" requirement
  • Included upgrade instructions: pip install --upgrade mesa
  • Added note about using older tutorial versions as alternative
  • Added additional import warning in tutorial 4 for extra clarity

Testing

  • All pre-commit checks pass (ruff, pyupgrade, codespell)
  • Documentation-only changes, no code modifications
  • Consistent markdown formatting across all affected tutorials
  • Warnings are prominently placed and clearly visible

Additional Notes

This is a documentation-only fix that will prevent user confusion without any breaking changes. The warnings are designed to be helpful and provide clear next steps for users on older Mesa versions.

@Srinath0916
Copy link
Copy Markdown
Contributor Author

Hi @EwoutH , I've added the version warnings to all visualization tutorials as requested. The failing CI checks appear to be environment issues (Linux/macOS failing across Python versions, but Windows passes).

The documentation builds successfully and pre-commit checks pass. This should resolve the confusion users face when following Mesa 3.3+ tutorials with older versions.
Let me know if anything is needed.
Thanks.

@Srinath0916 Srinath0916 force-pushed the fix-issue-2837-visualization-version-warning branch from 14f2183 to 8c0f05c Compare December 12, 2025 11:29
@tpike3
Copy link
Copy Markdown
Member

tpike3 commented Dec 15, 2025

Thank you @Srinath0916 for doing this! Please take a look at my comment.

@Srinath0916 Srinath0916 force-pushed the fix-issue-2837-visualization-version-warning branch from 9b88b89 to c63ab48 Compare December 16, 2025 13:37
@Srinath0916 Srinath0916 requested a review from tpike3 December 16, 2025 13:42
@Srinath0916
Copy link
Copy Markdown
Contributor Author

Hi @tpike3 , Done, Removed the reference to older tutorial versions from all visualization tutorials. The warnings now only mention upgrading to Mesa 3.3+. Thanks for the feedback!
Its ready for final review.

@EwoutH
Copy link
Copy Markdown
Member

EwoutH commented Dec 17, 2025

Thanks for the PR. I agree we could inform users better about this.

I find this approach way too aggressive however. Check against mesa.__version__ and then popup a warning after import, but I don't think a plain markdown thing is the way to go.

@Srinath0916 Srinath0916 force-pushed the fix-issue-2837-visualization-version-warning branch from 65fd9eb to 507fc27 Compare December 17, 2025 11:41
@Srinath0916
Copy link
Copy Markdown
Contributor Author

Hey @EwoutH!

You're right, those warnings were way too aggressive. I've removed all the static markdown warnings from the tutorials. Much cleaner now and users will just get natural import errors if they need to upgrade.

Could you take another look? Thanks!

@EwoutH
Copy link
Copy Markdown
Member

EwoutH commented Dec 18, 2025

I've removed all the static markdown warnings from the tutorials. Much cleaner now and users will just get natural import errors if they need to upgrade.

I can't see mesa.__version__ being used anywhere?

@Mani212005
Copy link
Copy Markdown

Hi @EwoutH @Srinath0916 @tpike3 , I'd like to help implement the mesa.version check. Can I take over this ?

@Srinath0916 Srinath0916 force-pushed the fix-issue-2837-visualization-version-warning branch from 27bf31c to 648c115 Compare January 2, 2026 11:10
@Srinath0916
Copy link
Copy Markdown
Contributor Author

Hi @EwoutH @Srinath0916 @tpike3 , I'd like to help implement the mesa.version check. Can I take over this ?

Heyy @Mani212005 thanks for coming front, but i have added the mesa version, thanks!

@Srinath0916
Copy link
Copy Markdown
Contributor Author

Hey @EwoutH
I've added the mesa.version check. The tutorials now check the version dynamically and show a warning only when Mesa < 3.3 is detected.

Note: There's one unrelated test failure in the Schelling visualization test (Playwright screenshot issue), but all other tests pass and this failure isn't related to our version checking changes.

Could you take another look? Thanks!

- Add prominent version requirement warnings to tutorials 4-8
- Include upgrade instructions and alternative solutions
- Resolves confusion for users on Mesa 3.2 following 3.3+ tutorials
- Addresses missing classes like SpaceRenderer and AgentPortrayalStyle

Fixes mesa#2837
Address maintainer feedback by removing the line about following
older tutorial versions since no links are available.

Co-authored-by: tpike3
- Remove prominent markdown version warnings from tutorials 4-8
- Keep tutorial content clean and focused on actual content
- Users will get natural import errors with helpful messages if using older Mesa
- Addresses maintainer feedback for less aggressive approach

Resolves mesa#2837
- Add dynamic version check using mesa.__version__ in all visualization tutorials
- Shows warning only when Mesa < 3.3 is detected
- Clean, non-aggressive approach that appears after import
- Addresses @EwoutH's specific feedback about version checking
@EwoutH EwoutH force-pushed the fix-issue-2837-visualization-version-warning branch from 648c115 to 65398b8 Compare January 2, 2026 12:36
Copy link
Copy Markdown
Member

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me this would work, curious what @tpike3 thinks.

@quaquel quaquel merged commit 96a8f58 into mesa:main Jan 6, 2026
13 of 14 checks passed
@quaquel quaquel added the docs Release notes label label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing classes for vizualization

5 participants