Skip to main content
Parameter option for number parameters that can vary based on selection of another parameter. This class can be imported from the squirrels.parameter_options or the squirrels module.

Constructor

Creates a NumberParameterOption object. Typically used in pyconfigs/parameters.py.

Examples

A NumberParameterOption object is created in the pyconfigs/parameters.py file. It must be created in a function decorated with the create_with_options factory method from NumberParameter.

Usage example in parameters.py

In addition, the following are some additional examples for creating a NumberParameterOption object.

Setting up cascading parameters with varying number ranges

This example shows how to create number options that change their constraints based on the selection of a parent parameter (e.g., different budget categories with different value ranges).

Restricting value ranges by user groups

This example shows how to provide different value constraints based on user access levels using the user_groups parameter.
If custom user fields are defined in pyconfigs/user.py, then they can be used to restrict value constraints as well. To do so, the user_attribute argument must be prefixed with custom_fields..