Deprecate model.steps in favor of model.time#3136
Merged
Conversation
Deprecates `model.steps` with a `FutureWarning` directing users to use `model.time` instead. The attribute will be removed in Mesa 4.0.
Updated the migration guide for Mesa 3.5 to note that `model.steps` is deprecated and will be removed in Mesa 4.0. Added instructions for migrating to `model.time` and provided code examples and references to relevant pull requests.
This comment was marked as off-topic.
This comment was marked as off-topic.
EwoutH
added a commit
to mesa/mesa-examples
that referenced
this pull request
Jan 14, 2026
Changed the test assertion to check the model's 'time' attribute equals 10.0 instead of 'steps' equaling 10. Removes a Mesa FutureWarning. See mesa/mesa#3136
Member
|
I agree with this. What else to deprecate in 3.5? At least |
quaquel
approved these changes
Jan 14, 2026
Member
Author
|
My suggestion would be:
|
Member
|
But then its a bit strange that you start removing stuff like the datacollector |
Member
Author
|
Yeah, I didn’t make this clear indeed:
|
Member
|
So that does mean at least |
Member
Author
As soon as we have branched of 3.x, we can move ContinuousSpace out of experimental. Since we’re then in 4.0 alpha, it isn’t immediately API frozen, but it will be after 4.0 stable. |
EwoutH
added a commit
to EwoutH/mesa
that referenced
this pull request
Jan 16, 2026
This reverts commit 7a9299c.
Harshini2411
pushed a commit
to Harshini2411/mesa-examples
that referenced
this pull request
Mar 16, 2026
Changed the test assertion to check the model's 'time' attribute equals 10.0 instead of 'steps' equaling 10. Removes a Mesa FutureWarning. See mesa/mesa#3136
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.
This PR was reverted in #3151 due to advancing insight.
Summary
Deprecates
model.stepswith aFutureWarningdirecting users to usemodel.timeinstead. The attribute will be removed in Mesa 4.0.Motive
Following the introduction of
model.timeas the universal source of truth for simulation time in #2903,model.stepsis now redundant.Implementation
self.stepstoself._steps(internal attribute)stepsproperty with getter and setter that:FutureWarningon accessself._steps_wrapped_step()to useself._stepsdirectly (avoiding deprecation warning in internal code)stepsfrom the public attributes listbatch_runchanges are in a separate commit, for an easy cherry pick if needed.Usage
Users will see this warning when accessing
model.steps:Migration Path
Checklist
model.timemodel.timemodel.time(or suppress expected warnings)Related
model.timeas universal source of truth for simulation time #2903