Skip to main content
Data source class for populating number parameter options from a database table or query. This class can be imported from the squirrels.data_sources or the squirrels module.

Constructor

Creates a NumberDataSource object.

Examples

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

Usage example in parameters.py

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

Using a table from a specific connection

This example uses a table called “parameter_configs” from the “config_db” connection.
The connection must either be defined in squirrels.yml or the connections.py file.

Using seeds as the data source

This example uses a seed file called “number_config”.

Enabling cascading effects with a parent parameter

In this example, the minimum, maximum, and default values are determined by the selected value of another parameter called “metric_type”.