Initializing help system before first use

xpressinsight.types.Param

Purpose
Creates an annotation for a parameter entity. Parameters can be used to configure an Xpress Insight app. When parameters are declared, their name, data type, and default value must be specified. Parameters are typically read-only.
Synopsis
xpressinsight.types.Param(default: Union[bool, float, int, str] = None, dtype: Type[BasicType] = None) -> Type[Union[bool, float, int, str]]
Arguments
default 
The default value; if specified, must be of the appropriate value for the dtype of this entity (e.g. a str if dtype is string).
dtype 
The data type; one of boolean, real, integer or string.
Example
Some examples of declaring parameter entities in the data model.
>>> @xi.AppConfig(name="My First Insight Python App",
...               version=xi.AppVersion(0, 1, 2))
... class MyApp(xi.AppBase):
...
...     # examples where data type is inferred from the initial value
...     # Param "P" of type "xi.integer" with initial value 100
...     P: xi.types.Param(100)
...     # Param "DEBUG" of type "xi.boolean" with initial value False
...     DEBUG: xi.types.Param(False)
...     # Param "PI" of type "xi.real" with initial value 3.14
...     PI: xi.types.Param(3.14)
...     # Param "STR_PARAM" of type xi.string with a initial value
...     STR_PARAM: xi.types.Param('My String Param')
...
...     # examples where data type is explicitly given and value will be
...     # initialized to a type-specific default
...     BOOL_PARAM: xi.types.Param(dtype=xi.boolean)  # default value False
...     INT_PARAM: xi.types.Param(dtype=xi.integer)  # default value 0
...     REAL_PARAM: xi.types.Param(dtype=xi.real)  # default value 0.0
...     STRING_PARAM: xi.types.Param(dtype=xi.string)  # default value ""			
Further information
1. The function Param is part of the package xpressinsight.types.
2. This function returns an Annotated type containing the Param entity object; for example, if xpressinsight has been imported as xi, then xi.types.Param(dtype=xi.integer) is equivalent to Annotated[int, xi.Param(dtype=xi.integer)].
Related topics

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.