diff --git a/Makefile b/Makefile index db6cc10d..7580b666 100644 --- a/Makefile +++ b/Makefile @@ -1,299 +1,18 @@ -.DEFAULT_GOAL := help - -define BROWSER_PYSCRIPT -import os, webbrowser, sys - -try: - from urllib import pathname2url -except: - from urllib.request import pathname2url - -webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) -endef -export BROWSER_PYSCRIPT - -define PRINT_HELP_PYSCRIPT -import re, sys - -for line in sys.stdin: - match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) - if match: - target, help = match.groups() - print("%-20s %s" % (target, help)) -endef -export PRINT_HELP_PYSCRIPT - -BROWSER := python -c "$$BROWSER_PYSCRIPT" - -.PHONY: help -help: - @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) - - -# CLEAN TARGETS - -.PHONY: clean-build -clean-build: ## remove build artifacts - rm -fr build/ - rm -fr dist/ - rm -fr .eggs/ - rm -fr benchmark/.eggs/ - find . -name '*.egg-info' -exec rm -fr {} + - find . -name '*.egg' -exec rm -fr {} + - -.PHONY: clean-pyc -clean-pyc: ## remove Python file artifacts - find . -name '*.pyc' -exec rm -f {} + - find . -name '*.pyo' -exec rm -f {} + - find . -name '*~' -exec rm -f {} + - find . -name '__pycache__' -exec rm -fr {} + - -.PHONY: clean-docs -clean-docs: ## remove previously built docs - rm -rf docs/api/ docs/api_reference/api/ docs/tutorials docs/build docs/_build docs/tutorials - -.PHONY: clean-coverage -clean-coverage: ## remove coverage artifacts - rm -f .coverage - rm -f .coverage.* - rm -fr htmlcov/ - -.PHONY: clean-test -clean-test: ## remove test artifacts - rm -fr .tox/ - rm -fr .pytest_cache - .PHONY: clean -clean: clean-build clean-pyc clean-test clean-coverage clean-docs ## remove all build, test, coverage, docs and Python artifacts - - - -# INSTALL TARGETS - -.PHONY: install -install: clean-build clean-pyc ## install the package to the active Python's site-packages - pip install . - -.PHONY: install-test -install-test: clean-build clean-pyc ## install the package and test dependencies - pip install .[test] - -.PHONY: install-benchmark -install-benchmark: clean-build clean-pyc ## install the package and test dependencies - pip install ./benchmark - -.PHONY: install-develop -install-develop: clean-build clean-pyc ## install the package in editable mode and dependencies for development - pip install -e .[dev] -e ./benchmark - -MINIMUM := $(shell sed -n '/install_requires = \[/,/]/p' setup.py | grep -v -e '[][]' | sed 's/ *\(.*\),$?$$/\1/g' | tr '>' '=') - -.PHONY: install-minimum -install-minimum: ## install the minimum supported versions of the package dependencies - echo pip install $(MINIMUM) - -BENCHMARK_MINIMUM := $(shell sed -n '/install_requires = \[/,/]/p' benchmark/setup.py | grep -v -e '[][]' | sed 's/ *\(.*\),$?$$/\1/g' | tr '>' '=') - -.PHONY: install-benchmark-minimum -install-benchmark-minimum: ## install the minimum supported versions of the package dependencies - echo pip install $(BENCHMARK_MINIMUM) - -# LINT TARGETS - -.PHONY: lint-btb -lint-btb: ## check style with flake8 and isort - flake8 btb - isort -c --recursive btb - # pydocstyle btb - -.PHONY: lint-tests -lint-tests: ## check style with flake8 and isort - flake8 --ignore=D,SFS2 tests - isort -c --recursive tests - -.PHONY: lint-benchmark -lint: ## check style with flake8 and isort - flake8 benchmark/btb_benchmark - isort -c --recursive -p btb_benchmark benchmark - -.PHONY: check-dependencies -check-dependencies: ## test if there are any broken dependencies - pip check +clean: + find . -name '*.pyo' -delete + find . -name '*.pyc' -delete + find . -name __pycache__ -delete + find . -name '*~' -delete + find . -name '.coverage.*' -delete + coverage erase .PHONY: lint -lint: check-dependencies lint-btb lint-tests lint-benchmark ## Run all code style and static testing validations - -.PHONY: fix-lint -fix-lint: ## fix lint issues using autoflake, autopep8, and isort - find btb -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables - autopep8 --in-place --recursive --aggressive btb - isort --apply --atomic --recursive btb tests benchmark - - -# TEST TARGETS - -.PHONY: test-unit -test-unit: ## run tests quickly with the default Python - python -m pytest --cov=btb - -.PHONY: test-readme -test-readme: ## run the readme snippets - rm -rf tests/readme_test && mkdir tests/readme_test - cd tests/readme_test && rundoc run --single-session python3 -t python3 ../../README.md - rm -rf tests/readme_test - -.PHONY: test-tutorials -test-tutorials: ## run the tutorial notebooks - find tutorials -path "*/.ipynb_checkpoints" -prune -false -o -name "*.ipynb" -exec \ - jupyter nbconvert --execute --ExecutePreprocessor.timeout=3600 --to=html --stdout {} > /dev/null \; - -.PHONY: test -test: test-unit test-readme test-tutorials ## test everything that needs test dependencies - -.PHONY: test-minimum -test-minimum: install-minimum check-dependencies test-unit ## run tests using the minimum supported dependencies - -.PHONY: test-minimum-benchmark -test-minimum: install-benchmark-minimum check-dependencies - -.PHONY: test-all -test-all: ## run tests on every Python version with tox - tox -r - -.PHONY: coverage -coverage: ## check code coverage quickly with the default Python - coverage run --source btb -m pytest - coverage report -m - coverage html - $(BROWSER) htmlcov/index.html - - -# DOCS TARGETS - -.PHONY: docs -docs: clean-docs ## generate Sphinx HTML documentation, including API docs - cp -r tutorials docs - sphinx-apidoc --separate --no-toc -o docs/api/ btb - $(MAKE) -C docs html - -.PHONY: view-docs -view-docs: ## view the docs in a browser - $(BROWSER) docs/_build/html/index.html - -.PHONY: serve-docs -serve-docs: view-docs ## compile the docs watching for changes - watchmedo shell-command -W -R -D -p '*.rst;*.md' -c '$(MAKE) -C docs html' docs - -# DOCKER TARGET - -.PHONY: docker-login -docker-login: - docker login - -.PHONY: docker-build -docker-build: - docker build -t btb -f benchmark/Dockerfile . - -.PHONY: docker-push -docker-push: docker-login docker-build - @$(eval VERSION := $(shell python -c 'import btb; print(btb.__version__)')) - docker tag btb mlbazaar/btb:$(VERSION) - docker push mlbazaar/btb:$(VERSION) - -# RELEASE TARGETS - -.PHONY: dist -dist: clean ## builds source and wheel package - python setup.py sdist - python setup.py bdist_wheel - ls -l dist - -.PHONY: publish-confirm -publish-confirm: - @echo "WARNING: This will irreversibly upload a new version to PyPI!" - @echo -n "Please type 'confirm' to proceed: " \ - && read answer \ - && [ "$${answer}" = "confirm" ] - -.PHONY: publish-test -publish-test: dist publish-confirm ## package and upload a release on TestPyPI - twine upload --repository-url https://test.pypi.org/legacy/ dist/* - -.PHONY: publish -publish: dist publish-confirm ## package and upload a release - twine upload dist/* - -.PHONY: bumpversion-release -bumpversion-release: ## Merge master to stable and bumpversion release - git checkout stable || (git checkout -b stable && git push --set-upstream origin stable) - git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable" - bumpversion release - git push --tags origin stable - -.phony: bumpversion-release-test -bumpversion-release-test: ## merge master to stable and bumpversion release - git checkout stable || git checkout -b stable - git merge --no-ff master -m"make release-tag: merge branch 'master' into stable" - bumpversion release --no-tag - @echo git push --tags origin stable - -.PHONY: bumpversion-patch -bumpversion-patch: ## Merge stable to master and bumpversion patch - git checkout master - git merge stable - bumpversion --no-tag patch - git push - -.PHONY: bumpversion-candidate -bumpversion-candidate: ## Bump the version to the next candidate - bumpversion candidate --no-tag - -.PHONY: bumpversion-minor -bumpversion-minor: ## Bump the version the next minor skipping the release - bumpversion --no-tag minor - -.PHONY: bumpversion-major -bumpversion-major: ## Bump the version the next major skipping the release - bumpversion --no-tag major - -.PHONY: bumpversion-revert -bumpversion-revert: ## Undo a previous bumpversion-release - git checkout master - git branch -D stable - -CLEAN_DIR := $(shell git status --short | grep -v ??) -CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) -CHANGELOG_LINES := $(shell git diff HEAD..origin/stable HISTORY.md 2>&1 | wc -l) - -.PHONY: check-clean -check-clean: ## Check if the directory has uncommitted changes -ifneq ($(CLEAN_DIR),) - $(error There are uncommitted changes) -endif - -.PHONY: check-master -check-master: ## Check if we are in master branch -ifneq ($(CURRENT_BRANCH),master) - $(error Please make the release from master branch\n) -endif - -.PHONY: check-history -check-history: ## Check if HISTORY.md has been modified -ifeq ($(CHANGELOG_LINES),0) - $(error Please insert the release notes in HISTORY.md before releasing) -endif - -.PHONY: check-release -check-release: check-clean check-master check-history ## Check if the release can be made - -.PHONY: release -release: check-release bumpversion-release publish docker-push bumpversion-patch - -.PHONY: release-candidate -release-candidate: check-master publish docker-push bumpversion-candidate - -.PHONY: release-minor -release-minor: check-release bumpversion-minor release - -.PHONY: release-major -release-major: check-release bumpversion-major release +lint: + black btb/ tests/ --check --config=./pyproject.toml + ruff btb/ tests/ --config=./pyproject.toml + +.PHONY: lint-fix +lint-fix: + black btb/ tests/ --config=./pyproject.toml + ruff btb/ tests/ --fix --config=./pyproject.toml \ No newline at end of file diff --git a/btb/__init__.py b/baytune/__init__.py similarity index 82% rename from btb/__init__.py rename to baytune/__init__.py index a7d63a0b..4f50d585 100644 --- a/btb/__init__.py +++ b/baytune/__init__.py @@ -2,7 +2,7 @@ """Top-level package for BTB.""" -from btb.session import BTBSession +from baytune.session import BTBSession __author__ = """MIT Data To AI Lab""" __email__ = 'dailabmit@gmail.com' diff --git a/baytune/selection/__init__.py b/baytune/selection/__init__.py new file mode 100644 index 00000000..6c2e1b19 --- /dev/null +++ b/baytune/selection/__init__.py @@ -0,0 +1,12 @@ +from baytune.selection.best import BestKReward, BestKVelocity +from baytune.selection.hierarchical import HierarchicalByAlgorithm +from baytune.selection.pure import PureBestKVelocity +from baytune.selection.recent import RecentKReward, RecentKVelocity +from baytune.selection.ucb1 import UCB1 +from baytune.selection.uniform import Uniform + +__all__ = ( + 'BestKReward', 'BestKVelocity', 'HierarchicalByAlgorithm', + 'PureBestKVelocity', 'RecentKReward', 'RecentKVelocity', + 'UCB1', 'Uniform', +) diff --git a/btb/selection/best.py b/baytune/selection/best.py similarity index 98% rename from btb/selection/best.py rename to baytune/selection/best.py index b7f2f479..1c488097 100644 --- a/btb/selection/best.py +++ b/baytune/selection/best.py @@ -2,7 +2,7 @@ import numpy as np -from btb.selection.ucb1 import UCB1 +from baytune.selection.ucb1 import UCB1 # the minimum number of scores that each choice must have in order to use best-K # optimizations. If not all choices meet this threshold, default UCB1 selection diff --git a/btb/selection/custom_selector.py b/baytune/selection/custom_selector.py similarity index 83% rename from btb/selection/custom_selector.py rename to baytune/selection/custom_selector.py index 56ba56cb..062dd448 100644 --- a/btb/selection/custom_selector.py +++ b/baytune/selection/custom_selector.py @@ -1,6 +1,6 @@ import random -from btb.selection.selector import Selector +from baytune.selection.selector import Selector class CustomSelector(Selector): diff --git a/btb/selection/hierarchical.py b/baytune/selection/hierarchical.py similarity index 97% rename from btb/selection/hierarchical.py rename to baytune/selection/hierarchical.py index dcd268c3..a5bae42f 100644 --- a/btb/selection/hierarchical.py +++ b/baytune/selection/hierarchical.py @@ -1,4 +1,4 @@ -from btb.selection.ucb1 import UCB1 +from baytune.selection.ucb1 import UCB1 class HierarchicalByAlgorithm(UCB1): diff --git a/btb/selection/pure.py b/baytune/selection/pure.py similarity index 98% rename from btb/selection/pure.py rename to baytune/selection/pure.py index ea053c8d..35ae8822 100644 --- a/btb/selection/pure.py +++ b/baytune/selection/pure.py @@ -1,6 +1,6 @@ import logging -from btb.selection.selector import Selector +from baytune.selection.selector import Selector # the minimum number of scores that each choice must have in order to use best-K # optimizations. If not all choices meet this threshold, default UCB1 selection diff --git a/btb/selection/recent.py b/baytune/selection/recent.py similarity index 98% rename from btb/selection/recent.py rename to baytune/selection/recent.py index 27ceca80..9a5b4602 100644 --- a/btb/selection/recent.py +++ b/baytune/selection/recent.py @@ -1,6 +1,6 @@ import logging -from btb.selection.ucb1 import UCB1 +from baytune.selection.ucb1 import UCB1 # the minimum number of scores that each choice must have in order to use # best-K optimizations. If not all choices meet this threshold, default UCB1 diff --git a/btb/selection/selector.py b/baytune/selection/selector.py similarity index 100% rename from btb/selection/selector.py rename to baytune/selection/selector.py diff --git a/btb/selection/ucb1.py b/baytune/selection/ucb1.py similarity index 96% rename from btb/selection/ucb1.py rename to baytune/selection/ucb1.py index 5a5938f1..f71c8757 100644 --- a/btb/selection/ucb1.py +++ b/baytune/selection/ucb1.py @@ -2,7 +2,7 @@ import numpy as np -from btb.selection.selector import Selector +from baytune.selection.selector import Selector class UCB1(Selector): diff --git a/btb/selection/uniform.py b/baytune/selection/uniform.py similarity index 80% rename from btb/selection/uniform.py rename to baytune/selection/uniform.py index ef5e7ad9..86898a1d 100644 --- a/btb/selection/uniform.py +++ b/baytune/selection/uniform.py @@ -1,6 +1,6 @@ import random -from btb.selection.selector import Selector +from baytune.selection.selector import Selector class Uniform(Selector): diff --git a/btb/session.py b/baytune/session.py similarity index 98% rename from btb/session.py rename to baytune/session.py index b6a13e04..0b94d4de 100644 --- a/btb/session.py +++ b/baytune/session.py @@ -9,10 +9,10 @@ import numpy as np from tqdm.auto import trange -from btb.selection.ucb1 import UCB1 -from btb.tuning.tunable import Tunable -from btb.tuning.tuners.base import StopTuning -from btb.tuning.tuners.gaussian_process import GPTuner +from baytune.selection.ucb1 import UCB1 +from baytune.tuning.tunable import Tunable +from baytune.tuning.tuners.base import StopTuning +from baytune.tuning.tuners.gaussian_process import GPTuner LOGGER = logging.getLogger(__name__) diff --git a/baytune/tuning/__init__.py b/baytune/tuning/__init__.py new file mode 100644 index 00000000..6fafd843 --- /dev/null +++ b/baytune/tuning/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +"""Top level of the tuning module.""" + +from baytune.tuning.hyperparams.boolean import BooleanHyperParam +from baytune.tuning.hyperparams.categorical import CategoricalHyperParam +from baytune.tuning.hyperparams.numerical import FloatHyperParam, IntHyperParam +from baytune.tuning.tunable import Tunable +from baytune.tuning.tuners.base import StopTuning +from baytune.tuning.tuners.gaussian_process import GCPEiTuner, GCPTuner, GPEiTuner, GPTuner +from baytune.tuning.tuners.uniform import UniformTuner + +__all__ = ( + 'BooleanHyperParam', + 'CategoricalHyperParam', + 'GCPEiTuner', + 'GCPTuner', + 'GPEiTuner', + 'GPTuner', + 'FloatHyperParam', + 'IntHyperParam', + 'StopTuning', + 'Tunable', + 'UniformTuner', +) diff --git a/baytune/tuning/acquisition/__init__.py b/baytune/tuning/acquisition/__init__.py new file mode 100644 index 00000000..4b779426 --- /dev/null +++ b/baytune/tuning/acquisition/__init__.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- + +"""Top level where all the acquisition functions are imported.""" + +from baytune.tuning.acquisition.expected_improvement import ExpectedImprovementAcquisition +from baytune.tuning.acquisition.predicted_score import PredictedScoreAcquisition + +__all__ = ('ExpectedImprovementAcquisition', 'PredictedScoreAcquisition') diff --git a/btb/tuning/acquisition/base.py b/baytune/tuning/acquisition/base.py similarity index 100% rename from btb/tuning/acquisition/base.py rename to baytune/tuning/acquisition/base.py diff --git a/btb/tuning/acquisition/expected_improvement.py b/baytune/tuning/acquisition/expected_improvement.py similarity index 89% rename from btb/tuning/acquisition/expected_improvement.py rename to baytune/tuning/acquisition/expected_improvement.py index b467b118..d06736a7 100644 --- a/btb/tuning/acquisition/expected_improvement.py +++ b/baytune/tuning/acquisition/expected_improvement.py @@ -5,7 +5,7 @@ import numpy as np from scipy.stats import norm -from btb.tuning.acquisition.base import BaseAcquisition +from baytune.tuning.acquisition.base import BaseAcquisition class ExpectedImprovementAcquisition(BaseAcquisition): diff --git a/btb/tuning/acquisition/predicted_score.py b/baytune/tuning/acquisition/predicted_score.py similarity index 82% rename from btb/tuning/acquisition/predicted_score.py rename to baytune/tuning/acquisition/predicted_score.py index a4147cb9..38324dff 100644 --- a/btb/tuning/acquisition/predicted_score.py +++ b/baytune/tuning/acquisition/predicted_score.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from btb.tuning.acquisition.base import BaseAcquisition +from baytune.tuning.acquisition.base import BaseAcquisition class PredictedScoreAcquisition(BaseAcquisition): diff --git a/baytune/tuning/hyperparams/__init__.py b/baytune/tuning/hyperparams/__init__.py new file mode 100644 index 00000000..08586b04 --- /dev/null +++ b/baytune/tuning/hyperparams/__init__.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- + +"""Top level where all the hyperparameters are imported.""" + +from baytune.tuning.hyperparams.boolean import BooleanHyperParam +from baytune.tuning.hyperparams.categorical import CategoricalHyperParam +from baytune.tuning.hyperparams.numerical import FloatHyperParam, IntHyperParam + +__all__ = ('BooleanHyperParam', 'CategoricalHyperParam', 'FloatHyperParam', 'IntHyperParam') diff --git a/btb/tuning/hyperparams/base.py b/baytune/tuning/hyperparams/base.py similarity index 100% rename from btb/tuning/hyperparams/base.py rename to baytune/tuning/hyperparams/base.py diff --git a/btb/tuning/hyperparams/boolean.py b/baytune/tuning/hyperparams/boolean.py similarity index 98% rename from btb/tuning/hyperparams/boolean.py rename to baytune/tuning/hyperparams/boolean.py index d60620fb..5af68959 100644 --- a/btb/tuning/hyperparams/boolean.py +++ b/baytune/tuning/hyperparams/boolean.py @@ -4,7 +4,7 @@ import numpy as np -from btb.tuning.hyperparams.base import BaseHyperParam +from baytune.tuning.hyperparams.base import BaseHyperParam class BooleanHyperParam(BaseHyperParam): diff --git a/btb/tuning/hyperparams/categorical.py b/baytune/tuning/hyperparams/categorical.py similarity index 99% rename from btb/tuning/hyperparams/categorical.py rename to baytune/tuning/hyperparams/categorical.py index 4bd3d51a..b9d7ae64 100644 --- a/btb/tuning/hyperparams/categorical.py +++ b/baytune/tuning/hyperparams/categorical.py @@ -7,7 +7,7 @@ import numpy as np from sklearn.preprocessing import OneHotEncoder -from btb.tuning.hyperparams.base import BaseHyperParam +from baytune.tuning.hyperparams.base import BaseHyperParam class CategoricalHyperParam(BaseHyperParam): diff --git a/btb/tuning/hyperparams/numerical.py b/baytune/tuning/hyperparams/numerical.py similarity index 99% rename from btb/tuning/hyperparams/numerical.py rename to baytune/tuning/hyperparams/numerical.py index 24574623..1f3eac33 100644 --- a/btb/tuning/hyperparams/numerical.py +++ b/baytune/tuning/hyperparams/numerical.py @@ -6,7 +6,7 @@ import numpy as np -from btb.tuning.hyperparams.base import BaseHyperParam +from baytune.tuning.hyperparams.base import BaseHyperParam class NumericalHyperParam(BaseHyperParam): diff --git a/btb/tuning/metamodels/__init__.py b/baytune/tuning/metamodels/__init__.py similarity index 60% rename from btb/tuning/metamodels/__init__.py rename to baytune/tuning/metamodels/__init__.py index 4b7654ff..7fd0eb81 100644 --- a/btb/tuning/metamodels/__init__.py +++ b/baytune/tuning/metamodels/__init__.py @@ -2,6 +2,6 @@ """Top level where all the metamodels are imported.""" -from btb.tuning.metamodels.gaussian_process import GaussianProcessMetaModel +from baytune.tuning.metamodels.gaussian_process import GaussianProcessMetaModel __all__ = ('GaussianProcessMetaModel', ) diff --git a/btb/tuning/metamodels/base.py b/baytune/tuning/metamodels/base.py similarity index 100% rename from btb/tuning/metamodels/base.py rename to baytune/tuning/metamodels/base.py diff --git a/btb/tuning/metamodels/gaussian_process.py b/baytune/tuning/metamodels/gaussian_process.py similarity index 98% rename from btb/tuning/metamodels/gaussian_process.py rename to baytune/tuning/metamodels/gaussian_process.py index 56720847..69bf3726 100644 --- a/btb/tuning/metamodels/gaussian_process.py +++ b/baytune/tuning/metamodels/gaussian_process.py @@ -7,7 +7,7 @@ from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import RBF -from btb.tuning.metamodels.base import BaseMetaModel +from baytune.tuning.metamodels.base import BaseMetaModel class GaussianProcessMetaModel(BaseMetaModel): diff --git a/btb/tuning/tunable.py b/baytune/tuning/tunable.py similarity index 97% rename from btb/tuning/tunable.py rename to baytune/tuning/tunable.py index 493d94fb..41ba6956 100644 --- a/btb/tuning/tunable.py +++ b/baytune/tuning/tunable.py @@ -3,9 +3,9 @@ import numpy as np import pandas as pd -from btb.tuning.hyperparams.boolean import BooleanHyperParam -from btb.tuning.hyperparams.categorical import CategoricalHyperParam -from btb.tuning.hyperparams.numerical import FloatHyperParam, IntHyperParam +from baytune.tuning.hyperparams.boolean import BooleanHyperParam +from baytune.tuning.hyperparams.categorical import CategoricalHyperParam +from baytune.tuning.hyperparams.numerical import FloatHyperParam, IntHyperParam """Package where the Tunable class is defined.""" diff --git a/btb/tuning/tuners/__init__.py b/baytune/tuning/tuners/__init__.py similarity index 55% rename from btb/tuning/tuners/__init__.py rename to baytune/tuning/tuners/__init__.py index 52f923ab..03d2e645 100644 --- a/btb/tuning/tuners/__init__.py +++ b/baytune/tuning/tuners/__init__.py @@ -2,8 +2,8 @@ """Package where all the available tuners are imported.""" -from btb.tuning.tuners.gaussian_process import GCPEiTuner, GCPTuner, GPEiTuner, GPTuner -from btb.tuning.tuners.uniform import UniformTuner +from baytune.tuning.tuners.gaussian_process import GCPEiTuner, GCPTuner, GPEiTuner, GPTuner +from baytune.tuning.tuners.uniform import UniformTuner __all__ = ( 'GCPEiTuner', diff --git a/btb/tuning/tuners/base.py b/baytune/tuning/tuners/base.py similarity index 99% rename from btb/tuning/tuners/base.py rename to baytune/tuning/tuners/base.py index d398e69c..43db015b 100644 --- a/btb/tuning/tuners/base.py +++ b/baytune/tuning/tuners/base.py @@ -7,8 +7,8 @@ import numpy as np -from btb.tuning.acquisition.base import BaseAcquisition -from btb.tuning.metamodels.base import BaseMetaModel +from baytune.tuning.acquisition.base import BaseAcquisition +from baytune.tuning.metamodels.base import BaseMetaModel LOGGER = logging.getLogger(__name__) diff --git a/btb/tuning/tuners/gaussian_process.py b/baytune/tuning/tuners/gaussian_process.py similarity index 94% rename from btb/tuning/tuners/gaussian_process.py rename to baytune/tuning/tuners/gaussian_process.py index 1b60a5dd..7a215873 100644 --- a/btb/tuning/tuners/gaussian_process.py +++ b/baytune/tuning/tuners/gaussian_process.py @@ -2,11 +2,11 @@ """Package where the tuners based on GaussianProcessMetaModel are defined.""" -from btb.tuning.acquisition.expected_improvement import ExpectedImprovementAcquisition -from btb.tuning.acquisition.predicted_score import PredictedScoreAcquisition -from btb.tuning.metamodels.gaussian_process import ( +from baytune.tuning.acquisition.expected_improvement import ExpectedImprovementAcquisition +from baytune.tuning.acquisition.predicted_score import PredictedScoreAcquisition +from baytune.tuning.metamodels.gaussian_process import ( GaussianCopulaProcessMetaModel, GaussianProcessMetaModel) -from btb.tuning.tuners.base import BaseMetaModelTuner +from baytune.tuning.tuners.base import BaseMetaModelTuner class GPTuner(GaussianProcessMetaModel, PredictedScoreAcquisition, BaseMetaModelTuner): diff --git a/btb/tuning/tuners/uniform.py b/baytune/tuning/tuners/uniform.py similarity index 93% rename from btb/tuning/tuners/uniform.py rename to baytune/tuning/tuners/uniform.py index 647011ac..75def2ad 100644 --- a/btb/tuning/tuners/uniform.py +++ b/baytune/tuning/tuners/uniform.py @@ -2,7 +2,7 @@ """Package where the UniformTuner class is defined.""" -from btb.tuning.tuners.base import BaseTuner +from baytune.tuning.tuners.base import BaseTuner class UniformTuner(BaseTuner): diff --git a/benchmark/btb_benchmark/main.py b/benchmark/btb_benchmark/main.py index b65830c8..37a07a48 100644 --- a/benchmark/btb_benchmark/main.py +++ b/benchmark/btb_benchmark/main.py @@ -9,7 +9,7 @@ from distributed.client import futures_of from distributed.diagnostics.progressbar import TextProgressBar -from btb.tuning.tuners.base import BaseTuner +from baytune.tuning.tuners.base import BaseTuner from btb_benchmark.challenges import ( MATH_CHALLENGES, RandomForestChallenge, SGDChallenge, XGBoostChallenge) from btb_benchmark.challenges.challenge import Challenge diff --git a/benchmark/btb_benchmark/tuning_functions/btb.py b/benchmark/btb_benchmark/tuning_functions/btb.py index d4540e83..af6aee3a 100644 --- a/benchmark/btb_benchmark/tuning_functions/btb.py +++ b/benchmark/btb_benchmark/tuning_functions/btb.py @@ -2,8 +2,8 @@ import numpy as np -from btb.tuning.tunable import Tunable -from btb.tuning.tuners import GCPEiTuner, GCPTuner, GPEiTuner, GPTuner, UniformTuner +from baytune.tuning.tunable import Tunable +from baytune.tuning.tuners import GCPEiTuner, GCPTuner, GPEiTuner, GPTuner, UniformTuner def _tuning_function(tuner_class, scoring_function, tunable_hyperparameters, iterations): diff --git a/btb/selection/__init__.py b/btb/selection/__init__.py deleted file mode 100644 index 354f6d28..00000000 --- a/btb/selection/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -from btb.selection.best import BestKReward, BestKVelocity -from btb.selection.hierarchical import HierarchicalByAlgorithm -from btb.selection.pure import PureBestKVelocity -from btb.selection.recent import RecentKReward, RecentKVelocity -from btb.selection.ucb1 import UCB1 -from btb.selection.uniform import Uniform - -__all__ = ( - 'BestKReward', 'BestKVelocity', 'HierarchicalByAlgorithm', - 'PureBestKVelocity', 'RecentKReward', 'RecentKVelocity', - 'UCB1', 'Uniform', -) diff --git a/btb/tuning/__init__.py b/btb/tuning/__init__.py deleted file mode 100644 index cd79f143..00000000 --- a/btb/tuning/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- - -"""Top level of the tuning module.""" - -from btb.tuning.hyperparams.boolean import BooleanHyperParam -from btb.tuning.hyperparams.categorical import CategoricalHyperParam -from btb.tuning.hyperparams.numerical import FloatHyperParam, IntHyperParam -from btb.tuning.tunable import Tunable -from btb.tuning.tuners.base import StopTuning -from btb.tuning.tuners.gaussian_process import GCPEiTuner, GCPTuner, GPEiTuner, GPTuner -from btb.tuning.tuners.uniform import UniformTuner - -__all__ = ( - 'BooleanHyperParam', - 'CategoricalHyperParam', - 'GCPEiTuner', - 'GCPTuner', - 'GPEiTuner', - 'GPTuner', - 'FloatHyperParam', - 'IntHyperParam', - 'StopTuning', - 'Tunable', - 'UniformTuner', -) diff --git a/btb/tuning/acquisition/__init__.py b/btb/tuning/acquisition/__init__.py deleted file mode 100644 index 537786c5..00000000 --- a/btb/tuning/acquisition/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- - -"""Top level where all the acquisition functions are imported.""" - -from btb.tuning.acquisition.expected_improvement import ExpectedImprovementAcquisition -from btb.tuning.acquisition.predicted_score import PredictedScoreAcquisition - -__all__ = ('ExpectedImprovementAcquisition', 'PredictedScoreAcquisition') diff --git a/btb/tuning/hyperparams/__init__.py b/btb/tuning/hyperparams/__init__.py deleted file mode 100644 index 56a6e89b..00000000 --- a/btb/tuning/hyperparams/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- - -"""Top level where all the hyperparameters are imported.""" - -from btb.tuning.hyperparams.boolean import BooleanHyperParam -from btb.tuning.hyperparams.categorical import CategoricalHyperParam -from btb.tuning.hyperparams.numerical import FloatHyperParam, IntHyperParam - -__all__ = ('BooleanHyperParam', 'CategoricalHyperParam', 'FloatHyperParam', 'IntHyperParam') diff --git a/docs/conf.py b/docs/conf.py index e089a3a1..6fe7ea9b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,7 @@ import sphinx_rtd_theme # For read the docs theme -import btb +import baytune # -- General configuration --------------------------------------------- @@ -69,9 +69,9 @@ # the built documents. # # The short X.Y version. -version = btb.__version__ +version = baytune.__version__ # The full version, including alpha/beta/rc tags. -release = btb.__version__ +release = baytune.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..6a81458b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,149 @@ +[project] +name = "baytune" +readme = "README.md" +description = "Bayesian Tuning and Bandits" +dynamic = ["version"] +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "Topic :: Software Development", + "Topic :: Scientific/Engineering", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Operating System :: Unix", + "Operating System :: MacOS", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", +] +authors = [ + {name="MIT Data to AI Lab", email="dailabmit@mit.edu"} +] +maintainers = [ + {name="MIT Data to AI Lab", email="dailabmit@mit.edu"} +] +keywords = ["data science", "machine learning", "hyperparameters", "tuning", "classification"] +license = {text = "MIT License"} +requires-python = ">=3.8,<4" +dependencies = [ + 'copulas>=0.3.2,<1', + 'numpy>=1.20.0', + 'scikit-learn>=0.20.0', + 'scipy>=1.2,<2', + 'pandas>=1', + 'tqdm>=4.36.1,<5', +] + +[project.urls] +"Source Code"= "https://github.com/MLBazaar/BTB/" +"Issue Tracker" = "https://github.com/MLBazaar/BTB/issues" +"Twitter" = "https://twitter.com/lab_dai" + +[project.optional-dependencies] +test = [ + "pytest>=3.4.2", + "pytest-cov>=2.6.0", + "pytest-rerunfailures>=9.1.1,<10", + "jupyter>=1.0.0,<2", + "rundoc>=0.4.3,<0.5", + 'importlib-metadata<2.0.0,>=0.12' +] +dev = [ + "ruff >= 0.0.260" , + "black[jupyter] >= 22.12.0", + "pre-commit == 2.20.0", +] +docs = [ + # docs + 'm2r>=0.2.0,<0.3', + 'nbsphinx>=0.5.0,<0.7', + 'Sphinx>=1.7.1,<3', + 'sphinx_rtd_theme>=0.2.4,<0.5', +] + +[tool.setuptools] +include-package-data = true +license-files = ["LICENSE"] + +[tool.setuptools.packages.find] +namespaces = true + +[tool.setuptools.package-data] +"*" = [ + "*.txt", + "README.md", + "Makefile", +] + +[tool.setuptools.exclude-package-data] +"*" = [ + "* __pycache__", + "*.py[co]", +] + +[tool.setuptools.dynamic] +version = {attr = "baytune.version.__version__"} + +[tool.pytest.ini_options] +testpaths = [ + "baytune/tests/*" +] + +[tool.coverage.run] +source = ["baytune"] + +[tool.coverage.report] +exclude_lines =[ + "pragma: no cover", + "def __repr__", + "raise AssertionError", + "raise NotImplementedError", + "if __name__ == .__main__.:", + "if self._verbose:", + "if verbose:", + "if profile:", + "pytest.skip" +] + +[build-system] +requires = [ + "setuptools >= 61.0.0", + "wheel" +] +build-backend = "setuptools.build_meta" + +[tool.black] +line-length = 88 +target-version = ["py311"] + +[tool.ruff] +# Never enforce `E501` (line length violations) +line-length = 88 +ignore = ["E501"] +exclude = [ + "Examples", +] +select = [ + # Pyflakes + "F", + # Pycodestyle + "E", + "W", + # flake8-quotes + "Q", + # isort + "I001" +] +src = ["baytune"] + +[tool.ruff.isort] +known-first-party = ["baytune"] + +[tool.ruff.per-file-ignores] +"__init__.py" = ["F401", "E402", "F403", "F405", "E501", "I001"] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 825c9c8a..00000000 --- a/setup.cfg +++ /dev/null @@ -1,59 +0,0 @@ -[bumpversion] -current_version = 0.4.1.dev0 -commit = True -tag = True -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? -serialize = - {major}.{minor}.{patch}.{release}{candidate} - {major}.{minor}.{patch} - -[bumpversion:part:release] -optional_value = release -first_value = dev -values = - dev - release - -[bumpversion:part:candidate] - -[bumpversion:file:setup.py] -search = version='{current_version}' -replace = version='{new_version}' - -[bumpversion:file:btb/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - -[bumpversion:file:benchmark/setup.py] -search = version='{current_version}' -replace = version='{new_version}' - -[bumpversion:file:benchmark/btb_benchmark/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - -[bdist_wheel] -universal = 1 - -[flake8] -max-line-length = 99 -exclude = docs, .tox, .git, __pycache__, .ipynb_checkpoints -ignore = # keep empty to prevent default ignores - -[isort] -include_trailing_comment = True -line_length = 99 -lines_between_types = 0 -multi_line_output = 4 -not_skip = __init__.py -use_parentheses = True - -[aliases] -test = pytest - -[tool:pytest] -collect_ignore = ['setup.py'] - -[pydocstyle] -ignore = D105, D107, D407, D203, D213, D413, D406, D417 - diff --git a/setup.py b/setup.py deleted file mode 100644 index 711f8a64..00000000 --- a/setup.py +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -"""The setup script.""" - -from setuptools import find_packages, setup - - -try: - with open('README.md') as readme_file: - readme = readme_file.read() - -except IOError: - readme = '' - - -try: - with open('HISTORY.md') as history_file: - history = history_file.read() - -except IOError: - history = '' - - -install_requires = [ - 'copulas>=0.3.2,<1', - 'numpy>=1.20.0', - 'scikit-learn>=0.20.0', - 'scipy>=1.2,<2', - 'pandas>=1', - 'tqdm>=4.36.1,<5', -] - - -tests_require = [ - 'pytest>=3.4.2', - 'pytest-cov>=2.6.0', - 'pytest-rerunfailures>=9.1.1,<10', - 'jupyter>=1.0.0,<2', - 'rundoc>=0.4.3,<0.5', -] - - -setup_requires = [ - 'pytest-runner>=2.11.1', -] - - -development_requires = [ - # general - 'pip>=9.0.1', - 'bumpversion>=0.5.3,<0.6', - 'watchdog>=0.8.3,<0.11', - - # docs - 'm2r>=0.2.0,<0.3', - 'nbsphinx>=0.5.0,<0.7', - 'Sphinx>=1.7.1,<3', - 'sphinx_rtd_theme>=0.2.4,<0.5', - - # style check - 'flake8>=3.7.7,<4', - 'flake8-absolute-import>=1.0,<2', - # 'flake8-docstrings>=1.5.0,<2', - # 'flake8-sfs>=0.0.3,<0.1', - 'isort>=4.3.4,<5', - 'pylint>=2.5.3,<3', - - # fix style issues - 'autoflake>=1.1,<2', - 'autopep8>=1.4.3,<2', - - # distribute on PyPI - 'twine>=1.10.0,<4', - 'wheel>=0.30.0', - - # Advanced testing - 'coverage>=4.5.1,<6', - 'tox>=2.9.1,<4', - 'importlib-metadata<2.0.0,>=0.12' -] - - -setup( - author='MIT Data To AI Lab', - author_email='dailabmit@gmail.com', - classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - ], - description='Bayesian Tuning and Bandits', - extras_require={ - 'test': tests_require, - 'dev': development_requires + tests_require, - }, - include_package_data=True, - install_requires=install_requires, - keywords='machine learning hyperparameters tuning classification', - license='MIT license', - long_description=readme + '\n\n' + history, - long_description_content_type='text/markdown', - name='baytune', - packages=find_packages(include=['btb', 'btb.*']), - python_requires='>=3.8,<3.12', - setup_requires=setup_requires, - test_suite='tests', - tests_require=tests_require, - url='https://github.com/MLBazaar/BTB', - version='0.4.1.dev0', - zip_safe=False, -) diff --git a/tests/integration/test_session.py b/tests/integration/test_session.py index 5b9094a3..0324bc5e 100644 --- a/tests/integration/test_session.py +++ b/tests/integration/test_session.py @@ -4,8 +4,8 @@ import pytest -from btb.session import BTBSession -from btb.tuning import StopTuning +from baytune.session import BTBSession +from baytune.tuning import StopTuning class BTBSessionTest(TestCase): diff --git a/tests/integration/test_tuning.py b/tests/integration/test_tuning.py index bfa898f4..6bddd72d 100644 --- a/tests/integration/test_tuning.py +++ b/tests/integration/test_tuning.py @@ -2,8 +2,8 @@ import random -from btb.tuning import GPTuner, Tunable -from btb.tuning.hyperparams import ( +from baytune.tuning import GPTuner, Tunable +from baytune.tuning.hyperparams import ( BooleanHyperParam, CategoricalHyperParam, FloatHyperParam, IntHyperParam) diff --git a/tests/selection/test_best.py b/tests/selection/test_best.py index 0a0348ee..3fed60f5 100644 --- a/tests/selection/test_best.py +++ b/tests/selection/test_best.py @@ -3,7 +3,7 @@ import numpy as np -from btb.selection.best import BestKReward, BestKVelocity +from baytune.selection.best import BestKReward, BestKVelocity class TestBestKReward(TestCase): diff --git a/tests/selection/test_custom_selector.py b/tests/selection/test_custom_selector.py index 96a6b67f..921b8012 100644 --- a/tests/selection/test_custom_selector.py +++ b/tests/selection/test_custom_selector.py @@ -1,7 +1,7 @@ from unittest import TestCase from unittest.mock import patch -from btb.selection.custom_selector import CustomSelector +from baytune.selection.custom_selector import CustomSelector class TestCustomSelector(TestCase): diff --git a/tests/selection/test_hierarchical.py b/tests/selection/test_hierarchical.py index 003ced84..01fb929e 100644 --- a/tests/selection/test_hierarchical.py +++ b/tests/selection/test_hierarchical.py @@ -1,7 +1,7 @@ from unittest import TestCase from unittest.mock import patch -from btb.selection.hierarchical import HierarchicalByAlgorithm +from baytune.selection.hierarchical import HierarchicalByAlgorithm class TestHierarchicalByAlgorithm(TestCase): diff --git a/tests/selection/test_pure.py b/tests/selection/test_pure.py index bf36ffad..0005b980 100644 --- a/tests/selection/test_pure.py +++ b/tests/selection/test_pure.py @@ -4,7 +4,7 @@ import numpy as np from pytest import approx -from btb.selection.pure import PureBestKVelocity +from baytune.selection.pure import PureBestKVelocity class TestPureBestKVelocity(TestCase): diff --git a/tests/selection/test_recent.py b/tests/selection/test_recent.py index bcb5e6a5..49801b66 100644 --- a/tests/selection/test_recent.py +++ b/tests/selection/test_recent.py @@ -3,7 +3,7 @@ import numpy as np -from btb.selection.recent import RecentKReward, RecentKVelocity +from baytune.selection.recent import RecentKReward, RecentKVelocity class TestRecentKReward(TestCase): diff --git a/tests/selection/test_selector.py b/tests/selection/test_selector.py index cc00ebaf..c8234d23 100644 --- a/tests/selection/test_selector.py +++ b/tests/selection/test_selector.py @@ -1,6 +1,6 @@ from unittest import TestCase -from btb.selection.selector import Selector +from baytune.selection.selector import Selector class TestSelector(TestCase): diff --git a/tests/selection/test_ucb1.py b/tests/selection/test_ucb1.py index b2e55caa..3b157a62 100644 --- a/tests/selection/test_ucb1.py +++ b/tests/selection/test_ucb1.py @@ -1,7 +1,7 @@ from unittest import TestCase from unittest.mock import patch -from btb.selection.ucb1 import UCB1 +from baytune.selection.ucb1 import UCB1 class TestUCB1(TestCase): diff --git a/tests/selection/test_uniform.py b/tests/selection/test_uniform.py index 215a96b1..6f81aed6 100644 --- a/tests/selection/test_uniform.py +++ b/tests/selection/test_uniform.py @@ -1,7 +1,7 @@ from unittest import TestCase from unittest.mock import patch -from btb.selection.uniform import Uniform +from baytune.selection.uniform import Uniform class TestUniform(TestCase): diff --git a/tests/test_session.py b/tests/test_session.py index 47349872..943dca66 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -7,9 +7,9 @@ import numpy as np from tqdm.auto import trange -from btb.session import BTBSession -from btb.tuning.tuners.base import StopTuning -from btb.tuning.tuners.gaussian_process import GPTuner +from baytune.session import BTBSession +from baytune.tuning.tuners.base import StopTuning +from baytune.tuning.tuners.gaussian_process import GPTuner class TestBTBSession(TestCase): diff --git a/tests/tuning/acquisition/test_expected_improvement.py b/tests/tuning/acquisition/test_expected_improvement.py index bb7605e0..7e6b43dc 100644 --- a/tests/tuning/acquisition/test_expected_improvement.py +++ b/tests/tuning/acquisition/test_expected_improvement.py @@ -4,7 +4,7 @@ import numpy as np -from btb.tuning.acquisition.expected_improvement import ExpectedImprovementAcquisition +from baytune.tuning.acquisition.expected_improvement import ExpectedImprovementAcquisition class TestExpectedImprovementAcquisition(TestCase): diff --git a/tests/tuning/acquisition/test_predicted_score.py b/tests/tuning/acquisition/test_predicted_score.py index 94cecabd..fd87151b 100644 --- a/tests/tuning/acquisition/test_predicted_score.py +++ b/tests/tuning/acquisition/test_predicted_score.py @@ -5,7 +5,7 @@ import numpy as np -from btb.tuning.acquisition.predicted_score import PredictedScoreAcquisition +from baytune.tuning.acquisition.predicted_score import PredictedScoreAcquisition def assert_called_with_np_array(mock_calls, real_calls): diff --git a/tests/tuning/hyperparams/test_base.py b/tests/tuning/hyperparams/test_base.py index 405aa9fb..910262c0 100644 --- a/tests/tuning/hyperparams/test_base.py +++ b/tests/tuning/hyperparams/test_base.py @@ -5,7 +5,7 @@ import numpy as np -from btb.tuning.hyperparams.base import BaseHyperParam +from baytune.tuning.hyperparams.base import BaseHyperParam class TestBaseHyperParam(TestCase): diff --git a/tests/tuning/hyperparams/test_boolean.py b/tests/tuning/hyperparams/test_boolean.py index 1b896ea7..b2187021 100644 --- a/tests/tuning/hyperparams/test_boolean.py +++ b/tests/tuning/hyperparams/test_boolean.py @@ -5,7 +5,7 @@ import numpy as np -from btb.tuning.hyperparams.boolean import BooleanHyperParam +from baytune.tuning.hyperparams.boolean import BooleanHyperParam class TestBooleanHyperParam(TestCase): diff --git a/tests/tuning/hyperparams/test_categorical.py b/tests/tuning/hyperparams/test_categorical.py index 2a4253e7..3f06fca6 100644 --- a/tests/tuning/hyperparams/test_categorical.py +++ b/tests/tuning/hyperparams/test_categorical.py @@ -5,7 +5,7 @@ import numpy as np -from btb.tuning.hyperparams.categorical import CategoricalHyperParam +from baytune.tuning.hyperparams.categorical import CategoricalHyperParam def assert_called_with_np_array(mock_calls, real_calls): diff --git a/tests/tuning/hyperparams/test_numerical.py b/tests/tuning/hyperparams/test_numerical.py index 17bbe948..7a197422 100644 --- a/tests/tuning/hyperparams/test_numerical.py +++ b/tests/tuning/hyperparams/test_numerical.py @@ -6,7 +6,7 @@ import numpy as np -from btb.tuning.hyperparams.numerical import FloatHyperParam, IntHyperParam +from baytune.tuning.hyperparams.numerical import FloatHyperParam, IntHyperParam class TestFloatHyperParam(TestCase): diff --git a/tests/tuning/metamodels/test_base.py b/tests/tuning/metamodels/test_base.py index 6bc0e43b..e9a90d25 100644 --- a/tests/tuning/metamodels/test_base.py +++ b/tests/tuning/metamodels/test_base.py @@ -5,7 +5,7 @@ import numpy as np -from btb.tuning.metamodels.base import BaseMetaModel +from baytune.tuning.metamodels.base import BaseMetaModel class TestBaseMetaModel(TestCase): diff --git a/tests/tuning/metamodels/test_gaussian_process.py b/tests/tuning/metamodels/test_gaussian_process.py index c0049755..13969a79 100644 --- a/tests/tuning/metamodels/test_gaussian_process.py +++ b/tests/tuning/metamodels/test_gaussian_process.py @@ -7,7 +7,7 @@ from copulas.univariate import Univariate from sklearn.gaussian_process import GaussianProcessRegressor -from btb.tuning.metamodels.gaussian_process import ( +from baytune.tuning.metamodels.gaussian_process import ( GaussianCopulaProcessMetaModel, GaussianProcessMetaModel) diff --git a/tests/tuning/test_tunable.py b/tests/tuning/test_tunable.py index 0d4f58ba..cafb32a8 100644 --- a/tests/tuning/test_tunable.py +++ b/tests/tuning/test_tunable.py @@ -6,10 +6,10 @@ import numpy as np import pandas as pd -from btb.tuning.hyperparams.boolean import BooleanHyperParam -from btb.tuning.hyperparams.categorical import CategoricalHyperParam -from btb.tuning.hyperparams.numerical import IntHyperParam -from btb.tuning.tunable import Tunable +from baytune.tuning.hyperparams.boolean import BooleanHyperParam +from baytune.tuning.hyperparams.categorical import CategoricalHyperParam +from baytune.tuning.hyperparams.numerical import IntHyperParam +from baytune.tuning.tunable import Tunable def assert_called_with_np_array(mock_calls, real_calls): diff --git a/tests/tuning/tuners/test_base.py b/tests/tuning/tuners/test_base.py index 2738fc03..3d3144b1 100644 --- a/tests/tuning/tuners/test_base.py +++ b/tests/tuning/tuners/test_base.py @@ -5,8 +5,8 @@ import numpy as np -from btb.tuning.tunable import Tunable -from btb.tuning.tuners.base import BaseMetaModelTuner, BaseTuner, StopTuning +from baytune.tuning.tunable import Tunable +from baytune.tuning.tuners.base import BaseMetaModelTuner, BaseTuner, StopTuning class TestBaseTuner(TestCase): diff --git a/tests/tuning/tuners/test_gaussian_process.py b/tests/tuning/tuners/test_gaussian_process.py index 80ed8e46..2a598709 100644 --- a/tests/tuning/tuners/test_gaussian_process.py +++ b/tests/tuning/tuners/test_gaussian_process.py @@ -5,8 +5,8 @@ from sklearn.gaussian_process import GaussianProcessRegressor -from btb.tuning.tunable import Tunable -from btb.tuning.tuners.gaussian_process import GCPEiTuner, GCPTuner, GPEiTuner, GPTuner +from baytune.tuning.tunable import Tunable +from baytune.tuning.tuners.gaussian_process import GCPEiTuner, GCPTuner, GPEiTuner, GPTuner class TestGaussianProcessTuner(TestCase): diff --git a/tests/tuning/tuners/test_uniform.py b/tests/tuning/tuners/test_uniform.py index 425d4289..fca149b6 100644 --- a/tests/tuning/tuners/test_uniform.py +++ b/tests/tuning/tuners/test_uniform.py @@ -3,8 +3,8 @@ from unittest import TestCase from unittest.mock import MagicMock -from btb.tuning.tunable import Tunable -from btb.tuning.tuners.uniform import UniformTuner +from baytune.tuning.tunable import Tunable +from baytune.tuning.tuners.uniform import UniformTuner class TestUniformTuner(TestCase):