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

Finish up TODOs in QV types #58

Merged
merged 4 commits into from
Dec 23, 2024
Merged

Finish up TODOs in QV types #58

merged 4 commits into from
Dec 23, 2024

Conversation

stelmo
Copy link
Member

@stelmo stelmo commented Dec 23, 2024

No description provided.

@stelmo stelmo requested a review from exaexa December 23, 2024 12:15
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5773631) to head (4920f59).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #58   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          428       428           
=========================================
  Hits           428       428           

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

@stelmo
Copy link
Member Author

stelmo commented Dec 23, 2024

/format

Copy link

✔️ Auto-formatting triggered by this comment succeeded, commited as 6acc986

github-actions bot pushed a commit that referenced this pull request Dec 23, 2024
triggered by @stelmo on PR #58
@stelmo
Copy link
Member Author

stelmo commented Dec 23, 2024

Hmm getting a weird bug:

julia> t = LinearValueT(Expression(2)) + QuadraticValueT(Expression(2))
ERROR: MethodError: no method matching QuadraticValueT{FastDifferentiation.Node}(::LinearValueT{FastDifferentiation.Node})
The type `QuadraticValueT{FastDifferentiation.Node}` exists, but no method is defined for this combination of argument types when trying to construct it.

Closest candidates are:
  (::Type{QuadraticValueT{T}} where T)(::Any, ::Any)
   @ ConstraintTrees C:\Users\stelmo\.julia\packages\ConstraintTrees\AhePm\src\quadratic_value.jl:34
  QuadraticValueT{T}(; idxs, weights) where T
   @ ConstraintTrees C:\Users\stelmo\.julia\packages\ConstraintTrees\AhePm\src\quadratic_value.jl:33

Stacktrace:
 [1] +(a::LinearValueT{FastDifferentiation.Node}, b::QuadraticValueT{FastDifferentiation.Node})
   @ ConstraintTrees C:\Users\stelmo\.julia\packages\ConstraintTrees\AhePm\src\quadratic_value.jl:100        
 [2] top-level scope
   @ REPL[30]:1

@exaexa
Copy link
Member

exaexa commented Dec 23, 2024

I removed some (many) explicit UnionAlls.

It seems to work now at least for:

julia> C.LinearValueT(1) - C.QuadraticValueT(2)
ConstraintTrees.QuadraticValueT{Int64}([(0, 0)], [-1])

If something still fails we should have a test for it (so that there's something to make sure it stays fixed).

@exaexa
Copy link
Member

exaexa commented Dec 23, 2024

PS we could do type promotion at the place for + but let's avoid that for now unless we find an actual reason.

Copy link
Member

@exaexa exaexa left a comment

Choose a reason for hiding this comment

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

LGTM but I expect this won't be sufficient.

@stelmo
Copy link
Member Author

stelmo commented Dec 23, 2024

Merging, and I will report back as I find stuff in Diffmet

@stelmo stelmo merged commit 3960208 into master Dec 23, 2024
5 checks passed
@exaexa exaexa deleted the sew-quad-bug branch December 23, 2024 21:03
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