Skip to content

Commit

Permalink
Deprecate Time module and all its schedulers
Browse files Browse the repository at this point in the history
Add a warning message that all the whole time module and all its schedulers are deprecated
  • Loading branch information
EwoutH committed Sep 20, 2024
1 parent 7d4a4af commit 46a6b89
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mesa/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
from mesa.agent import Agent, AgentSet
from mesa.model import Model

# Throw module-level deprecation warning
warnings.warn(
"The time module and all its Schedulers are deprecated and will be removed in a future version. "
"They can be replaced with AgentSet functionality. See the migration guide for details. "
"https://mesa.readthedocs.io/en/latest/migration_guide.html#time-and-schedulers",
DeprecationWarning,
stacklevel=2,
)

# BaseScheduler has a self.time of int, while
# StagedActivation has a self.time of float
TimeT = float | int
Expand Down

0 comments on commit 46a6b89

Please sign in to comment.