diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4fe7d26d..3e42622ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 + with: + python-version: 3.11 - run: pip install pre-commit - run: pre-commit --version - run: pre-commit install @@ -255,7 +257,7 @@ jobs: name: codecov-umbrella fail_ci_if_error: false pypi: - needs: [test, backward-compatibility, test-long-algos, mongodb, test_no_extras, test-dashboard-build] + needs: [test, backward-compatibility, test-long-algos, mongodb, test_no_extras] # , test-dashboard-build] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -349,7 +351,7 @@ jobs: user: __token__ password: ${{ secrets.pypi_password }} conda: - needs: [test, backward-compatibility, test-long-algos, test-dashboard-build] + needs: [test, backward-compatibility, test-long-algos] #, test-dashboard-build] runs-on: ubuntu-latest env: ANACONDA_TOKEN: ${{ secrets.anaconda_token }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index df56d8d66..06ed1f05b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,16 +13,14 @@ repos: hooks: - id: codespell args: ["--skip", "*.html,*.ipynb,dashboard/src/.yarn/**,dashboard/src/yarn.lock,dashboard/build/**,dashboard/src/src/__tests__/**", "--ignore-words-list=hist,wont,ro"] - - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.3 hooks: - - id: flake8 + - id: ruff args: - - --ignore=E203,E402,E712,E722,E731,E741,F401,F403,F405,F524,F841,W503,E302,E704 - - --max-complexity=30 - - --max-line-length=456 + - --ignore=E203,E402,E712,E722,E731,E741,F401,F403,F405,F524,F841 + - --line-length=300 - --show-source - - --statistics - repo: https://github.com/PyCQA/isort rev: 5.12.0 hooks: diff --git a/docs/src/user/searchspace.rst b/docs/src/user/searchspace.rst index 5600b24e7..0370bbc79 100644 --- a/docs/src/user/searchspace.rst +++ b/docs/src/user/searchspace.rst @@ -127,6 +127,7 @@ Special arguments ex: ``uniform(0, 10, discrete=True)`` Argument to cast a continuous distribution into :ref:`integer-dim`. Defaults to ``False``. +Note that the interval is inclusive. The example would include 10 as a valid value. .. _search-space-default: diff --git a/src/orion/algo/nevergradoptimizer/nevergradoptimizer.py b/src/orion/algo/nevergradoptimizer/nevergradoptimizer.py index 34bc7f0b3..8fcc06a55 100644 --- a/src/orion/algo/nevergradoptimizer/nevergradoptimizer.py +++ b/src/orion/algo/nevergradoptimizer/nevergradoptimizer.py @@ -141,6 +141,7 @@ def _(dim: Fidelity): "OptimisticNoisyOnePlusOne", "Powell", "CmaFmin2", + "FCMA", "RPowell", "RSQP", "PymooNSGA2", diff --git a/tests/unittests/algo/long/nevergrad/integration_test.py b/tests/unittests/algo/long/nevergrad/integration_test.py index a1cb52fb7..b72aa5bb1 100644 --- a/tests/unittests/algo/long/nevergrad/integration_test.py +++ b/tests/unittests/algo/long/nevergrad/integration_test.py @@ -90,7 +90,6 @@ def merge_dicts(*dicts: dict) -> dict: "DiscreteOnePlusOne": _deterministic_first_point, "EDA": _no_tell_without_ask, "ES": {}, - "FCMA": {}, "GeneticDE": {}, "HaltonSearch": _deterministic_points, "HaltonSearchPlusMiddlePoint": _deterministic_points, @@ -218,6 +217,7 @@ def merge_dicts(*dicts: dict) -> dict: "NGOpt14": {}, "NGOpt21": {}, "NGOpt38": {}, + "FCMA": _not_serializable, } diff --git a/tests/unittests/algo/test_space.py b/tests/unittests/algo/test_space.py index f3961670e..ab55735fa 100644 --- a/tests/unittests/algo/test_space.py +++ b/tests/unittests/algo/test_space.py @@ -311,7 +311,7 @@ def test_init_with_default_value(self): """Make sure the default value is set""" dim = Real("yolo", "uniform", -3, 10, default_value=2.0) - assert type(dim.default_value) is float + assert isinstance(dim.default_value, float) def test_set_outside_bounds_default_value(self): """Make sure default value is inside the bounds""" @@ -440,7 +440,7 @@ def test_init_with_default_value(self): """Make sure the type of the default value is int""" dim = Integer("yolo", "uniform", -3, 10, default_value=2) - assert type(dim.default_value) is int + assert isinstance(dim.default_value, int) def test_set_outside_bounds_default_value(self): """Make sure the default value is inside the bounds of the dimensions""" @@ -588,14 +588,14 @@ def test_init_with_default_value_string(self): categories = {"asdfa": 0.1, 2: 0.2, 3: 0.3, "lalala": 0.4} dim = Categorical("yolo", categories, default_value="asdfa") - assert type(dim.default_value) is str + assert isinstance(dim.default_value, str) def test_init_with_default_value_int(self): """Make sure the default value is of the correct type""" categories = {"asdfa": 0.1, 2: 0.2, 3: 0.3, "lalala": 0.4} dim = Categorical("yolo", categories, default_value=2) - assert type(dim.default_value) is int + assert isinstance(dim.default_value, int) def test_init_with_wrong_default_value(self): """Make sure the default value exists""" diff --git a/tests/unittests/benchmark/task/test_tasks.py b/tests/unittests/benchmark/task/test_tasks.py index 88d16ce73..a047fa386 100644 --- a/tests/unittests/benchmark/task/test_tasks.py +++ b/tests/unittests/benchmark/task/test_tasks.py @@ -20,7 +20,7 @@ def test_call(self): assert callable(task) objectives = task([1, 2]) - assert type(objectives[0]) == dict + assert isinstance(objectives[0], dict) def test_search_space(self): """Test to get task search space""" @@ -45,7 +45,7 @@ def test_call(self): assert callable(task) objectives = task([1, 2]) - assert type(objectives[0]) == dict + assert isinstance(objectives[0], dict) def test_search_space(self): """Test to get task search space""" @@ -70,7 +70,7 @@ def test_call(self): assert callable(task) objectives = task([1, 2]) - assert type(objectives[0]) == dict + assert isinstance(objectives[0], dict) def test_search_space(self): """Test to get task search space""" @@ -95,7 +95,7 @@ def test_call(self): assert callable(task) objectives = task([1, 2]) - assert type(objectives[0]) == dict + assert isinstance(objectives[0], dict) def test_search_space(self): """Test to get task search space"""