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

fix: make @register_array_symbolic overload promote_symtype #1129

Conversation

AayushSabharwal
Copy link
Contributor

Close #1128

@codecov-commenter
Copy link

codecov-commenter commented May 6, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 10.12%. Comparing base (79c4e92) to head (b78d724).
Report is 159 commits behind head on master.

Files Patch % Lines
src/register.jl 90.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1129       +/-   ##
===========================================
- Coverage   77.07%   10.12%   -66.95%     
===========================================
  Files          32       35        +3     
  Lines        3533     3623       +90     
===========================================
- Hits         2723      367     -2356     
- Misses        810     3256     +2446     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChrisRackauckas
Copy link
Member

Looks like plenty of test failures?

@AayushSabharwal
Copy link
Contributor Author

Yeah, didn't expect there to be. I'll look into it

@AayushSabharwal AayushSabharwal force-pushed the as/register-array-promote-symtype branch from 0421ae5 to b78d724 Compare May 6, 2024 10:21
@ChrisRackauckas ChrisRackauckas merged commit f49e083 into JuliaSymbolics:master May 6, 2024
7 of 11 checks passed
@AayushSabharwal AayushSabharwal deleted the as/register-array-promote-symtype branch May 6, 2024 11:38
@gdalle
Copy link
Contributor

gdalle commented May 6, 2024

I have updated SparseDiffTools to use the latest ADTypes.jl, it's available in 2.19

https://github.com/JuliaDiff/SparseDiffTools.jl/releases/tag/v2.19.0

@gdalle
Copy link
Contributor

gdalle commented May 6, 2024

If not for PolyesterForwardDiff.jl we could even recover 1.6 compat

JuliaDiff/SparseDiffTools.jl#296

@test ndims(gg) == 2
@test size(gg) == (8,8)
@test eltype(gg) == Real
@test symtype(unwrap(gg)) == SymMatrix{Real, 2}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this SymMatrix{Real, 2} and the other SymMatrix{Real}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't infer ndims if it's not specified in the macrocall, since promote_symtype only gets the types of arguments to the function

end
let
# redefine with promote_symtype
@register_array_symbolic ggg(x::AbstractVector) begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use a different function so that we can re-include the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Array function registration doesn't overload promote types correctly
5 participants