Skip to content

Commit 241924d

Browse files
rhttpike3
authored andcommitted
UserParam: Add deprecation warning for UserSettableParameter
1 parent b3cf839 commit 241924d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

mesa/visualization/UserParam.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from numbers import Number
2+
from warnings import warn
3+
24

35
NUMBER = "number"
46
CHECKBOX = "checkbox"
@@ -65,6 +67,13 @@ def __init__(
6567
choices=None,
6668
description=None,
6769
):
70+
71+
warn(
72+
"UserSettableParameter is deprecated in favor of UserParam objects "
73+
"such as Slider, Checkbox, Choice, StaticText, NumberInput. "
74+
"See the examples folder for how to use them. "
75+
"UserSettableParameter will be removed in the next major release."
76+
)
6877
if choices is None:
6978
choices = list()
7079
if param_type not in self.TYPES:

tests/test_usersettableparam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Checkbox,
66
Choice,
77
StaticText,
8-
NumberInput
8+
NumberInput,
99
)
1010

1111

0 commit comments

Comments
 (0)