-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix using .A
instead of .toarray()
#61
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really getting the motivation/justification for your changes here. Could you please explain the reasoning behind them to me? Thank you!
tests/test_gpcca.py
Outdated
@@ -524,6 +525,7 @@ def test_gpcca_brandts_sparse_is_not_densified(self, P: np.ndarray, sd: np.ndarr | |||
with pytest.raises(ValueError, match=r"Sparse implementation is only available for `method='krylov'`."): | |||
GPCCA(csr_matrix(P), eta=sd, method="brandts").optimize(3) | |||
|
|||
@pytest.mark.skipif(Version(np.__version__) >= Version("2"), reason="Eigenvalue mismatch.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you skip this test if numpy version is >=2? Why is it ok for newer numpy versions to fail this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been trying to figure out why new numpy
version causes this test to fail, but was unable to figure it out. I will try later do a bisect on the commits, see exactly why, but was thinking in the meantime we could just skip it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted this, will leave this for a future PR to investigate.
@@ -70,7 +70,7 @@ def bdc(q: np.ndarray, p: np.ndarray, sparse: bool = True) -> Tuple[np.ndarray, | |||
mu[0] = 1.0 | |||
mu[1:] = np.cumprod(p[:-1] / q[1:]) | |||
|
|||
return (P if sparse else P.A), mu / np.sum(mu) | |||
return (P if sparse else P.toarray()), mu / np.sum(mu) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the problem here, exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because scipy
deprecated .A
and .toarray()
should be used in favor.
Regarding the changes in the docs, sphinx was throwing some warning, so I corrected the template and |
No description provided.