コード例 #1
0
def test_experiments_registry(name: str, maker: tp.Callable[[], tp.Iterator[experiments.Experiment]]) -> None:
    # Our PGAN is not well accepted by circleci.
    if "_pgan" in name and os.environ.get("CIRCLECI", False):
        raise SkipTest("Too slow in CircleCI")

    # Our IQAs and our ScikitLearn are not well guaranteed on Windows.
    if "image" in name and "quality" in name and platform.system() == "Windows":
        raise SkipTest("Image quality not guaranteed on Windows.")

    # Basic test.
    with tools.set_env(NEVERGRAD_PYTEST=1):
        with datasets.mocked_data():  # mock mlda data that should be downloaded
            check_maker(maker)  # this is to extract the function for reuse if other external packages need it

    # Some tests are skipped on CircleCI (but they do work well locally, if memory enough).
    if ("images_using_gan" == name or "mlda" == name or "realworld" == name) and os.environ.get(
        "CIRCLECI", False
    ):
        raise SkipTest("Too slow in CircleCI")

    # No Mujoco on CircleCI and possibly for some users.
    if name == "control_problem":
        return

    check_experiment(
        maker,
        "mltuning" in name,
        skip_seed=(name in ["rocket", "images_using_gan"]) or any(x in name for x in ["tuning", "image_"]),
    )  # this is a basic test on first elements, do not fully rely on it
コード例 #2
0
ファイル: test_experiments.py プロジェクト: teytaud/nevergrad
def test_experiments_registry(
        name: str,
        maker: tp.Callable[[], tp.Iterator[experiments.Experiment]]) -> None:
    with datasets.mocked_data():  # mock mlda data that should be downloaded
        check_maker(
            maker
        )  # this is to extract the function for reuse if other external packages need it
    if name not in {
            "realworld_oneshot", "mlda", "mldaas", "realworld", "rocket",
            "mldakmeans", "naivemltuning", "seqmltuning", "naiveseqmltuning",
            "mltuning", "control_problem"
    }:
        check_seedable(
            maker, "mltuning" in name
        )  # this is a basic test on first elements, do not fully rely on it
コード例 #3
0
def test_experiments_registry(
        name: str,
        maker: tp.Callable[[], tp.Iterator[experiments.Experiment]]) -> None:
    with tools.set_env(NEVERGRAD_PYTEST=1):
        with datasets.mocked_data(
        ):  # mock mlda data that should be downloaded
            check_maker(
                maker
            )  # this is to extract the function for reuse if other external packages need it
    if name not in [
            "rocket", "images_using_gan", "control_problem"
    ] and not any(x in name
                  for x in ["tuning", "mlda", "realworld", "image_"]):
        check_seedable(
            maker, "mltuning" in name
        )  # this is a basic test on first elements, do not fully rely on it
コード例 #4
0
def test_experiments_registry(
        name: str,
        maker: tp.Callable[[], tp.Iterator[experiments.Experiment]]) -> None:
    # Our PGAN is not well accepted by circleci.
    if "_pgan" in name and os.environ.get("CIRCLECI", False):
        raise SkipTest("Too slow in CircleCI")

    # mixsimulator is not accepted by circleci pytest.
    if "mixsimulator" in name and os.environ.get("CIRCLECI", False):
        raise SkipTest("Sigkill in CircleCI")

    # Our IQAs and our ScikitLearn are not well guaranteed on Windows.
    if all(x in name
           for x in ["image", "quality"]) and platform.system() == "Windows":
        raise SkipTest("Image quality not guaranteed on Windows.")

    # Basic test.
    print(f"Testing {name}")
    with tools.set_env(NEVERGRAD_PYTEST=1):
        with datasets.mocked_data(
        ):  # mock mlda data that should be downloaded
            check_maker(
                maker
            )  # this is to extract the function for reuse if other external packages need it

    # Some tests are skipped on CircleCI (but they do work well locally, if memory enough).
    if os.environ.get("CIRCLECI", False):
        if any(x in name
               for x in ["image", "mlda", "realworld", "adversarial_attack"]):
            raise SkipTest("Too slow in CircleCI")

    check_experiment(
        maker,
        ("mltuning" in name or "anm" in name),
        skip_seed=(name in ["rocket", "images_using_gan"])
        or any(x in name for x in ["tuning", "image_", "compiler", "anm"]),
    )  # this is a basic test on first elements, do not fully rely on it