Python based Extension Development API: DoubleParameter can't display inf or nan

Hi,

the knext.DoubleParameter can’t display inf or NaN values, which is quite important f.i. for default values of filters or alike.

This

max_lim: knext.DoubleParameter = knext.DoubleParameter(
    label=“Max. Limit”,
    description=“Axis maximum limit”,
    default_value=float("inf"),  # same applies to np.inf, np.nan, ...
)

results in the following error message being displayed when trying to configure the node:

Invalid node settings
com.fasterxml.jackson.core.JsonParseException: Non-standard token ‘NaN’: enable JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS to allow
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 262]

The fix seems to be fairly simple according to the error message. :slight_smile:

Best regards,

Johannes

Hi @carstenhaubold or @ScottF,

you think this is feasible?

Thanks in advance and best regards,

Johannes