Initializing help system before first use

Configuration with Annotations

Python type annotations (also referred to as type hints) provide a way of including metadata information about the type of the model entities. This metadata is used to configure the way in which the model entities are handled by the system.

Type annotations are simply metadata expressed in the model source file. That metadata is extracted during the compilation step and stored in a binary model file after compilation.

Declaring Entities with the Help of Type Annotations

In the Python source file, the type of the entities must be declared by using a type annotation:
TotalReturn: xi.Scalar(dtype=xi.real, alias="Total expected return on investment", manage=xi.Manage.RESULT)
Among other things, Insight type annotations give you the potential to define aliases for model entities, so that they are presented in the user interface using their alias names, rather than their original entity names. For example, placing the following annotation prior to the MaxPerShare declaration in the example:
MaxPerShare: xi.Scalar(default=0.25, alias="Maximum investment per share")

sets an alias name that will be used in place of the entity name throughout the user interface.

Entity Role Annotation

Annotations can also inform the system if an entity is an input or a result. Xpress Insight defaults to assuming that declared entities are input entities. Result entities need to be marked explicitly as results.

The following snippet annotates the SummaryIds entity as a result using the xi.Manage annotation parameter:
SummaryIds: xi.Index(dtype=xi.string, alias="Summary", manage=xi.Manage.RESULT)

Annotation Reference

See the Xpress Insight Python Interface Reference Manual for further detailed information about the many available Insight type annotations.

© 2001-2020 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.