当前位置: 首页>>代码示例>>Python>>正文


Python parameterized.expand方法代码示例

本文整理汇总了Python中parameterized.parameterized.expand方法的典型用法代码示例。如果您正苦于以下问题:Python parameterized.expand方法的具体用法?Python parameterized.expand怎么用?Python parameterized.expand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在parameterized.parameterized的用法示例。


在下文中一共展示了parameterized.expand方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_generic_test

# 需要导入模块: from parameterized import parameterized [as 别名]
# 或者: from parameterized.parameterized import expand [as 别名]
def make_generic_test(params):
    class TestSequence(unittest.TestCase):
        # pprint(params)

        def generic_test(self, tested_df, expected_reults, test_name):
            erroneous = tested_df[(tested_df[test_name] == False)]
            print(tabulate(tested_df, headers='keys', tablefmt='psql'))

            if erroneous.empty is False:  # Or Entire df IS NOT erroneous
                for index, row in erroneous.iterrows():
                    expected = expected_reults[(row['simulation'], row['run'], row['timestep'], row['substep'])]
                    unexpected = {f"invalid_{k}": expected[k] for k in expected if k in row and expected[k] != row[k]}

                    for key in unexpected.keys():
                        erroneous[key] = None
                        erroneous.at[index, key] = unexpected[key]
                # etc.

            self.assertTrue(reduce(lambda a, b: a and b, tested_df[test_name]))

        @parameterized.expand(params)
        def test_validation(self, name, result_df, expected_results, target_cols, evaluations):
            tested_df, test_names = generate_assertions_df(result_df, expected_results, target_cols, evaluations)

            for test_name in test_names:
                self.generic_test(tested_df, expected_results, test_name)

    return TestSequence 
开发者ID:cadCAD-org,项目名称:cadCAD,代码行数:30,代码来源:generic_test.py

示例2: exist_perms

# 需要导入模块: from parameterized import parameterized [as 别名]
# 或者: from parameterized.parameterized import expand [as 别名]
def exist_perms(**kwargs):
    all_elems = list(kwargs.keys())
    curr_elems = copy.deepcopy(all_elems)

    perms = _perms_cycle(curr_elems.pop(), curr_elems, {})
    res = []
    for name_str, perm in perms:
        args = dict([(k, v) for (k, v) in kwargs.items() if perm[k]])
        res.append((name_str, args))

    return parameterized.expand(res) 
开发者ID:pythongssapi,项目名称:python-gssapi,代码行数:13,代码来源:test_high_level.py

示例3: true_false_perms

# 需要导入模块: from parameterized import parameterized [as 别名]
# 或者: from parameterized.parameterized import expand [as 别名]
def true_false_perms(*all_elems_tuple):
    all_elems = list(all_elems_tuple)
    curr_elems = copy.deepcopy(all_elems)

    perms = _perms_cycle(curr_elems.pop(), curr_elems, {})
    return parameterized.expand(perms)


# NB(directxman12): MIT Kerberos completely ignores input TTLs for
#                   credentials.  I suspect this is because the TTL
#                   is actually set when kinit is called.
# NB(directxman12): the above note used to be wonderfully sarcastic 
开发者ID:pythongssapi,项目名称:python-gssapi,代码行数:14,代码来源:test_high_level.py

示例4: test_gym_offline_cpu

# 需要导入模块: from parameterized import parameterized [as 别名]
# 或者: from parameterized.parameterized import expand [as 别名]
def test_gym_offline_cpu(self, name: str, config_path: str):
        self.run_from_config(
            run_test=run_test_offline,
            config_path=os.path.join(curr_dir, config_path),
            use_gpu=False,
        )
        logger.info(f"{name} passes!")

    # pyre-fixme[16]: Module `parameterized` has no attribute `expand`. 
开发者ID:facebookresearch,项目名称:ReAgent,代码行数:11,代码来源:test_gym_offline.py

示例5: test_gym_cpu

# 需要导入模块: from parameterized import parameterized [as 别名]
# 或者: from parameterized.parameterized import expand [as 别名]
def test_gym_cpu(self, name: str, config_path: str):
        self.run_from_config(
            run_test=run_test,
            config_path=os.path.join(curr_dir, config_path),
            use_gpu=False,
        )
        logger.info(f"{name} passes!")

    # pyre-fixme[16]: Module `parameterized` has no attribute `expand`. 
开发者ID:facebookresearch,项目名称:ReAgent,代码行数:11,代码来源:test_gym.py


注:本文中的parameterized.parameterized.expand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。