Model: remove unreleased step_duration parameter#3007
Merged
Conversation
Removes the step_duration parameter from the Model class to simplify the path toward making model.time the universal source of truth. Since step_duration has not been included in any release, it can be removed without deprecation.
|
Performance benchmarks:
|
quaquel
approved these changes
Dec 24, 2025
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.
Summary
Removes the
step_durationparameter fromModel.__init__(). Since this was added in #2903 but not yet released, it can be removed without deprecation.Motive
The
step_durationparameter conflicts with Mesa's direction of makingmodel.timethe universal source of truth and eventually deprecatingsteps. Having configurable step duration confuses the mental model (users must understand how discrete steps map to continuous time), complicates future migration (we'd need to explain what happens tostep_durationwhenstepsis deprecated), and serves limited real-world use cases (non-unit step durations are rarely needed and can be handled via discrete event simulators). Removing it now gives us simple, predictable behavior (eachstep()advances time by 1.0) and a clean path to eventually deprecatestepsin favor ofmodel.time.If our vision what that
model.stepsis a core feature, it made sense. But the direction is to move totime, so a new steps feature doesn't make much sense.I also violated the principle of atomic PRs by adding it in #2903. It should have been a separate discussion, PR and review process. Sorry.
Implementation
Remove from
Model.__init__():step_duration: float = 1.0parameterself._step_duration: float = step_durationattribute_wrapped_step()to useself.time += 1.0instead ofself.time += self._step_durationstep_durationfrom docstringAdditional Notes