Skip to content

Commit

Permalink
Fix dependencies (numpy + ConfigSpace) and docs (#1122)
Browse files Browse the repository at this point in the history
* fix(dependency): np.NaN -> np.nan

New(er) numpy does not support np.NaN anymore

* Update CHANGELOG.md

* fix(build): restrict package versions

Numpy and ConfigSpace's API have changed. Do not incorporate changes yet.

* Update CHANGELOG.md

* Fix broken link in docs
  • Loading branch information
benjamc authored Jul 16, 2024
1 parent 8ece46d commit 2674173
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.1.1

## Dependencies
- Update numpy NaN (#1122) and restrict numpy and ConfigSpace versions


# 2.1.0

## Improvements
Expand Down
2 changes: 1 addition & 1 deletion docs/3_getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ranges and default values.
"species": ["mouse", "cat", "dog"], # Categorical
})
Please see the documentation of `ConfigSpace <https://automl.github.io/ConfigSpace/main/>`_ for more details.
Please see the documentation of `ConfigSpace <https://automl.github.io/ConfigSpace/latest/>`_ for more details.


Target Function
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def read_file(filepath: str) -> str:
include_package_data=True,
python_requires=">=3.8",
install_requires=[
"numpy>=1.23.3",
"numpy>=1.23.3,<2.0.0",
"scipy>=1.9.2",
"psutil",
"pynisher>=1.0.0",
"ConfigSpace>=0.6.1",
"ConfigSpace>=0.6.1,<1.0.0",
"joblib",
"scikit-learn>=1.1.2",
"pyrfr>=0.9.0",
Expand Down
2 changes: 1 addition & 1 deletion smac/model/random_forest/random_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def _predict(
third_dimension = max(max_num_leaf_data, third_dimension)

# Transform list of 2d arrays into a 3d array
preds_as_array = np.zeros((X.shape[0], self._rf_opts.num_trees, third_dimension)) * np.NaN
preds_as_array = np.zeros((X.shape[0], self._rf_opts.num_trees, third_dimension)) * np.nan
for i, preds_per_tree in enumerate(all_preds):
for j, pred in enumerate(preds_per_tree):
preds_as_array[i, j, : len(pred)] = pred
Expand Down
6 changes: 3 additions & 3 deletions smac/runhistory/encoder/abstract_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def __init__(
)

# Learned statistics
self._min_y = np.array([np.NaN] * self._n_objectives)
self._max_y = np.array([np.NaN] * self._n_objectives)
self._percentile = np.array([np.NaN] * self._n_objectives)
self._min_y = np.array([np.nan] * self._n_objectives)
self._max_y = np.array([np.nan] * self._n_objectives)
self._percentile = np.array([np.nan] * self._n_objectives)
self._multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None = None
self._runhistory: RunHistory | None = None

Expand Down

0 comments on commit 2674173

Please sign in to comment.