stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.02k stars 264 forks source link

Fix extract_sparse_parts for Matrix 1.5-0 #1083

Closed adrian-lison closed 10 months ago

adrian-lison commented 11 months ago

Summary:

When running extract_sparse_parts with a binary matrix (only zeros and once), a deprecation warning is issued. as(<lgCMatrix>, "dgCMatrix")is deprecated since Matrix 1.5-0; it is now recommended to use as(., "dMatrix") instead

Intended Effect:

No deprecation warning thrown anymore.

How to Verify:

Side Effects:

None

Documentation:

No update needed

Reviewer Suggestions:

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Adrian Lison

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

jgabry commented 11 months ago

Thank you!

adrian-lison commented 11 months ago

It seems like the checks are failing because I don't have the master branch in my fork? What do I have to do?

jgabry commented 11 months ago

@adrian-lison I don't actually think it's an issue with your fork, I think it's an issue with our GitHub actions workflow. We have:

https://github.com/stan-dev/rstan/blob/71ab1409531c2c5e412635482fee545c77e2a070/.github/workflows/main.yml#L37

but apparently we shouldn't be using master there according to https://github.com/r-lib/actions/issues/639#issuecomment-1284611135

@andrjohns Have you seen this error before? Should I just update the workflow file to use @v2 instead of @master as recommended in https://github.com/r-lib/actions/issues/639#issuecomment-1284611135?

bgoodri commented 10 months ago

I already have a similar fix on the branch we have been using for 2.21 releases ( https://github.com/stan-dev/rstan/commit/09c923edd21545728bb43f012f84b65baa42d34b ) that the Matrix package maintainers recommended to me when 1.5 was on the way to being released. I'll have to cherry-pick some of the commits on that branch, but I'll wait to make sure extract_sparse_parts works before I close this PR. Thanks though @adrian-lison .

bgoodri commented 10 months ago

We got this fixed in https://github.com/stan-dev/rstan/pull/1086 . Thanks again.