Skip to content

Commit

Permalink
UserParam: Add deprecation warning for UserSettableParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
rht authored and tpike3 committed May 27, 2022
1 parent b3cf839 commit 241924d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions mesa/visualization/UserParam.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from numbers import Number
from warnings import warn


NUMBER = "number"
CHECKBOX = "checkbox"
Expand Down Expand Up @@ -65,6 +67,13 @@ def __init__(
choices=None,
description=None,
):

warn(
"UserSettableParameter is deprecated in favor of UserParam objects "
"such as Slider, Checkbox, Choice, StaticText, NumberInput. "
"See the examples folder for how to use them. "
"UserSettableParameter will be removed in the next major release."
)
if choices is None:
choices = list()
if param_type not in self.TYPES:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_usersettableparam.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Checkbox,
Choice,
StaticText,
NumberInput
NumberInput,
)


Expand Down

0 comments on commit 241924d

Please sign in to comment.