Skip to content

Commit

Permalink
Merge branch 'rapidsai:branch-23.12' into branch-23.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Zekrom-7780 authored Nov 10, 2023
2 parents 76dc2e0 + 6d51185 commit 1d2a719
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ dependencies:
- treelite==3.9.1
- umap-learn==0.5.3
- pip:
- git+https://github.com/dask/dask-glm@main
- dask-glm==0.3.0
name: all_cuda-118_arch-x86_64
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ dependencies:
- treelite==3.9.1
- umap-learn==0.5.3
- pip:
- git+https://github.com/dask/dask-glm@main
- dask-glm==0.3.0
name: all_cuda-120_arch-x86_64
6 changes: 2 additions & 4 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,13 @@ dependencies:
packages:
- pip
- pip:
# TODO: Figure out what to do with this dependency
# since the repo is now archived.
- git+https://github.com/dask/dask-glm@main
- dask-glm==0.3.0
# TODO: remove pin once a release that includes fixes for the error
# is released: https://github.com/rapidsai/cuml/issues/5514
- hdbscan<=0.8.30
- output_types: pyproject
packages:
- dask-glm @ git+https://github.com/dask/dask-glm@main
- dask-glm==0.3.0
# TODO: Can we stop pulling from the master branch now that there was a release in October?
- hdbscan @ git+https://github.com/scikit-learn-contrib/hdbscan.git@master
test_notebooks:
Expand Down
8 changes: 8 additions & 0 deletions python/cuml/internals/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ from cuml.internals.safe_imports import (
np = cpu_only_import('numpy')
nvtx_annotate = gpu_only_import_from("nvtx", "annotate", alt=null_decorator)

from sklearn.utils import estimator_html_repr

import cuml
import cuml.common
import cuml.internals.logger as logger
Expand Down Expand Up @@ -443,6 +445,12 @@ class Base(TagsMixin,
return {'preserves_dtype': [self.dtype]}
return {}

def _repr_mimebundle_(self, **kwargs):
"""Prepare representations used by jupyter kernels to display estimator"""
output = {"text/plain": repr(self)}
output["text/html"] = estimator_html_repr(self)
return output

def set_nvtx_annotations(self):
for func_name in ['fit', 'transform', 'predict', 'fit_transform',
'fit_predict']:
Expand Down
13 changes: 3 additions & 10 deletions python/cuml/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ def test_array_init_from_bytes(data_type, dtype, shape, order, mem_type):
mem_type=cuml_array_mem_types(),
)
@settings(deadline=None)
def test_array_init_bad(input_type, dtype, shape, order, mem_type):
def test_array_mem_type(input_type, dtype, shape, order, mem_type):
"""
This test ensures that we assert on incorrect combinations of arguments
when creating CumlArray
Test whether we can create CumlArray from all supported types and array
shapes on all supported mem types.
"""
mem_type = MemoryType.from_str(mem_type)

Expand All @@ -214,13 +214,6 @@ def test_array_init_bad(input_type, dtype, shape, order, mem_type):
# Ensure the array is creatable
array = CumlArray(input_array)

with pytest.raises(ValueError):
bad_dtype = np.float16 if dtype != np.float16 else np.float32
CumlArray(input_array, dtype=bad_dtype)

with pytest.raises(ValueError):
CumlArray(input_array, shape=(*array.shape, 1))

input_mem_type = determine_array_memtype(input_array)
if input_mem_type.is_device_accessible:
joint_mem_type = input_mem_type
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/tests/test_input_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def get_input(
result = cudf.DataFrame(rand_mat, index=index)

if type == "cudf-series":
result = cudf.Series(rand_mat, index=index)
result = cudf.Series(rand_mat.reshape(nrows), index=index)

if type == "pandas":
result = pdDF(cp.asnumpy(rand_mat), index=index)
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ classifiers = [

[project.optional-dependencies]
test = [
"dask-glm @ git+https://github.com/dask/dask-glm@main",
"dask-glm==0.3.0",
"dask-ml",
"hdbscan @ git+https://github.com/scikit-learn-contrib/hdbscan.git@master",
"hypothesis>=6.0,<7",
Expand Down

0 comments on commit 1d2a719

Please sign in to comment.