Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating inputs for MABSelector to new types LearningPolicyType and NeighboorhoodPolicyType from the new version of mabwiser #162

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions alns/select/MABSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from alns.select.OperatorSelectionScheme import OperatorSelectionScheme

try:
from mabwiser.mab import MAB, LearningPolicy, NeighborhoodPolicy
from mabwiser.mab import MAB, LearningPolicyType, NeighborhoodPolicyType

MABWISER_AVAILABLE = True
except ModuleNotFoundError:
Expand Down Expand Up @@ -79,8 +79,8 @@ def __init__(
scores: List[float],
num_destroy: int,
num_repair: int,
learning_policy: "LearningPolicy",
neighborhood_policy: Optional["NeighborhoodPolicy"] = None,
learning_policy: LearningPolicyType,
neighborhood_policy: Optional[NeighborhoodPolicyType] = None,
N-Wouda marked this conversation as resolved.
Show resolved Hide resolved
seed: Optional[int] = None,
op_coupling: Optional[np.ndarray] = None,
**kwargs,
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ classifiers = [
python = "^3.8, <4.0"
numpy = ">=1.18.0"
matplotlib = ">=3.5.0"
mabwiser = { version = ">=2.7.0", optional = true }
mabwiser = { version = ">=2.7.1", optional = true }
N-Wouda marked this conversation as resolved.
Show resolved Hide resolved

[tool.poetry.extras]
mabwiser = ["mabwiser"] # optional integration with MABWiser
Expand All @@ -44,7 +44,7 @@ pre-commit = "^2.20.0"
pytest = ">=6.0.0"
pytest-cov = ">=2.6.1"
codecov = "*"
mabwiser = ">=2.7.0"
mabwiser = ">=2.7.1"

# This optional docs group is needed to build the documentation. It is not
# required by the package itself.
Expand All @@ -59,7 +59,7 @@ numpydoc = ">=1.5.0"
sphinx_rtd_theme = ">=0.5.1"
sphinx-autoapi = ">=2.0.1"
docutils = "==0.16"
mabwiser = ">=2.7.0"
mabwiser = ">=2.7.1"

# This optional examples group is needed to run the example notebooks, but not
# required for the package itself.
Expand All @@ -71,7 +71,7 @@ vrplib = "^1.0.1"
networkx = ">=2.4.0"
tsplib95 = ">=0.7.0"
jupyter = "^1.0.0"
mabwiser = ">=2.7.0"
mabwiser = ">=2.7.1"

[tool.black]
line-length = 79
Expand Down