Skip to content

Commit

Permalink
last warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pogudingleb committed Jan 21, 2024
1 parent 9bd79ec commit 2c1e748
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 53 deletions.
2 changes: 1 addition & 1 deletion src/RationalFunctionFields/normalforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ is not specified but is assumed to be close to 1.
push!(relations_ff_1, monoms_ff_1[i])
push!(tref, exponent_vector(monoms_ff_1[i], 1))
end
complete_intersection_relations_ff = Vector{Nemo.gfp_mpoly}(undef, 0)
complete_intersection_relations_ff = Vector{Nemo.fpMPolyRingElem}(undef, 0)
iters = 0
# Compute relations at several random points until a consensus is reached
while true
Expand Down
2 changes: 1 addition & 1 deletion src/local_identifiability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function _assess_local_identifiability(
# in the SE case, it will exit right away
while true
ic = Dict(x => F(rand(1:prime)) for x in ode_red.x_vars)
inputs = Dict{Nemo.gfp_mpoly, Array{Nemo.fpFieldElem, 1}}(
inputs = Dict{Nemo.fpMPolyRingElem, Array{Nemo.fpFieldElem, 1}}(
u => [F(rand(1:prime)) for i in 1:prec] for u in ode_red.u_vars
)

Expand Down
2 changes: 1 addition & 1 deletion src/parametrizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ $sat_string
Original vars: $orig_strings"""
end
parametric_ring, _ =
polynomial_ring(FractionField(ring_of_tags), orig_strings, ordering = :degrevlex)
polynomial_ring(fraction_field(ring_of_tags), orig_strings, ordering = :degrevlex)
relations_between_tags =
map(poly -> parent_ring_change(poly, ring_of_tags), relations_between_tags)
param_var_mapping = merge(
Expand Down
28 changes: 1 addition & 27 deletions test/differentiate_output.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,32 +80,6 @@ if GROUP == "All" || GROUP == "Core"

#------------------------------------------------------------------------------

function rand_poly(deg, vars)
if deg == 0
return parent(vars[1])(1)
end
result = 0
indices = collect(1:length(vars))
monomials = []
for d in 0:deg
for subs in StructuralIdentifiability.IterTools.subsets(indices, d)
push!(monomials, subs)
end
end

for subs in monomials
monom = rand(-50:50)
for v_ind in subs
monom *= vars[v_ind]
end
result += monom
end

return result
end

#------------------------------------------------------------------------------

@testset "Partial derivatives of an output w.r.t. to initial conditions and parameters" begin
test_cases = []
P = QQMPolyRingElem
Expand Down Expand Up @@ -165,7 +139,7 @@ if GROUP == "All" || GROUP == "Core"
)

F = Nemo.Native.GF(2^31 - 1)
P = gfp_mpoly
P = fpMPolyRingElem
DType = Union{P, Generic.Frac{P}}

varnames = vcat(
Expand Down
23 changes: 1 addition & 22 deletions test/ode_ps_solution.jl
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
if GROUP == "All" || GROUP == "Core"
function rand_poly(deg, vars)
result = 0
indices = vcat(collect(1:length(vars)), collect(1:length(vars)))
monomials = []
for d in 0:deg
for subs in StructuralIdentifiability.IterTools.subsets(indices, d)
push!(monomials, subs)
end
end

for subs in monomials
monom = rand(-50:50)
for v_ind in subs
monom *= vars[v_ind]
end
result += monom
end

return result
end

@testset "Power series solution for an ODE system" begin
R, (x, x_dot) = Nemo.polynomial_ring(Nemo.QQ, ["x", "x_dot"])
exp_t = ps_ode_solution(
Expand Down Expand Up @@ -89,7 +68,7 @@ if GROUP == "All" || GROUP == "Core"
["u_$i" for i in 1:NUMU],
)
R, vars = Nemo.polynomial_ring(F, varnames)
PType = gfp_mpoly
PType = fpMPolyRingElem
TDict = Dict{PType, Union{PType, Generic.Frac{PType}}}

# Generating the intial conditions etc
Expand Down
2 changes: 1 addition & 1 deletion test/parent_ring_change.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if GROUP == "All" || GROUP == "Core"
StructuralIdentifiability.parent_ring_change(f, R__, matching = :byindex)

R, (x,) = polynomial_ring(field, ["x"])
R2, (x2,) = polynomial_ring(Nemo.FractionField(R), ["x"])
R2, (x2,) = polynomial_ring(Nemo.fraction_field(R), ["x"])
R3, (x3,) = polynomial_ring(field, ["x"])
f = x3^2
f_ = StructuralIdentifiability.parent_ring_change(f, R2)
Expand Down
21 changes: 21 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,27 @@ function random_ps_matrix(ps_ring, matrix_space)
return result
end

function rand_poly(deg, vars)
result = 0
indices = vcat(collect(1:length(vars)), collect(1:length(vars)))
monomials = []
for d in 0:deg
for subs in StructuralIdentifiability.IterTools.subsets(indices, d)
push!(monomials, subs)
end
end

for subs in monomials
monom = rand(-50:50)
for v_ind in subs
monom *= vars[v_ind]
end
result += monom
end

return result
end

@info "Testing started"

@test isempty(Test.detect_ambiguities(StructuralIdentifiability))
Expand Down

0 comments on commit 2c1e748

Please sign in to comment.