-
Notifications
You must be signed in to change notification settings - Fork 24
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
Precompilation warnings? #296
Comments
We use from Parameters.jl only the @unpack, that’s why only that is imported. We could replace them with the (;fieldname,…) = somestruct notation and in fact we already do in dynamics/implicit.jl because @unpack is incompatible with @Floop. I like @unpack because it’s more explicit than (; … ) = … but would be happy to remove the Parameters.jl dependency in the long run
|
Hm... This might be "type piracy"?
Yes, I didn’t want to go down the route of implementing the speed estimate properly in ProgressMeter.jl and instead went for the easy way to just locally redefine their function so that it takes an additional argument so that the default time/iteration can be translated to simulated time/time. I’ve not have problems with this before though!
|
Haha... I figured it out and deleted my question. But your answer came anyway! :) |
Do we need to explicitly import it perhaps? import ProgressMeter: speedstring before adding the new method? I don't think it's type piracy because you are defining a method for a type that SpeedyWeather defines, so that's OK! |
I think the problem is that we define
which, because we provide a default for |
I remember having had precompilation warnings for that a long time ago, but not recently. So I don't know why this is coming up now for you. |
Just ran into this problem again after adding SpeedyWeather.jl the first time with v1.9 It looks like the problem arises from constructors like Base.@kwdef AB{NF<:Real}
a::NF = 1.0
b::NF = 2.0
end
AB(;kwargs...) = AB{Float64}(;kwargs...) While the 2nd method overwrites |
What is |
Essentially so that one can do It means that something like |
Btw, the answer to my question was already in your previous post but the coffee hadn't gone to my brain.... |
It would be possible to do Base.@kwdef struct ABC{NF<:Real}
a::NF = convert(NF,1)
b::NF = convert(NF,2)
end
ABC(;kwargs...) = ABC{Float64}(;kwargs...) because it doesn't define |
Yeah, |
Can you point me to an example? Cause what I often need is
|
It sounds like what you're looking for is: struct ABC{NF<:Real}
a::NF
b::NF
function ABC{NF}(; a = NF(1), b = NF(2)) where {NF}
return new{NF}(a, b)
end
ABC(; kwargs...) = ABC{promote_type(typeof.(values(kwargs))...)}(;kwargs)
ABC() = ABC{Float64}()
end ? |
With the restructuring of #327 these warnings should disappear, moving this therefore to v0.6 |
In main we're now down to one single precompilation warning ┌ SpeedyWeather [9e226e20-d153-4fed-8a5b-493def4f21a9]
│ WARNING: Method definition speedstring(Any) in module ProgressMeter at /Users/milan/.julia/packages/ProgressMeter/sN2xr/src/ProgressMeter.jl:683 overwritten in module SpeedyWeather at /Users/milan/.julia/packages/SpeedyWeather/oRCBd/src/output/feedback.jl:201.
│ ** incremental compilation may be fatally broken for this module **
└ |
Why all these warnings? Also where are they coming from? The warning mentions, e.g.,
in module SpeedyWeather at util.jl:504
but where is thisutil.jl
file?The text was updated successfully, but these errors were encountered: