Skip to content

Commit

Permalink
merge master into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBlanke committed Aug 22, 2024
2 parents a3751a1 + c390818 commit 3eee7ab
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 28 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
11 changes: 9 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
numpy-pandas-version: [">=1.0, <2.0", ">=2.0, <3.0"]

exclude:
- python-version: "3.8"
numpy-pandas-version: ">=2.0, <3.0"

fail-fast: false

runs-on: ${{ matrix.os }}
Expand All @@ -35,9 +40,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
make install
make install-build-requirements
make install-test-requirements
make install
python -m pip install "numpy ${{ matrix.numpy-pandas-version }}"
python -m pip install "pandas ${{ matrix.numpy-pandas-version }}"
Expand Down
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
install-requirements:
python -m pip install -r ./requirements/requirements.in

install-test-requirements:
python -m pip install -r ./requirements/requirements-test.in
python -m pip install .[test]

install-build-requirements:
python -m pip install -r ./requirements/requirements-build.in
python -m pip install .[build]

build:
python -m build
Expand Down
26 changes: 20 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ where = ["src"]

[project]
name = "gradient-free-optimizers"
version = "1.6.0"
version = "1.6.1"
description = "Simple and reliable optimization with local, global, population-based and sequential techniques in numerical discrete search spaces."
dynamic = ["dependencies"]
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE"}
Expand Down Expand Up @@ -37,14 +36,29 @@ classifiers=[
"Intended Audience :: Science/Research",
]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements/requirements.in"]}
dependencies = [
"scipy <2.0.0",
"numpy >=1.18.1, <3.0.0",
"pandas <3.0.0",
"scikit-learn >=0.21, !=0.23.*",
"tqdm >=4.48.0, <5.0.0",
]

[project.optional-dependencies]
dev = ["check-manifest"]
test = ["coverage"]
build = [
"setuptools",
"build",
"wheel",
]
test = [
"pytest == 8.3.2",
"flake8",
"pytest-cov",
"surfaces",
]

[project.urls]
"Homepage" = "https://github.com/SimonBlanke/Gradient-Free-Optimizers"
"Bug Reports" = "https://github.com/SimonBlanke/Gradient-Free-Optimizers/issues"
"Source" = "https://github.com/SimonBlanke/Gradient-Free-Optimizers/"

3 changes: 0 additions & 3 deletions requirements/requirements-build.in

This file was deleted.

4 changes: 0 additions & 4 deletions requirements/requirements-test.in

This file was deleted.

5 changes: 0 additions & 5 deletions requirements/requirements.in

This file was deleted.

18 changes: 15 additions & 3 deletions tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,9 @@ def test_memory_dict2positions_scores_0(test_input, expected):
[[-10, 10, 0.1], [10, 10, 0.2], [0, 0, 0.3]], columns=["x1", "x2", "score"]
)

dataframe1 = pd.DataFrame([[-10, 0.1], [10, 0.2], [0, 0.3]], columns=["x1", "score"])
dataframe1 = pd.DataFrame(
[[-10, 0.1], [10, 0.2], [0, 0.3]], columns=["x1", "score"]
)

memory_dict_0 = {
(0, 10): 0.1,
Expand All @@ -565,7 +567,9 @@ def test_memory_dict2positions_scores_0(test_input, expected):
]


@pytest.mark.parametrize("test_input,expected", dataframe2memory_dict_test_para_0)
@pytest.mark.parametrize(
"test_input,expected", dataframe2memory_dict_test_para_0
)
def test_dataframe2memory_dict_0(test_input, expected):
search_space = {
"x1": np.arange(-10, 11, 1),
Expand Down Expand Up @@ -599,7 +603,9 @@ def test_dataframe2memory_dict_0(test_input, expected):
]


@pytest.mark.parametrize("test_input,expected", memory_dict2dataframe_test_para_0)
@pytest.mark.parametrize(
"test_input,expected", memory_dict2dataframe_test_para_0
)
def test_memory_dict2dataframe_0(test_input, expected):
search_space = {
"x1": np.arange(-10, 11, 1),
Expand All @@ -619,4 +625,10 @@ def test_memory_dict2dataframe_0(test_input, expected):

dataframe = dataframe[expected.columns]

dataframe[dataframe.select_dtypes(include=["number"]).columns] = (
dataframe.select_dtypes(include=["number"]).astype("int")
)
expected[expected.select_dtypes(include=["number"]).columns] = (
expected.select_dtypes(include=["number"]).astype("int")
)
assert dataframe.equals(expected)

0 comments on commit 3eee7ab

Please sign in to comment.