Use symbols instead of strings for variables in toric geometry#4928
Use symbols instead of strings for variables in toric geometry#4928HereAround merged 9 commits intomasterfrom
Conversation
fingolfin
left a comment
There was a problem hiding this comment.
Thank you!
Left some optional comments, feel free to ignore.
But regarding the CI errors, here is one:
LoadError: MethodError: no method matching polynomial_ring(::QQField, ::Vector{Any}; cached::Bool)
Closest candidates are:
polynomial_ring(::Ring, ::Vector{Symbol}; kw...)
@ AbstractAlgebra ~/oscar-runners/runner-28/julia/packages/AbstractAlgebra/5aJmh/src/MPoly.jl:1506
polynomial_ring(::Ring, ::Union{AbstractArray{<:Union{Char, AbstractString, Symbol}}, Pair{<:Union{Char, AbstractString, Symbol}}}, Union{AbstractArray{<:Union{Char, AbstractString, Symbol}}, Pair{<:Union{Char, AbstractString, Symbol}}}...; kv...)
@ AbstractAlgebra ~/oscar-runners/runner-28/julia/packages/AbstractAlgebra/5aJmh/src/misc/VarNames.jl:300
polynomial_ring(::Ring, ::Tuple{Vararg{Union{AbstractArray{<:Union{Char, AbstractString, Symbol}}, Pair{<:Union{Char, AbstractString, Symbol}}}}}; kv...)
@ AbstractAlgebra ~/oscar-runners/runner-28/julia/packages/AbstractAlgebra/5aJmh/src/misc/VarNames.jl:302
...
Stacktrace:
[1] _construct_generic_sample
@ ~/oscar-runners/runner-28/_work/Oscar.jl/Oscar.jl/experimental/FTheoryTools/src/auxiliary.jl:393
The code triggering this:
function _construct_generic_sample(base_grading::Matrix{Int64}, base_vars::Vector{String}, d::Int, fiber_ambient_space::NormalToricVariety, fiber_twist_divisor_classes::ZZMatrix)
base_space = family_of_spaces(polynomial_ring(QQ, base_vars, cached = false)[1], base_grading, d)
ambient_space_vars = vcat(base_vars, coordinate_names(fiber_ambient_space))
coordinate_ring_ambient_space = polynomial_ring(QQ, ambient_space_vars, cached = false)[1]
...
I suspect that base_vars and coordinate_names(fiber_ambient_space) now have different types (one a Vector{String} one a Vector{Symbol}).
Two solutions come to mind (and perhaps both should be implemented):
1 also drop the vcat in that method and instead write
coordinate_ring_ambient_space = polynomial_ring(QQ, base_vars, coordinate_names(fiber_ambient_space); cached = false)[1]
- ensure that the
Vector{String}there is also changed into aVector{Symbol}
cc7bca0 to
1a5e5c1
Compare
67cc04e to
5517b76
Compare
bb7ce0b to
3c45de5
Compare
lgoettgens
left a comment
There was a problem hiding this comment.
The changes look mostly fine to me, thanks for working on this @HereAround! In a few places, I think the changes to docstrings make it harder for users to use specific kwargs (see comments).
I can not judge if this really resolves #4159 as I am not familiar enough with the surrounding code that was not touched here.
Co-authored-by: Max Horn <max@quendi.de>
Co-authored-by: Lars Göttgens <lars.goettgens@rwth-aachen.de>
Co-authored-by: Lars Göttgens <lars.goettgens@rwth-aachen.de>
…ibutes.jl Co-authored-by: Lars Göttgens <lars.goettgens@rwth-aachen.de>
c748c7d to
4cf54da
Compare
4cf54da to
bf0f516
Compare
|
@lgoettgens seems happy. I checked with @lkastner on slack, who also seems happy. I shall thus assume that this PR is good to go and will now merge it. |
Fixes #4159