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

glum/tabmat is incompatible with scipy 1.14 #811

Closed
github-actions bot opened this issue Jun 25, 2024 · 1 comment
Closed

glum/tabmat is incompatible with scipy 1.14 #811

github-actions bot opened this issue Jun 25, 2024 · 1 comment
Assignees

Comments

@github-actions
Copy link

github-actions bot commented Jun 25, 2024

The daily unit tests failed. See https://github.com/Quantco/glum/actions/runs/9656709326 for details.

=================================== FAILURES ===================================
____ test_glm_identity_regression_categorical_data[<lambda>3-None-irls-ls] _____
[gw1] linux -- Python 3.10.14 /home/runner/micromamba/envs/glum/bin/python3.10
tests/glm/test_glm.py:756: in test_glm_identity_regression_categorical_data
    np.testing.assert_almost_equal(X.toarray() if hasattr(X, "toarray") else X, x_mat)
../../../micromamba/envs/glum/lib/python3.10/site-packages/tabmat/categorical_matrix.py:589: in toarray
    return self.tocsr().A
E   AttributeError: 'csr_matrix' object has no attribute 'A'
_____ test_glm_identity_regression_categorical_data[<lambda>3-None-lbfgs] ______
[gw1] linux -- Python 3.10.14 /home/runner/micromamba/envs/glum/bin/python3.10
tests/glm/test_glm.py:756: in test_glm_identity_regression_categorical_data
    np.testing.assert_almost_equal(X.toarray() if hasattr(X, "toarray") else X, x_mat)
../../../micromamba/envs/glum/lib/python3.10/site-packages/tabmat/categorical_matrix.py:589: in toarray
    return self.tocsr().A
E   AttributeError: 'csr_matrix' object has no attribute 'A'
____ test_glm_identity_regression_categorical_data[<lambda>3-None-irls-cd] _____
[gw1] linux -- Python 3.10.14 /home/runner/micromamba/envs/glum/bin/python3.10
tests/glm/test_glm.py:756: in test_glm_identity_regression_categorical_data
    np.testing.assert_almost_equal(X.toarray() if hasattr(X, "toarray") else X, x_mat)
../../../micromamba/envs/glum/lib/python3.10/site-packages/tabmat/categorical_matrix.py:589: in toarray
    return self.tocsr().A
E   AttributeError: 'csr_matrix' object has no attribute 'A'
__ test_glm_identity_regression_categorical_data[<lambda>3-None-trust-constr] __
[gw1] linux -- Python 3.10.14 /home/runner/micromamba/envs/glum/bin/python3.10
tests/glm/test_glm.py:756: in test_glm_identity_regression_categorical_data
    np.testing.assert_almost_equal(X.toarray() if hasattr(X, "toarray") else X, x_mat)
../../../micromamba/envs/glum/lib/python3.10/site-packages/tabmat/categorical_matrix.py:589: in toarray
    return self.tocsr().A
E   AttributeError: 'csr_matrix' object has no attribute 'A'
___ test_glm_identity_regression_categorical_data[<lambda>3-offset1-irls-ls] ___
[gw1] linux -- Python 3.10.14 /home/runner/micromamba/envs/glum/bin/python3.10
tests/glm/test_glm.py:756: in test_glm_identity_regression_categorical_data
tests/glm/test_glm.py:3037: in test_formula
    ).fit(data)
src/glum/_glm.py:3246: in fit
    coef = self._solve(
src/glum/_glm.py:1108: in _solve
    coef, self.n_iter_, self._n_cycles, self.diagnostics_ = _irls_solver(
src/glum/_solvers.py:311: in _irls_solver
    hessian, state.n_active_rows = update_hessian(state, data, state.active_set)
src/glum/_solvers.py:36: in inner_fct
    out = fct(*args, **kwargs)
src/glum/_solvers.py:144: in update_hessian
    hessian_init = build_hessian_delta(
src/glum/_solvers.py:208: in build_hessian_delta
    delta = _safe_sandwich_dot(
src/glum/_util.py:[19](https://github.com/Quantco/glum/actions/runs/9656709326/job/26634700574#step:6:20)3: in _safe_sandwich_dot
    result = X.sandwich(d, rows, cols)
../../../micromamba/envs/glum/lib/python3.10/site-packages/tabmat/standardized_mat.py:141: in sandwich
    term1 = self.mat.sandwich(d, rows, cols)
../../../micromamba/envs/glum/lib/python3.10/site-packages/tabmat/split_matrix.py:348: in sandwich
    res = mat_i._cross_sandwich(
../../../micromamba/envs/glum/lib/python3.10/site-packages/tabmat/categorical_matrix.py:537: in _cross_sandwich
    return self._cross_sparse(other.array_csc, d, rows, L_cols, R_cols)
../../../micromamba/envs/glum/lib/python3.10/site-packages/tabmat/categorical_matrix.py:706: in _cross_sparse
    res = term_1.T.dot(_row_col_indexing(other, rows, R_cols)).A
E   AttributeError: 'csc_matrix' object has no attribute 'A'
@jtilly
Copy link
Member

jtilly commented Jun 25, 2024

Yesterday's daily tests passed with
https://github.com/Quantco/glum/actions/runs/9639815003/job/26582604415#step:3:354

Todays' daily tests are failing with https://github.com/Quantco/glum/actions/runs/9656709326/job/26634700574#step:3:354.

From scipy's release notes:

Expired deprecations
There is an ongoing effort to follow through on long-standing deprecations.
The following previously deprecated features are affected:
Several previously deprecated methods for sparse arrays were removed:
asfptype, getrow, getcol, get_shape, getmaxprint,
set_shape, getnnz, and getformat. Additionally, the .A and
.H attributes were removed.

https://github.com/scipy/scipy/releases/tag/v1.14.0

@jtilly jtilly changed the title Daily run failure: Unit tests glum/tabmat is incompatible with scipy 1.14 Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants