Skip to content

fix: replace deprecated seed= with rng= in all example models#290

Open
ospreyboi wants to merge 1 commit intomesa:mainfrom
ospreyboi:fix/replace-seed-with-rng-in-examples
Open

fix: replace deprecated seed= with rng= in all example models#290
ospreyboi wants to merge 1 commit intomesa:mainfrom
ospreyboi:fix/replace-seed-with-rng-in-examples

Conversation

@ospreyboi
Copy link
Copy Markdown
Contributor

Fixes part of #273
All three example models (negotiation, sugarscrap_g1mt, epstein_civil_violence) were using the deprecated seed= parameter in both model.py and app.py files. This causes it to create a FutureWarning in Mesa 3.5 and will break in Mesa 4.0.
This replaces all occurrences of seed=None with rng=None in the function signatures and super().init(seed=seed) with super().init(rng=rng) in all three examples.
All 285 tests pass after the changes made.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4d9395c7-d066-4d73-95f0-596537127117

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wang-boyu wang-boyu added the depedency Release notes label label Apr 11, 2026
@wang-boyu
Copy link
Copy Markdown
Member

Thanks for sending the PR. I'd prefer to have it as part of #273 when we migrate to Mesa 4. Currently mesa-llm has mesa pinned <4 (#272).

Another reason is that switching examples to rng= causes a Solara seed-reset issue on Mesa 3.x. It is fixed in Mesa 4 (see mesa/mesa#3518) but has not been backported to any 3.x release yet. If a future Mesa 3.x release backports this fix, we can revisit merging this earlier before #273, since it's also compatible with Mesa 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

depedency Release notes label mesa-4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants