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

Relax type annotations in sparse prep #647

Merged
merged 3 commits into from
Nov 30, 2024
Merged

Conversation

ErikQQY
Copy link
Contributor

@ErikQQY ErikQQY commented Nov 30, 2024

Part of #646

Relax type annotations of the compressed matrix from AbstractMatrix{<:Real} to AbstractMatrix{<:Number} in PushforwardSparseJacobianPrep, PullbackSparseJacobianPrep, SparseHessianPrep and MixedModeSparseJacobianPrep to support sparse Jacobian/Hessian preparation for complex numbers.

The test case for this PR is adapted from MWE, so need some advice on this.

@ErikQQY ErikQQY requested a review from gdalle as a code owner November 30, 2024 07:04
Copy link

codecov bot commented Nov 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.52%. Comparing base (fd3dc14) to head (c5e8561).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #647   +/-   ##
=======================================
  Coverage   97.52%   97.52%           
=======================================
  Files         111      111           
  Lines        5536     5536           
=======================================
  Hits         5399     5399           
  Misses        137      137           
Flag Coverage Δ
DI 98.65% <ø> (ø)
DIT 95.35% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@gdalle
Copy link
Member

gdalle commented Nov 30, 2024

Thanks! I can take over for the tests

@gdalle
Copy link
Member

gdalle commented Nov 30, 2024

I assume you were using complex numbers with FiniteDiff? I tried with ForwardDiff but it won't even build the Duals

@gdalle gdalle merged commit f8f7d07 into JuliaDiff:main Nov 30, 2024
46 of 47 checks passed
@ErikQQY
Copy link
Contributor Author

ErikQQY commented Nov 30, 2024

Yeah, it should be FiniteDiff, very sorry I may not have specified this clearly. When handling complex numbers, in my specific use case, according to the input x type(ComplexF64, etc.) in prepare_jacobian, FiniteDiff backend should be used. But the general prepare_jacobian API failed to handle this no matter which backend is being used.

@ErikQQY ErikQQY deleted the qqy/complex branch November 30, 2024 08:31
@ErikQQY
Copy link
Contributor Author

ErikQQY commented Nov 30, 2024

Can we cut a release for this patch?

@gdalle
Copy link
Member

gdalle commented Nov 30, 2024

Here you go: JuliaRegistries/General#120422

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.

2 participants