Skip to content

Remove seed kwarg#3318

Merged
quaquel merged 7 commits intomesa:mainfrom
quaquel:remove_seed
Feb 16, 2026
Merged

Remove seed kwarg#3318
quaquel merged 7 commits intomesa:mainfrom
quaquel:remove_seed

Conversation

@quaquel
Copy link
Copy Markdown
Member

@quaquel quaquel commented Feb 15, 2026

Seed was deprecated in Mesa 3. This PR removes it as an argument to model.Model(), cleans up the inner workings of model.Model related to seed, and modifies reset_rng to also reset model.random. Last, it updates all tutorials to use rng.

Note
I focused on just removing the deprecated seed argument. There is still a need for a separate decision on whether to keep rng as a separate argument or force users to always use Scenario or a Scenario subclass.

@quaquel quaquel added the breaking Release notes label label Feb 15, 2026
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.

Pre-approving, thanks for this and updating the tutorials.

We have to decide what we want to do with the user examples in mesa-examples. I think simple/low hanging fruit should be picked, but we might not want to update all as we remove/replace more complex stuff. We can also keep an tracking issue open and engage the community to help us.

Ideally we have some sort of guidelines for that so we don't have this discussion every PR that breaks examples in mesa-examples.

@EwoutH
Copy link
Copy Markdown
Member

EwoutH commented Feb 16, 2026

I wrote something up on how to handle this.

@quaquel
Copy link
Copy Markdown
Member Author

quaquel commented Feb 16, 2026

I opened a pr on mesa-examples for fixing this. I am merging this PP in the meantime.

@quaquel quaquel merged commit f7e038a into mesa:main Feb 16, 2026
13 of 15 checks passed
@quaquel quaquel deleted the remove_seed branch February 16, 2026 15:11
Krishsharma179 pushed a commit to Krishsharma179/mesa that referenced this pull request Feb 21, 2026
* remove seed kwarg

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* improve docstring

* update tutorials to use rng instead of seed

* Update 4_adding_space.ipynb

* 3 more tutorials

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@EwoutH EwoutH mentioned this pull request Mar 13, 2026
42 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants