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

Aqua + typos CI #77

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Aqua + typos CI #77

wants to merge 1 commit into from

Conversation

ArnoStrouwen
Copy link
Member

Minor amount of type piracy needs to be fixed.

Copy link

codecov bot commented Dec 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7b3920c) 57.06% compared to head (296678b) 57.64%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #77      +/-   ##
==========================================
+ Coverage   57.06%   57.64%   +0.58%     
==========================================
  Files          13       13              
  Lines        1055     1053       -2     
==========================================
+ Hits          602      607       +5     
+ Misses        453      446       -7     

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

@ArnoStrouwen
Copy link
Member Author

@AlCap23 does it make sense to upstream this function?

# This is needed to fix a bug/omission in DataDrivenSparse
function DataDrivenSparse.active_set!(idx::BitMatrix, p::SoftThreshold,
x::Matrix{ComplexF64}, λ::Float64)
DataDrivenSparse.active_set!(idx, p, abs.(x), λ)
end

add begin end around Aqua tests

a
@ArnoStrouwen
Copy link
Member Author

ArnoStrouwen commented Dec 30, 2023

@ChrisRackauckas If tests pass, I think this is good to go, the last remaining piracy can be made into an issue and fixed later.
EDIT: nevermind, this package has weird tests, it does not seem to fail if some integrals can no longer be solved.

@ArnoStrouwen ArnoStrouwen marked this pull request as draft December 30, 2023 15:51
@ArnoStrouwen
Copy link
Member Author

@shahriariravanian is it safe to delete these functions?
https://github.com/SciML/SymbolicNumericIntegration.jl/pull/77/files#diff-5286ab18446ceac577bfe10dbc94bafeb42424a99a1a1556e26aa7dd8ec26267
Since it is type piracy, it is very hard to track down what the intended use of these lines is.

@shahriariravanian
Copy link
Collaborator

@ArnoStrouwen
We still need Base.signbit(z::Complex{T}) where {T <: Number} = signbit(real(z)). This is to prevent error messages when it tries to calculate abs(z) for when z is a complex number.

The problem arises because some of the derivatives in Symbolics have an abs in them. For example, expand_derivatives(Differential(x)(asec(x))) returns 1 / (abs(x)*sqrt(-1 + x^2)), which is the standard solution for real arguments but is meaningless for complex arguments. I think a better option would be to fix Symbolics to return 1 / (x^2 * sqrt(1 - 1/x^2)), which is what Mathematica does and works for complex values. If Symbolics is fixed, we can get rid of this signbit line.

@ChrisRackauckas
Copy link
Member

That edit should happen in DiffRules.jl

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.

None yet

3 participants