How to use the pysd.functions.lookup function in pysd

To help you get started, we’ve selected a few pysd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SDXorg / test-models / tests / lookups / test_lookups.py View on Github external
def lookup_function_table(x):
    """
    lookup function table




    """
    return functions.lookup(x, [0, 5, 10, 15, 20, 25, 30, 35, 40, 45], [
        0, 0, 1, 1, 0, 0, -1, -1, 0, 0])
github SDXorg / test-models / tests / lookups / test_lookups.py View on Github external
def lookup_linebreak_before_comma(x):
    """
    Lookup Linebreak Before Comma



    This lookup has a line break before the comma.
    """
    return functions.lookup(x, [0, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4], [
        1, 1, 0.98, 0.9, 0.75, 0.45, 0.25, 0.17, 0.14, 0.12, 0.11, 0.1, 0.1])