From 46a6b8931899ccf1f1ce197a575d9a6baed49b7d Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Fri, 20 Sep 2024 22:27:19 +0200 Subject: [PATCH] Deprecate Time module and all its schedulers Add a warning message that all the whole time module and all its schedulers are deprecated --- mesa/time.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mesa/time.py b/mesa/time.py index 82de81859ac..28625a139a0 100644 --- a/mesa/time.py +++ b/mesa/time.py @@ -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