Skip to content

Commit

Permalink
Merge pull request #48 from automl/bug_fixes
Browse files Browse the repository at this point in the history
Fix issues #41 and #45
  • Loading branch information
Bronzila committed Aug 2, 2023
2 parents 0d7b242 + ebca5ce commit 5facc2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dehb/optimizers/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def __getstate__(self):
def __del__(self):
""" Ensures a clean kill of the Dask client and frees up a port.
"""
if hasattr(self, "client") and isinstance(self, Client):
if hasattr(self, "client") and isinstance(self.client, Client):
self.client.close()

def reset(self):
Expand Down
2 changes: 1 addition & 1 deletion src/dehb/optimizers/dehb.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, cs=None, f=None, dimensions=None, mutation_factor=None,
self.configspace = True if isinstance(self.cs, ConfigSpace.ConfigurationSpace) else False
if self.configspace:
self.dimensions = len(self.cs.get_hyperparameters())
elif dimensions is None or not isinstance(dimensions, (int, np.int)):
elif dimensions is None or not isinstance(dimensions, (int, np.integer)):
assert "Need to specify `dimensions` as an int when `cs` is not available/specified!"
else:
self.dimensions = dimensions
Expand Down

0 comments on commit 5facc2f

Please sign in to comment.