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

use oneunit(T) in construct_seeds #652

Closed
wants to merge 6 commits into from

Conversation

longemen3000
Copy link

should fix #651 ?

@longemen3000
Copy link
Author

the invalidations tests has an unrelated error

@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (16417ec) 89.65% compared to head (59c9cd1) 89.65%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #652   +/-   ##
=======================================
  Coverage   89.65%   89.65%           
=======================================
  Files          11       11           
  Lines         967      967           
=======================================
  Hits          867      867           
  Misses        100      100           
Files Changed Coverage Δ
src/partials.jl 84.21% <100.00%> (ø)

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

@mcabbott
Copy link
Member

This seems fine. Is it easy to add a test, e.g. loading the smallest / slowest-changing package which defines a number for which one != oneunit?

@longemen3000
Copy link
Author

longemen3000 commented Jun 12, 2023

Measurements.jl? and an unary function.
Binary functions require defining some interactions between ForwardDiff.Dual and Measurements.Measurement (AMBIGUOUS_TYPES), (i had to define my own in https://github.com/longemen3000/ForwardDiffOverMeasurements.jl ). In the julia 1.9 world, that integration is a prime candidate for extensions.

Another possible candidate for this is Unitful.jl. if we see #328 , the error posted there is caused by the different types of the tuple (one(T),zero(T)

julia> g(x)
ERROR: MethodError: no method matching ForwardDiff.Partials(::Tuple{Float64,Quantity{Float64,Unitful.Dimensions{()},Unitful.FreeUnits{(),Unitful.Dimensions{()}}}})
Closest candidates are:
  ForwardDiff.Partials(::Tuple{Vararg{V,N}}) where {N, V} at /home/cst-jean/.julia/packages/ForwardDiff/hnKaN/src/partials.jl:2
Stacktrace:

and Unitful.jl defines one and oneunit in the following lines:
https://github.com/PainterQubits/Unitful.jl/blob/3798720d77e09a8c0c994db1e142848545a27ba3/src/quantities.jl#L425-L428

@longemen3000
Copy link
Author

longemen3000 commented Aug 7, 2023

I added Measurements.jl as an example package that has oneunit(T) != one(T).

The invalidation tests fails with the stat_rep(::Nothing) method error, and there are errors on nightly, that i don't know if are unrelated.

Edit: it seems that the errors in nightly and in the invalidations tests are unrelated

@longemen3000
Copy link
Author

replaced by #659

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.

construct_seeds for types where typeof(one(T)) !=T is broken
2 participants