Skip to content

Commit

Permalink
Further fixes for Scipy 1.15 update for PR and nightly CI (#6213)
Browse files Browse the repository at this point in the history
Nightly CI revealed a bug between hypothesis `floating_dtypes(sizes=(32, 64)` and building sparse matrices, this PR uses `st.sampled_from((np.float32, np.float64)` to solve the issue. 

Additionally, cudf.pandas active made one dataset in ARIMA pytests fail, so disabling that one while we look further into it.

Authors:
  - Dante Gama Dessavre (https://github.com/dantegd)

Approvers:
  - Victor Lafargue (https://github.com/viclafargue)
  - Simon Adorf (https://github.com/csadorf)

URL: #6213
  • Loading branch information
dantegd authored Jan 13, 2025
1 parent bfd2e22 commit 7c715c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
11 changes: 10 additions & 1 deletion python/cuml/cuml/tests/test_arima.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
from cuml.internals.safe_imports import gpu_only_import
import statsmodels.api as sm
from sklearn.model_selection import train_test_split
from cuml.internals.safe_imports import cpu_only_import_from
from cuml.internals.safe_imports import (
cpu_only_import_from,
gpu_only_import_from,
)
import warnings
import os
import pytest
Expand All @@ -49,6 +52,7 @@
approx_fprime = cpu_only_import_from("scipy.optimize", "approx_fprime")

cudf = gpu_only_import("cudf")
cudf_pandas_active = gpu_only_import_from("cudf.pandas", "LOADED")


###############################################################################
Expand Down Expand Up @@ -410,6 +414,11 @@ def fill_interpolation(df_in):
@pytest.mark.parametrize("dtype", [np.float64])
def test_integration(key, data, dtype):
"""Full integration test: estimate, fit, forecast"""
if (
data.dataset == "endog_hourly_earnings_by_industry_missing_exog"
and cudf_pandas_active
):
pytest.skip(reason="https://github.com/rapidsai/cuml/issues/6209")
order, seasonal_order, intercept = extract_order(key)
s = max(1, seasonal_order[3])

Expand Down
10 changes: 5 additions & 5 deletions python/cuml/cuml/tests/test_linear_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Copyright (c) 2019-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -629,7 +629,7 @@ def test_logistic_regression_model_default(dtype):


@given(
dtype=floating_dtypes(sizes=(32, 64)),
dtype=st.sampled_from((np.float32, np.float64)),
order=st.sampled_from(("C", "F")),
sparse_input=st.booleans(),
fit_intercept=st.booleans(),
Expand Down Expand Up @@ -661,7 +661,7 @@ def test_logistic_regression_model_digits(
assert score >= acceptable_score


@given(dtype=floating_dtypes(sizes=(32, 64)))
@given(dtype=st.sampled_from((np.float32, np.float64)))
def test_logistic_regression_sparse_only(dtype, nlp_20news):

# sklearn score with max_iter = 10000
Expand All @@ -685,7 +685,7 @@ def test_logistic_regression_sparse_only(dtype, nlp_20news):
@given(
dataset=split_datasets(
standard_classification_datasets(
dtypes=floating_dtypes(sizes=(32, 64)),
dtypes=st.sampled_from((np.float32, np.float64)),
n_classes=st.sampled_from((2, 10)),
n_features=st.just(20),
n_informative=st.just(10),
Expand Down Expand Up @@ -727,7 +727,7 @@ def test_logistic_regression_decision_function(
@given(
dataset=split_datasets(
standard_classification_datasets(
dtypes=floating_dtypes(sizes=(32, 64)),
dtypes=st.sampled_from((np.float32, np.float64)),
n_classes=st.sampled_from((2, 10)),
n_features=st.just(20),
n_informative=st.just(10),
Expand Down

0 comments on commit 7c715c4

Please sign in to comment.