コード例 #1
0
ファイル: __init__.py プロジェクト: pcraster/pcraster
def plot_classic_operations(
        database_name):

    for name in ClassicOperationTimerCase.case_names():
        command = "pa.py plot --real {plot}.pdf {database} {timer_case}".format(
            plot=name,
            database=database_name,
            timer_case=name)
        execute_command(command)
コード例 #2
0
ファイル: __init__.py プロジェクト: pcraster/pcraster
def plot_alternative_operations(
        database_name):

    # patterns: (classic, multicore)
    patterns = [
        ("abs", "abs"),
        ("acos", "acos"),
        ("pcrbadd", "add"),
        ("asin", "asin"),
        ("atan", "atan"),
        # ("boolean", "boolean"),
        ("_cos", "_cos"),
        # ("cover", "cover"),
        # ("defined", "defined"),
        # ("pcrfdiv", "div"),
        # ("equal", "equal"),
        # ("fac", "fac"),
        # ("pcrgt", "greater"),
        # ("pcrge", "greater_equal"),
        ("ifthen", "ifthen"),
        ("ifthenelse", "ifthenelse"),
        # ("pcrlt", "less"),
        # ("pcrle", "less_equal"),
        # ("ln", "ln"),
        # ("log10", "log10"),
        # ("mapmaximum", "mapmaximum"),
        # ("mapminimum", "mapminimum"),
        # ("max", "max"),
        # ("min", "min"),
        ("pcrmul", "mul"),
        # ("nominal", "nominal"),
        # ("ordinal", "ordinal"),
        ("pcrpow", "power"),
        # ("rounddown", "rounddown"),
        # ("roundoff", "roundoff"),
        # ("roundup", "roundup"),
        # ("scalar", "scalar"),
        # ("_sin", "_sin"),
        ("slope", "slope"),
        # ("sqr", "sqr"),
        ("sqrt", "sqrt"),
        ("pcrbmin", "sub"),
        # ("_tan", "_tan"),
        # ("pcrne", "unequal"),
        ("window4total", "window4total"),
    ]


    classic_operation_timer_case_names = \
        ClassicOperationTimerCase.case_names()
    multicore_operation_timer_case_names = \
        MulticoreOperationTimerCase.case_names()


    for pattern in patterns:
        classic_pattern = pattern[0]
        multicore_pattern = pattern[1]

        classic_names = [name for name in
            classic_operation_timer_case_names if name.endswith(
                classic_pattern) ]
        assert len(classic_names) == 1, "{}: {}".format(classic_pattern,
            classic_names)

        multicore_names = [name for name in
            multicore_operation_timer_case_names if name.endswith(
                multicore_pattern)]
        assert len(multicore_names) == 1, "{}: {}".format(multicore_pattern,
            multicore_names)

        command = "pa.py plot --real {plot}.pdf {database} " \
                "--timestamp=2016-01-01 " \
                "{classic_timer_case} {multicore_timer_case}".format(
            plot=multicore_pattern.lstrip("_"),
            database=database_name,
            classic_timer_case=classic_names[0],
            multicore_timer_case=multicore_names[0])
        execute_command(command)
コード例 #3
0
def plot_alternative_operations(database_name):

    # patterns: (classic, multicore)
    patterns = [
        ("abs", "abs"),
        ("acos", "acos"),
        ("pcrbadd", "add"),
        ("asin", "asin"),
        ("atan", "atan"),
        # ("boolean", "boolean"),
        ("_cos", "_cos"),
        # ("cover", "cover"),
        # ("defined", "defined"),
        # ("pcrfdiv", "div"),
        # ("equal", "equal"),
        # ("fac", "fac"),
        # ("pcrgt", "greater"),
        # ("pcrge", "greater_equal"),
        ("ifthen", "ifthen"),
        ("ifthenelse", "ifthenelse"),
        # ("pcrlt", "less"),
        # ("pcrle", "less_equal"),
        # ("ln", "ln"),
        # ("log10", "log10"),
        # ("mapmaximum", "mapmaximum"),
        # ("mapminimum", "mapminimum"),
        # ("max", "max"),
        # ("min", "min"),
        ("pcrmul", "mul"),
        # ("nominal", "nominal"),
        # ("ordinal", "ordinal"),
        ("pcrpow", "power"),
        # ("rounddown", "rounddown"),
        # ("roundoff", "roundoff"),
        # ("roundup", "roundup"),
        # ("scalar", "scalar"),
        # ("_sin", "_sin"),
        ("slope", "slope"),
        # ("sqr", "sqr"),
        ("sqrt", "sqrt"),
        ("pcrbmin", "sub"),
        # ("_tan", "_tan"),
        # ("pcrne", "unequal"),
        ("window4total", "window4total"),
    ]


    classic_operation_timer_case_names = \
        ClassicOperationTimerCase.case_names()
    multicore_operation_timer_case_names = \
        MulticoreOperationTimerCase.case_names()

    for pattern in patterns:
        classic_pattern = pattern[0]
        multicore_pattern = pattern[1]

        classic_names = [
            name for name in classic_operation_timer_case_names
            if name.endswith(classic_pattern)
        ]
        assert len(classic_names) == 1, "{}: {}".format(
            classic_pattern, classic_names)

        multicore_names = [
            name for name in multicore_operation_timer_case_names
            if name.endswith(multicore_pattern)
        ]
        assert len(multicore_names) == 1, "{}: {}".format(
            multicore_pattern, multicore_names)

        command = "pa.py plot --real {plot}.pdf {database} " \
                "--timestamp=2016-01-01 " \
                "{classic_timer_case} {multicore_timer_case}".format(
            plot=multicore_pattern.lstrip("_"),
            database=database_name,
            classic_timer_case=classic_names[0],
            multicore_timer_case=multicore_names[0])
        execute_command(command)
コード例 #4
0
def plot_classic_operations(database_name):

    for name in ClassicOperationTimerCase.case_names():
        command = "pa.py plot --real {plot}.pdf {database} {timer_case}".format(
            plot=name, database=database_name, timer_case=name)
        execute_command(command)