-
Notifications
You must be signed in to change notification settings - Fork 11
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
Rework rheology database #144
Rework rheology database #144
Conversation
…creep' into bk_type_instability_dislocation_creep
…b.com/JuliaGeodynamics/GeoParams.jl into bk_type_instability_dislocation_creep
This is great, thanks a lot! Allocations: Test Failed at /home/runner/work/GeoParams.jl/GeoParams.jl/test/test_Allocations.jl:43
Expression: main1(Tv, ε̇ii, η) == 0
Evaluated: 11782810 == 0 |
Looks like it still allocates in 1.6 and 1.7, I don't know if we should still support those versions though... |
Problem is that in those versions the power of a unit is always unstable... julia> @code_warntype MPa ^2
MethodInstance for ^(::Unitful.FreeUnits{(MPa,), 𝐌 𝐋⁻¹·⁰ 𝐓⁻²·⁰, nothing}, ::Int64)
from ^(x::Unitful.FreeUnits{N, D, nothing}, y::Integer) where {N, D} in Unitful at /Users/albert/.julia/packages/Unitful/R4J37/src/units.jl:115
Static Parameters
N = (MPa,)
D = 𝐌 𝐋⁻¹·⁰ 𝐓⁻²·⁰
Arguments
#self#::Core.Const(^)
x::Core.Const(MPa)
y::Int64
Locals
#40::Unitful.var"#40#41"{Int64}
Body::Any
1 ─ %1 = Unitful.:(var"#40#41")::Core.Const(Unitful.var"#40#41")
│ %2 = Core.typeof(y)::Core.Const(Int64)
│ %3 = Core.apply_type(%1, %2)::Core.Const(Unitful.var"#40#41"{Int64})
│ (#40 = %new(%3, y))
│ %5 = #40::Unitful.var"#40#41"{Int64}
│ %6 = Unitful.map(%5, $(Expr(:static_parameter, 1)))::Core.PartialStruct(Tuple{Unitful.Unit{:Pascal, 𝐌 𝐋⁻¹·⁰ 𝐓⁻²·⁰}}, Any[Core.PartialStruct(Unitful.Unit{:Pascal, 𝐌 𝐋⁻¹·⁰ 𝐓⁻²·⁰}, Any[Core.Const(6), Rational{Int64}])])
│ %7 = ::Core.Const()
│ %8 = Core.apply_type(Unitful.FreeUnits, %6, %7)::Type{Unitful.FreeUnits{_A, }} where _A
│ %9 = (%8)()::Unitful.FreeUnits{_A, , nothing} where _A
│ %10 = (*)(%9)::Any
└── return %10 |
I’m fine with only supporting newer versions of julia, provided this is made clear in the [compat] part. Note that CI for newer versions also fails because of an unrelated issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I addressed the remaining broken tests and allocations are now conditionally tested on >1.7, so we can keep testing for 1.6 and 1.7.
I had to drop 1.6. 1.7 is fine -which was missing in the CI-, and updated Julia compats. Now everything should be working fine. |
Closes #129 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
Fixes and addresses #129. The rheology database has been rework; to make it fully type stable every rheology is contained into his own function. The rheology are organised in the following not exported submodules:
GeoParams.Dislocation
,GeoParams.Diffusion
,GeoParams.GBS
,GeoParams.NonLinearPeierls
, andGeoParams.Peierls
. The list of available rheologies can be accessed either by tab completion from the REPL or with:The following example does not allocate anymore