-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Possible regression using quadgk function and Unitful limits #63
Comments
I just found a related bug report on the |
The funny thing is that it is failing on: [2] one(#unused#::Type{Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}} )
@ Base .\number.jl:334 which is this fallback method of |
I just tried it with the latest versions (QuadGK 2.6.0 and Unitful v1.12.2) in Julia 1.8.2, and it works fine for me: julia> using Unitful, QuadGK
julia> f(t) = 1.0u"J"
f (generic function with 1 method)
julia> quadgk(f, 0.0u"s", 10.0u"s")
(10.0 J s, 0.0 J s) So something is weird on your system? |
Hmm, interesting. I can sometimes reproduce your error. If I enter the code above line-by-line, it works. But if I paste it in all at once, then I get the error. This seems like a bug in Julia, TBH. |
Aha, I just noticed that the difference between your code and mine: I was doing It seems like this is a bug in Julia, since it dispatch shouldn't depend on the order of the imports: JuliaLang/julia#48295 |
Fascinating. I can reproduce the import-order issue that you detected in both a prior install of |
Should be fixed now. |
Awesome. Thanks! |
Maybe could add a test? |
I think I might have discovered a recent regression in
QuadGK
when using thequadgk
function with ranges specified inUnitful
types. I tried to dig into the source by following the stack trace, and it seems like it might be related to the recent changes tohandle_infinities
, but I'm not familiar enough with this package or Julia's underlying type mechanics to nail down the issue at the moment.Steps to Reproduce
I was able to reproduce the issue using the following minimal code snippet. This snippet should integrate a constant 1 Joule value over the domain [0,10] seconds, which should result in a value of 10 Joule-seconds.
Test Configuration 1 (v2.6.0, Error)
System information for this configuration:
Running the code snippet above produces an error
Test Configuration 2 (v.2.5.0, Working)
For the next configuration, I simply pinned
QuadGK
to version2.5.0
in Julia'sPkg
REPL and re-ran the test. System information for this configuration:In this configuration, the test runs as expected.
The text was updated successfully, but these errors were encountered: