Skip to content

Model: remove unreleased step_duration parameter#3007

Merged
EwoutH merged 1 commit intomesa:mainfrom
EwoutH:remove_step_duration
Dec 24, 2025
Merged

Model: remove unreleased step_duration parameter#3007
EwoutH merged 1 commit intomesa:mainfrom
EwoutH:remove_step_duration

Conversation

@EwoutH
Copy link
Copy Markdown
Member

@EwoutH EwoutH commented Dec 24, 2025

Summary

Removes the step_duration parameter from Model.__init__(). Since this was added in #2903 but not yet released, it can be removed without deprecation.

Motive

The step_duration parameter conflicts with Mesa's direction of making model.time the universal source of truth and eventually deprecating steps. 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 to step_duration when steps is 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 (each step() advances time by 1.0) and a clean path to eventually deprecate steps in favor of model.time.

If our vision what that model.steps is a core feature, it made sense. But the direction is to move to time, 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.0 parameter
  • self._step_duration: float = step_duration attribute
  • Update _wrapped_step() to use self.time += 1.0 instead of self.time += self._step_duration
  • Remove step_duration from docstring

Additional Notes

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.
@EwoutH EwoutH requested a review from quaquel December 24, 2025 10:16
@EwoutH EwoutH added the maintenance Release notes label label Dec 24, 2025
@github-actions
Copy link
Copy Markdown

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +1.2% [+0.2%, +2.3%] 🔵 +0.4% [+0.3%, +0.5%]
BoltzmannWealth large 🔵 -1.1% [-3.0%, +0.7%] 🔵 -0.6% [-2.0%, +1.0%]
Schelling small 🔵 +0.0% [-1.1%, +1.1%] 🔵 +0.9% [+0.3%, +1.5%]
Schelling large 🔵 -0.4% [-1.4%, +0.7%] 🔵 -2.4% [-4.8%, -0.3%]
WolfSheep small 🔵 -2.8% [-3.7%, -2.0%] 🔵 -1.5% [-1.7%, -1.3%]
WolfSheep large 🟢 -5.4% [-9.0%, -3.2%] 🟢 -5.9% [-7.8%, -4.1%]
BoidFlockers small 🔵 -2.2% [-2.8%, -1.6%] 🔵 -0.5% [-0.6%, -0.3%]
BoidFlockers large 🔵 -0.7% [-1.4%, +0.0%] 🔵 -0.4% [-0.5%, -0.3%]

@EwoutH EwoutH merged commit f371ab5 into mesa:main Dec 24, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants