Conversation
The notebook still used the Mesa 2-era batch running API and an old DataCollector attribute name, so it failed on the first import cell and again at every batch-run cell. Verified against mesa 4.0.0a0, which is what CI installs via `pip install mesa --pre`: * `mesa.batchrunner` no longer exists, and neither does `mesa.batch_run` -- the whole batch runner was removed in Mesa 4. `mesa.experimental.scenarios` ships only `Scenario` in 4.0.0a0; `run_scenarios` is on Mesa main but not in any released version. The sweep is therefore an explicit loop over the density values, which reads clearly in a tutorial notebook and works on both Mesa 3 and Mesa 4. * `fire.dc` is now `fire.datacollector`. * The batch cells now build their own DataFrame, so the reported fraction keeps the `BurnedOut` name the surrounding text and plots already use. * The notebook's inline `OrthogonalMooreGrid` now takes `random=self.random`, matching `forest_fire/model.py`. Without it Mesa 4 warns that the model is not reproducible. `fire.run_model()` is *not* removed in Mesa 4 -- it still runs the model until `running` goes false -- so those cells are unchanged. Outputs were regenerated from a clean mesa 4.0.0a0 run, which also updates the prose about how many steps the fire takes to burn out. Fixes mesa#421 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
pre-commit.ci failed on the regenerated notebook outputs: codespell reads the base64 payload of the embedded plot PNGs as text and reports "fO" and "wHN" as misspellings of "of" and "when". Add both to .codespellignore, which already carries "nD" from the same kind of false positive, and give the file the trailing newline it was missing so the last entry stays on its own line.
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.
The notebook still used the Mesa 2-era batch running API and an old DataCollector attribute name, so it failed on the first import cell and again at every batch-run cell.
Verified against mesa 4.0.0a0, which is what CI installs via
pip install mesa --pre:mesa.batchrunnerno longer exists, and neither doesmesa.batch_run-- the whole batch runner was removed in Mesa 4.mesa.experimental.scenariosships onlyScenarioin 4.0.0a0;run_scenariosis on Mesa main but not in any released version. The sweep is therefore an explicit loop over the density values, which reads clearly in a tutorial notebook and works on both Mesa 3 and Mesa 4.fire.dcis nowfire.datacollector.BurnedOutname the surrounding text and plots already use.OrthogonalMooreGridnow takesrandom=self.random, matchingforest_fire/model.py. Without it Mesa 4 warns that the model is not reproducible.fire.run_model()is not removed in Mesa 4 -- it still runs the model untilrunninggoes false -- so those cells are unchanged.Outputs were regenerated from a clean mesa 4.0.0a0 run, which also updates the prose about how many steps the fire takes to burn out.
Fixes #421
Thanks for opening a PR! Please click the
Previewtab and select a PR template: