We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
UX: Split UserSettableParameter into various classes
What if, instead of
```python
number_option = UserSettableParameter('number', 'My Number', value=123)
boolean_option = UserSettableParameter('checkbox', 'My Boolean', value=True)
slider_option = UserSettableParameter('slider', 'My Slider', value=123, min_value=10, max_value=200, step=0.1)
```

we do
```python
number_option = Number("My Number", 123)
boolean_option = Checkbox("My boolean", True)
slider_option = Slider("My slider", 123, min=10, max=200, step=0.1)
```

In addition to looking simpler, more importantly, this allows users to define their own UserParam class.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mesa/visualization/UserParam.py`
Content:
```
1 NUMBER = "number"
2 CHECKBOX = "checkbox"
3 CHOICE = "choice"
4 SLIDER = "slider"
5 STATIC_TEXT = "static_text"
6 
7 
8 class UserSettableParameter:
9     """A class for providing options to a visualization for a given parameter.
10 
11     UserSettableParameter can be used instead of keyword arguments when specifying model parameters in an
12     instance of a `ModularServer` so that the parameter can be adjusted in the UI without restarting the server.
13 
14     Validation of correctly-specified params happens on startup of a `ModularServer`. Each param is handled
15     individually in the UI and sends callback events to the server when an option is updated. That option is then
16     re-validated, in the `value.setter` property method to ensure input is correct from the UI to `reset_model`
17     callback.
18 
19     Parameter types include:
20         - 'number' - a simple numerical input
21         - 'checkbox' - boolean checkbox
22         - 'choice' - String-based dropdown input, for selecting choices within a model
23         - 'slider' - A number-based slider input with settable increment
24         - 'static_text' - A non-input textbox for displaying model info.
25 
26     Examples:
27 
28     # Simple number input
29     number_option = UserSettableParameter('number', 'My Number', value=123)
30 
31     # Checkbox input
32     boolean_option = UserSettableParameter('checkbox', 'My Boolean', value=True)
33 
34     # Choice input
35     choice_option = UserSettableParameter('choice', 'My Choice', value='Default choice',
36                                           choices=['Default Choice', 'Alternate Choice'])
37 
38     # Slider input
39     slider_option = UserSettableParameter('slider', 'My Slider', value=123, min_value=10, max_value=200, step=0.1)
40 
41     # Static text
42     static_text = UserSettableParameter('static_text', value="This is a descriptive textbox")
43     """
44 
45     NUMBER = NUMBER
46     CHECKBOX = CHECKBOX
47     CHOICE = CHOICE
48     SLIDER = SLIDER
49     STATIC_TEXT = STATIC_TEXT
50 
51     TYPES = (NUMBER, CHECKBOX, CHOICE, SLIDER, STATIC_TEXT)
52 
53     _ERROR_MESSAGE = "Missing or malformed inputs for '{}' Option '{}'"
54 
55     def __init__(
56         self,
57         param_type=None,
58         name="",
59         value=None,
60         min_value=None,
61         max_value=None,
62         step=1,
63         choices=None,
64         description=None,
65     ):
66         if choices is None:
67             choices = list()
68         if param_type not in self.TYPES:
69             raise ValueError(f"{param_type} is not a valid Option type")
70         self.param_type = param_type
71         self.name = name
72         self._value = value
73         self.min_value = min_value
74         self.max_value = max_value
75         self.step = step
76         self.choices = choices
77         self.description = description
78 
79         # Validate option types to make sure values are supplied properly
80         msg = self._ERROR_MESSAGE.format(self.param_type, name)
81         valid = True
82 
83         if self.param_type == self.NUMBER:
84             valid = not (self.value is None)
85 
86         elif self.param_type == self.SLIDER:
87             valid = not (
88                 self.value is None or self.min_value is None or self.max_value is None
89             )
90 
91         elif self.param_type == self.CHOICE:
92             valid = not (self.value is None or len(self.choices) == 0)
93 
94         elif self.param_type == self.CHECKBOX:
95             valid = isinstance(self.value, bool)
96 
97         elif self.param_type == self.STATIC_TEXT:
98             valid = isinstance(self.value, str)
99 
100         if not valid:
101             raise ValueError(msg)
102 
103     @property
104     def value(self):
105         return self._value
106 
107     @value.setter
108     def value(self, value):
109         self._value = value
110         if self.param_type == self.SLIDER:
111             if self._value < self.min_value:
112                 self._value = self.min_value
113             elif self._value > self.max_value:
114                 self._value = self.max_value
115         elif self.param_type == self.CHOICE:
116             if self._value not in self.choices:
117                 print(
118                     "Selected choice value not in available choices, selected first choice from 'choices' list"
119                 )
120                 self._value = self.choices[0]
121 
122     @property
123     def json(self):
124         result = self.__dict__.copy()
125         result["value"] = result.pop(
126             "_value"
127         )  # Return _value as value, value is the same
128         return result
129 
130 
131 class UserParam:
132     _ERROR_MESSAGE = "Missing or malformed inputs for '{}' Option '{}'"
133 
134     @property
135     def json(self):
136         result = self.__dict__.copy()
137         result["value"] = result.pop(
138             "_value"
139         )  # Return _value as value, value is the same
140         return result
141 
142     def maybe_raise_error(self, valid):
143         if not valid:
144             msg = self._ERROR_MESSAGE.format(self.param_type, self.name)
145             raise ValueError(msg)
146 
147     @property
148     def value(self):
149         return self._value
150 
151     @value.setter
152     def value(self, value):
153         self._value = value
154 
155 
156 class Slider(UserParam):
157     """
158     A number-based slider input with settable increment.
159 
160     Example:
161 
162     slider_option = Slider("My Slider", value=123, min_value=10, max_value=200, step=0.1)
163     """
164 
165     def __init__(
166         self,
167         name="",
168         value=None,
169         min_value=None,
170         max_value=None,
171         step=1,
172         description=None,
173     ):
174         self.param_type = SLIDER
175         self.name = name
176         self._value = value
177         self.min_value = min_value
178         self.max_value = max_value
179         self.step = step
180         self.description = description
181 
182         # Validate option type to make sure values are supplied properly
183         valid = not (
184             self.value is None or self.min_value is None or self.max_value is None
185         )
186         self.maybe_raise_error(valid)
187 
188     @property
189     def value(self):
190         return self._value
191 
192     @value.setter
193     def value(self, value):
194         self._value = value
195         if self._value < self.min_value:
196             self._value = self.min_value
197         elif self._value > self.max_value:
198             self._value = self.max_value
199 
200 
201 class Checkbox(UserParam):
202     """
203     Boolean checkbox.
204 
205     Example:
206 
207     boolean_option = Checkbox('My Boolean', True)
208     """
209 
210     def __init__(self, name="", value=None, description=None):
211         self.param_type = CHECKBOX
212         self.name = name
213         self._value = value
214         self.description = description
215 
216         # Validate option type to make sure values are supplied properly
217         valid = isinstance(self.value, bool)
218         self.maybe_raise_error(valid)
219 
220 
221 class Choice(UserParam):
222     """
223     String-based dropdown input, for selecting choices within a model
224 
225     Example:
226     choice_option = Choice(
227         'My Choice',
228         value='Default choice',
229         choices=['Default Choice', 'Alternate Choice']
230     )
231     """
232 
233     def __init__(self, name="", value=None, choices=None, description=None):
234         self.param_type = CHOICE
235         self.name = name
236         self._value = value
237         self.choices = choices
238         self.description = description
239 
240         # Validate option type to make sure values are supplied properly
241         valid = not (self.value is None or len(self.choices) == 0)
242         self.maybe_raise_error(valid)
243 
244     @property
245     def value(self):
246         return self._value
247 
248     @value.setter
249     def value(self, value):
250         self._value = value
251         if self._value not in self.choices:
252             print(
253                 "Selected choice value not in available choices, selected first choice from 'choices' list"
254             )
255             self._value = self.choices[0]
256 
257 
258 class StaticText(UserParam):
259     """
260     A non-input textbox for displaying model info.
261 
262     Example:
263     static_text = StaticText("This is a descriptive textbox")
264     """
265 
266     def __init__(self, value=None):
267         self.param_type = STATIC_TEXT
268         self._value = value
269         valid = isinstance(self.value, str)
270         self.maybe_raise_error(valid)
271
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mesa/visualization/UserParam.py b/mesa/visualization/UserParam.py
--- a/mesa/visualization/UserParam.py
+++ b/mesa/visualization/UserParam.py
@@ -1,3 +1,7 @@
+from numbers import Number
+from warnings import warn
+
+
 NUMBER = "number"
 CHECKBOX = "checkbox"
 CHOICE = "choice"
@@ -63,6 +67,13 @@
         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:
@@ -268,3 +279,19 @@
         self._value = value
         valid = isinstance(self.value, str)
         self.maybe_raise_error(valid)
+
+
+class NumberInput(UserParam):
+    """
+    a simple numerical input
+
+    Example:
+    number_option = NumberInput("My Number", value=123)
+    """
+
+    def __init__(self, name="", value=None, description=None):
+        self.param_type = NUMBER
+        self.name = name
+        self._value = value
+        valid = isinstance(self.value, Number)
+        self.maybe_raise_error(valid)

{"golden_diff": "diff --git a/mesa/visualization/UserParam.py b/mesa/visualization/UserParam.py\n--- a/mesa/visualization/UserParam.py\n+++ b/mesa/visualization/UserParam.py\n@@ -1,3 +1,7 @@\n+from numbers import Number\n+from warnings import warn\n+\n+\n NUMBER = \"number\"\n CHECKBOX = \"checkbox\"\n CHOICE = \"choice\"\n@@ -63,6 +67,13 @@\n         choices=None,\n         description=None,\n     ):\n+\n+        warn(\n+            \"UserSettableParameter is deprecated in favor of UserParam objects \"\n+            \"such as Slider, Checkbox, Choice, StaticText, NumberInput. \"\n+            \"See the examples folder for how to use them. \"\n+            \"UserSettableParameter will be removed in the next major release.\"\n+        )\n         if choices is None:\n             choices = list()\n         if param_type not in self.TYPES:\n@@ -268,3 +279,19 @@\n         self._value = value\n         valid = isinstance(self.value, str)\n         self.maybe_raise_error(valid)\n+\n+\n+class NumberInput(UserParam):\n+    \"\"\"\n+    a simple numerical input\n+\n+    Example:\n+    number_option = NumberInput(\"My Number\", value=123)\n+    \"\"\"\n+\n+    def __init__(self, name=\"\", value=None, description=None):\n+        self.param_type = NUMBER\n+        self.name = name\n+        self._value = value\n+        valid = isinstance(self.value, Number)\n+        self.maybe_raise_error(valid)\n", "issue": "UX: Split UserSettableParameter into various classes\nWhat if, instead of\r\n```python\r\nnumber_option = UserSettableParameter('number', 'My Number', value=123)\r\nboolean_option = UserSettableParameter('checkbox', 'My Boolean', value=True)\r\nslider_option = UserSettableParameter('slider', 'My Slider', value=123, min_value=10, max_value=200, step=0.1)\r\n```\r\n\r\nwe do\r\n```python\r\nnumber_option = Number(\"My Number\", 123)\r\nboolean_option = Checkbox(\"My boolean\", True)\r\nslider_option = Slider(\"My slider\", 123, min=10, max=200, step=0.1)\r\n```\r\n\r\nIn addition to looking simpler, more importantly, this allows users to define their own UserParam class.\n", "before_files": [{"content": "NUMBER = \"number\"\nCHECKBOX = \"checkbox\"\nCHOICE = \"choice\"\nSLIDER = \"slider\"\nSTATIC_TEXT = \"static_text\"\n\n\nclass UserSettableParameter:\n    \"\"\"A class for providing options to a visualization for a given parameter.\n\n    UserSettableParameter can be used instead of keyword arguments when specifying model parameters in an\n    instance of a `ModularServer` so that the parameter can be adjusted in the UI without restarting the server.\n\n    Validation of correctly-specified params happens on startup of a `ModularServer`. Each param is handled\n    individually in the UI and sends callback events to the server when an option is updated. That option is then\n    re-validated, in the `value.setter` property method to ensure input is correct from the UI to `reset_model`\n    callback.\n\n    Parameter types include:\n        - 'number' - a simple numerical input\n        - 'checkbox' - boolean checkbox\n        - 'choice' - String-based dropdown input, for selecting choices within a model\n        - 'slider' - A number-based slider input with settable increment\n        - 'static_text' - A non-input textbox for displaying model info.\n\n    Examples:\n\n    # Simple number input\n    number_option = UserSettableParameter('number', 'My Number', value=123)\n\n    # Checkbox input\n    boolean_option = UserSettableParameter('checkbox', 'My Boolean', value=True)\n\n    # Choice input\n    choice_option = UserSettableParameter('choice', 'My Choice', value='Default choice',\n                                          choices=['Default Choice', 'Alternate Choice'])\n\n    # Slider input\n    slider_option = UserSettableParameter('slider', 'My Slider', value=123, min_value=10, max_value=200, step=0.1)\n\n    # Static text\n    static_text = UserSettableParameter('static_text', value=\"This is a descriptive textbox\")\n    \"\"\"\n\n    NUMBER = NUMBER\n    CHECKBOX = CHECKBOX\n    CHOICE = CHOICE\n    SLIDER = SLIDER\n    STATIC_TEXT = STATIC_TEXT\n\n    TYPES = (NUMBER, CHECKBOX, CHOICE, SLIDER, STATIC_TEXT)\n\n    _ERROR_MESSAGE = \"Missing or malformed inputs for '{}' Option '{}'\"\n\n    def __init__(\n        self,\n        param_type=None,\n        name=\"\",\n        value=None,\n        min_value=None,\n        max_value=None,\n        step=1,\n        choices=None,\n        description=None,\n    ):\n        if choices is None:\n            choices = list()\n        if param_type not in self.TYPES:\n            raise ValueError(f\"{param_type} is not a valid Option type\")\n        self.param_type = param_type\n        self.name = name\n        self._value = value\n        self.min_value = min_value\n        self.max_value = max_value\n        self.step = step\n        self.choices = choices\n        self.description = description\n\n        # Validate option types to make sure values are supplied properly\n        msg = self._ERROR_MESSAGE.format(self.param_type, name)\n        valid = True\n\n        if self.param_type == self.NUMBER:\n            valid = not (self.value is None)\n\n        elif self.param_type == self.SLIDER:\n            valid = not (\n                self.value is None or self.min_value is None or self.max_value is None\n            )\n\n        elif self.param_type == self.CHOICE:\n            valid = not (self.value is None or len(self.choices) == 0)\n\n        elif self.param_type == self.CHECKBOX:\n            valid = isinstance(self.value, bool)\n\n        elif self.param_type == self.STATIC_TEXT:\n            valid = isinstance(self.value, str)\n\n        if not valid:\n            raise ValueError(msg)\n\n    @property\n    def value(self):\n        return self._value\n\n    @value.setter\n    def value(self, value):\n        self._value = value\n        if self.param_type == self.SLIDER:\n            if self._value < self.min_value:\n                self._value = self.min_value\n            elif self._value > self.max_value:\n                self._value = self.max_value\n        elif self.param_type == self.CHOICE:\n            if self._value not in self.choices:\n                print(\n                    \"Selected choice value not in available choices, selected first choice from 'choices' list\"\n                )\n                self._value = self.choices[0]\n\n    @property\n    def json(self):\n        result = self.__dict__.copy()\n        result[\"value\"] = result.pop(\n            \"_value\"\n        )  # Return _value as value, value is the same\n        return result\n\n\nclass UserParam:\n    _ERROR_MESSAGE = \"Missing or malformed inputs for '{}' Option '{}'\"\n\n    @property\n    def json(self):\n        result = self.__dict__.copy()\n        result[\"value\"] = result.pop(\n            \"_value\"\n        )  # Return _value as value, value is the same\n        return result\n\n    def maybe_raise_error(self, valid):\n        if not valid:\n            msg = self._ERROR_MESSAGE.format(self.param_type, self.name)\n            raise ValueError(msg)\n\n    @property\n    def value(self):\n        return self._value\n\n    @value.setter\n    def value(self, value):\n        self._value = value\n\n\nclass Slider(UserParam):\n    \"\"\"\n    A number-based slider input with settable increment.\n\n    Example:\n\n    slider_option = Slider(\"My Slider\", value=123, min_value=10, max_value=200, step=0.1)\n    \"\"\"\n\n    def __init__(\n        self,\n        name=\"\",\n        value=None,\n        min_value=None,\n        max_value=None,\n        step=1,\n        description=None,\n    ):\n        self.param_type = SLIDER\n        self.name = name\n        self._value = value\n        self.min_value = min_value\n        self.max_value = max_value\n        self.step = step\n        self.description = description\n\n        # Validate option type to make sure values are supplied properly\n        valid = not (\n            self.value is None or self.min_value is None or self.max_value is None\n        )\n        self.maybe_raise_error(valid)\n\n    @property\n    def value(self):\n        return self._value\n\n    @value.setter\n    def value(self, value):\n        self._value = value\n        if self._value < self.min_value:\n            self._value = self.min_value\n        elif self._value > self.max_value:\n            self._value = self.max_value\n\n\nclass Checkbox(UserParam):\n    \"\"\"\n    Boolean checkbox.\n\n    Example:\n\n    boolean_option = Checkbox('My Boolean', True)\n    \"\"\"\n\n    def __init__(self, name=\"\", value=None, description=None):\n        self.param_type = CHECKBOX\n        self.name = name\n        self._value = value\n        self.description = description\n\n        # Validate option type to make sure values are supplied properly\n        valid = isinstance(self.value, bool)\n        self.maybe_raise_error(valid)\n\n\nclass Choice(UserParam):\n    \"\"\"\n    String-based dropdown input, for selecting choices within a model\n\n    Example:\n    choice_option = Choice(\n        'My Choice',\n        value='Default choice',\n        choices=['Default Choice', 'Alternate Choice']\n    )\n    \"\"\"\n\n    def __init__(self, name=\"\", value=None, choices=None, description=None):\n        self.param_type = CHOICE\n        self.name = name\n        self._value = value\n        self.choices = choices\n        self.description = description\n\n        # Validate option type to make sure values are supplied properly\n        valid = not (self.value is None or len(self.choices) == 0)\n        self.maybe_raise_error(valid)\n\n    @property\n    def value(self):\n        return self._value\n\n    @value.setter\n    def value(self, value):\n        self._value = value\n        if self._value not in self.choices:\n            print(\n                \"Selected choice value not in available choices, selected first choice from 'choices' list\"\n            )\n            self._value = self.choices[0]\n\n\nclass StaticText(UserParam):\n    \"\"\"\n    A non-input textbox for displaying model info.\n\n    Example:\n    static_text = StaticText(\"This is a descriptive textbox\")\n    \"\"\"\n\n    def __init__(self, value=None):\n        self.param_type = STATIC_TEXT\n        self._value = value\n        valid = isinstance(self.value, str)\n        self.maybe_raise_error(valid)\n", "path": "mesa/visualization/UserParam.py"}], "after_files": [{"content": "from numbers import Number\nfrom warnings import warn\n\n\nNUMBER = \"number\"\nCHECKBOX = \"checkbox\"\nCHOICE = \"choice\"\nSLIDER = \"slider\"\nSTATIC_TEXT = \"static_text\"\n\n\nclass UserSettableParameter:\n    \"\"\"A class for providing options to a visualization for a given parameter.\n\n    UserSettableParameter can be used instead of keyword arguments when specifying model parameters in an\n    instance of a `ModularServer` so that the parameter can be adjusted in the UI without restarting the server.\n\n    Validation of correctly-specified params happens on startup of a `ModularServer`. Each param is handled\n    individually in the UI and sends callback events to the server when an option is updated. That option is then\n    re-validated, in the `value.setter` property method to ensure input is correct from the UI to `reset_model`\n    callback.\n\n    Parameter types include:\n        - 'number' - a simple numerical input\n        - 'checkbox' - boolean checkbox\n        - 'choice' - String-based dropdown input, for selecting choices within a model\n        - 'slider' - A number-based slider input with settable increment\n        - 'static_text' - A non-input textbox for displaying model info.\n\n    Examples:\n\n    # Simple number input\n    number_option = UserSettableParameter('number', 'My Number', value=123)\n\n    # Checkbox input\n    boolean_option = UserSettableParameter('checkbox', 'My Boolean', value=True)\n\n    # Choice input\n    choice_option = UserSettableParameter('choice', 'My Choice', value='Default choice',\n                                          choices=['Default Choice', 'Alternate Choice'])\n\n    # Slider input\n    slider_option = UserSettableParameter('slider', 'My Slider', value=123, min_value=10, max_value=200, step=0.1)\n\n    # Static text\n    static_text = UserSettableParameter('static_text', value=\"This is a descriptive textbox\")\n    \"\"\"\n\n    NUMBER = NUMBER\n    CHECKBOX = CHECKBOX\n    CHOICE = CHOICE\n    SLIDER = SLIDER\n    STATIC_TEXT = STATIC_TEXT\n\n    TYPES = (NUMBER, CHECKBOX, CHOICE, SLIDER, STATIC_TEXT)\n\n    _ERROR_MESSAGE = \"Missing or malformed inputs for '{}' Option '{}'\"\n\n    def __init__(\n        self,\n        param_type=None,\n        name=\"\",\n        value=None,\n        min_value=None,\n        max_value=None,\n        step=1,\n        choices=None,\n        description=None,\n    ):\n\n        warn(\n            \"UserSettableParameter is deprecated in favor of UserParam objects \"\n            \"such as Slider, Checkbox, Choice, StaticText, NumberInput. \"\n            \"See the examples folder for how to use them. \"\n            \"UserSettableParameter will be removed in the next major release.\"\n        )\n        if choices is None:\n            choices = list()\n        if param_type not in self.TYPES:\n            raise ValueError(f\"{param_type} is not a valid Option type\")\n        self.param_type = param_type\n        self.name = name\n        self._value = value\n        self.min_value = min_value\n        self.max_value = max_value\n        self.step = step\n        self.choices = choices\n        self.description = description\n\n        # Validate option types to make sure values are supplied properly\n        msg = self._ERROR_MESSAGE.format(self.param_type, name)\n        valid = True\n\n        if self.param_type == self.NUMBER:\n            valid = not (self.value is None)\n\n        elif self.param_type == self.SLIDER:\n            valid = not (\n                self.value is None or self.min_value is None or self.max_value is None\n            )\n\n        elif self.param_type == self.CHOICE:\n            valid = not (self.value is None or len(self.choices) == 0)\n\n        elif self.param_type == self.CHECKBOX:\n            valid = isinstance(self.value, bool)\n\n        elif self.param_type == self.STATIC_TEXT:\n            valid = isinstance(self.value, str)\n\n        if not valid:\n            raise ValueError(msg)\n\n    @property\n    def value(self):\n        return self._value\n\n    @value.setter\n    def value(self, value):\n        self._value = value\n        if self.param_type == self.SLIDER:\n            if self._value < self.min_value:\n                self._value = self.min_value\n            elif self._value > self.max_value:\n                self._value = self.max_value\n        elif self.param_type == self.CHOICE:\n            if self._value not in self.choices:\n                print(\n                    \"Selected choice value not in available choices, selected first choice from 'choices' list\"\n                )\n                self._value = self.choices[0]\n\n    @property\n    def json(self):\n        result = self.__dict__.copy()\n        result[\"value\"] = result.pop(\n            \"_value\"\n        )  # Return _value as value, value is the same\n        return result\n\n\nclass UserParam:\n    _ERROR_MESSAGE = \"Missing or malformed inputs for '{}' Option '{}'\"\n\n    @property\n    def json(self):\n        result = self.__dict__.copy()\n        result[\"value\"] = result.pop(\n            \"_value\"\n        )  # Return _value as value, value is the same\n        return result\n\n    def maybe_raise_error(self, valid):\n        if not valid:\n            msg = self._ERROR_MESSAGE.format(self.param_type, self.name)\n            raise ValueError(msg)\n\n    @property\n    def value(self):\n        return self._value\n\n    @value.setter\n    def value(self, value):\n        self._value = value\n\n\nclass Slider(UserParam):\n    \"\"\"\n    A number-based slider input with settable increment.\n\n    Example:\n\n    slider_option = Slider(\"My Slider\", value=123, min_value=10, max_value=200, step=0.1)\n    \"\"\"\n\n    def __init__(\n        self,\n        name=\"\",\n        value=None,\n        min_value=None,\n        max_value=None,\n        step=1,\n        description=None,\n    ):\n        self.param_type = SLIDER\n        self.name = name\n        self._value = value\n        self.min_value = min_value\n        self.max_value = max_value\n        self.step = step\n        self.description = description\n\n        # Validate option type to make sure values are supplied properly\n        valid = not (\n            self.value is None or self.min_value is None or self.max_value is None\n        )\n        self.maybe_raise_error(valid)\n\n    @property\n    def value(self):\n        return self._value\n\n    @value.setter\n    def value(self, value):\n        self._value = value\n        if self._value < self.min_value:\n            self._value = self.min_value\n        elif self._value > self.max_value:\n            self._value = self.max_value\n\n\nclass Checkbox(UserParam):\n    \"\"\"\n    Boolean checkbox.\n\n    Example:\n\n    boolean_option = Checkbox('My Boolean', True)\n    \"\"\"\n\n    def __init__(self, name=\"\", value=None, description=None):\n        self.param_type = CHECKBOX\n        self.name = name\n        self._value = value\n        self.description = description\n\n        # Validate option type to make sure values are supplied properly\n        valid = isinstance(self.value, bool)\n        self.maybe_raise_error(valid)\n\n\nclass Choice(UserParam):\n    \"\"\"\n    String-based dropdown input, for selecting choices within a model\n\n    Example:\n    choice_option = Choice(\n        'My Choice',\n        value='Default choice',\n        choices=['Default Choice', 'Alternate Choice']\n    )\n    \"\"\"\n\n    def __init__(self, name=\"\", value=None, choices=None, description=None):\n        self.param_type = CHOICE\n        self.name = name\n        self._value = value\n        self.choices = choices\n        self.description = description\n\n        # Validate option type to make sure values are supplied properly\n        valid = not (self.value is None or len(self.choices) == 0)\n        self.maybe_raise_error(valid)\n\n    @property\n    def value(self):\n        return self._value\n\n    @value.setter\n    def value(self, value):\n        self._value = value\n        if self._value not in self.choices:\n            print(\n                \"Selected choice value not in available choices, selected first choice from 'choices' list\"\n            )\n            self._value = self.choices[0]\n\n\nclass StaticText(UserParam):\n    \"\"\"\n    A non-input textbox for displaying model info.\n\n    Example:\n    static_text = StaticText(\"This is a descriptive textbox\")\n    \"\"\"\n\n    def __init__(self, value=None):\n        self.param_type = STATIC_TEXT\n        self._value = value\n        valid = isinstance(self.value, str)\n        self.maybe_raise_error(valid)\n\n\nclass NumberInput(UserParam):\n    \"\"\"\n    a simple numerical input\n\n    Example:\n    number_option = NumberInput(\"My Number\", value=123)\n    \"\"\"\n\n    def __init__(self, name=\"\", value=None, description=None):\n        self.param_type = NUMBER\n        self.name = name\n        self._value = value\n        valid = isinstance(self.value, Number)\n        self.maybe_raise_error(valid)\n", "path": "mesa/visualization/UserParam.py"}]}