Skip to content
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

Minor improvements for FTheoryTools #4219

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,8 @@
["e99_4", "e99_8"],
["e99_4", "e99_9"],
["e99_8", "e99_9"],
["e99_9", "e99_11"],
["e99_9", "e99_11"]

["y", "z"],
["x", "ea_1"],
["z", "ea_2"]
],
[
"e9_1", "e9_2", "e9_3", "e9_4",
Expand Down Expand Up @@ -328,8 +325,7 @@
"e63_1", "e63_2", "e63_3", "e63_4", "e63_5", "e63_6", "e63_7", "e63_8", "e63_9", "e63_10", "e63_11", "e63_12", "e63_13", "e63_14",
"e75_1", "e75_2", "e75_3", "e75_4", "e75_5", "e75_6", "e75_7", "e75_8", "e75_9", "e75_10", "e75_11", "e75_12", "e75_13", "e75_14",
"e87_1", "e87_2", "e87_3", "e87_4", "e87_5", "e87_6", "e87_7", "e87_8", "e87_9", "e87_10", "e87_11", "e87_12", "e87_13", "e87_14",
"e99_1", "e99_2", "e99_3", "e99_4", "e99_5", "e99_6", "e99_7", "e99_8", "e99_9", "e99_10", "e99_11", "e99_12", "e99_13", "e99_14",
"ea_1", "ea_2", "ea_3"
"e99_1", "e99_2", "e99_3", "e99_4", "e99_5", "e99_6", "e99_7", "e99_8", "e99_9", "e99_10", "e99_11", "e99_12", "e99_13", "e99_14"
]
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
attrs_dict[key] = value
end
end
if has_resolutions(h)
res = resolutions(h)
resolution_loci = [k[1] for k in res]
exceptional_divisors = [k[2] for k in res]
attrs_dict[:resolution_loci] = resolution_loci
attrs_dict[:exceptional_divisors] = exceptional_divisors

Check warning on line 64 in experimental/FTheoryTools/src/Serialization/hypersurface_models.jl

View check run for this annotation

Codecov / codecov/patch

experimental/FTheoryTools/src/Serialization/hypersurface_models.jl#L60-L64

Added lines #L60 - L64 were not covered by tests
end
!isempty(attrs_dict) && save_typed_object(s, attrs_dict, :__attrs)
end
end
Expand All @@ -75,7 +82,15 @@
model.defining_classes = defining_classes
attrs_data = haskey(s, :__attrs) ? load_typed_object(s, :__attrs) : Dict{Symbol, Any}()
for (key, value) in attrs_data
set_attribute!(model, Symbol(key), value)
if (key != :resolution_loci) && (key != :exceptional_divisors)
set_attribute!(model, Symbol(key), value)
end
end
if haskey(attrs_data, :resolution_loci)
resolution_loci = attrs_data[:resolution_loci]
exceptional_divisors = attrs_data[:exceptional_divisors]
@req length(exceptional_divisors) == length(exceptional_divisors) "Inconsistency upon loading resolutions"
set_attribute!(model, :resolutions, [[resolution_loci[i], exceptional_divisors[i]] for i in 1:length(resolution_loci)])

Check warning on line 93 in experimental/FTheoryTools/src/Serialization/hypersurface_models.jl

View check run for this annotation

Codecov / codecov/patch

experimental/FTheoryTools/src/Serialization/hypersurface_models.jl#L90-L93

Added lines #L90 - L93 were not covered by tests
end
@req cox_ring(ambient_space(model)) == parent(hypersurface_equation(model)) "Hypersurface polynomial not in Cox ring of toric ambient space"
return model
Expand Down
17 changes: 16 additions & 1 deletion experimental/FTheoryTools/src/Serialization/tate_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ function save_object(s::SerializerState, gtm::GlobalTateModel)
attrs_dict[key] = value
end
end
if has_resolutions(gtm)
res = resolutions(gtm)
resolution_loci = [k[1] for k in res]
exceptional_divisors = [k[2] for k in res]
attrs_dict[:resolution_loci] = resolution_loci
attrs_dict[:exceptional_divisors] = exceptional_divisors
end
!isempty(attrs_dict) && save_typed_object(s, attrs_dict, :__attrs)
end
end
Expand All @@ -76,7 +83,15 @@ function load_object(s::DeserializerState, ::Type{<: GlobalTateModel}, params::T
model.defining_classes = defining_classes
attrs_data = haskey(s, :__attrs) ? load_typed_object(s, :__attrs) : Dict{Symbol, Any}()
for (key, value) in attrs_data
set_attribute!(model, Symbol(key), value)
if (key != :resolution_loci) && (key != :exceptional_divisors)
set_attribute!(model, Symbol(key), value)
end
end
if haskey(attrs_data, :resolution_loci)
resolution_loci = attrs_data[:resolution_loci]
exceptional_divisors = attrs_data[:exceptional_divisors]
@req length(exceptional_divisors) == length(exceptional_divisors) "Inconsistency upon loading resolutions"
set_attribute!(model, :resolutions, [[resolution_loci[i], exceptional_divisors[i]] for i in 1:length(resolution_loci)])
end
@req cox_ring(ambient_space(model)) == parent(tate_polynomial(model)) "Tate polynomial not in Cox ring of toric ambient space"
return model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@
attrs_dict[key] = value
end
end
if has_resolutions(w)
res = resolutions(w)
resolution_loci = [k[1] for k in res]
exceptional_divisors = [k[2] for k in res]
attrs_dict[:resolution_loci] = resolution_loci
attrs_dict[:exceptional_divisors] = exceptional_divisors

Check warning on line 65 in experimental/FTheoryTools/src/Serialization/weierstrass_models.jl

View check run for this annotation

Codecov / codecov/patch

experimental/FTheoryTools/src/Serialization/weierstrass_models.jl#L61-L65

Added lines #L61 - L65 were not covered by tests
end
!isempty(attrs_dict) && save_typed_object(s, attrs_dict, :__attrs)
end
end
Expand All @@ -76,7 +83,15 @@
model.defining_classes = defining_classes
attrs_data = haskey(s, :__attrs) ? load_typed_object(s, :__attrs) : Dict{Symbol, Any}()
for (key, value) in attrs_data
set_attribute!(model, Symbol(key), value)
if (key != :resolution_loci) && (key != :exceptional_divisors)
set_attribute!(model, Symbol(key), value)
end
end
if haskey(attrs_data, :resolution_loci)
resolution_loci = attrs_data[:resolution_loci]
exceptional_divisors = attrs_data[:exceptional_divisors]
@req length(exceptional_divisors) == length(exceptional_divisors) "Inconsistency upon loading resolutions"
set_attribute!(model, :resolutions, [[resolution_loci[i], exceptional_divisors[i]] for i in 1:length(resolution_loci)])

Check warning on line 94 in experimental/FTheoryTools/src/Serialization/weierstrass_models.jl

View check run for this annotation

Codecov / codecov/patch

experimental/FTheoryTools/src/Serialization/weierstrass_models.jl#L91-L94

Added lines #L91 - L94 were not covered by tests
end
@req cox_ring(ambient_space(model)) == parent(weierstrass_polynomial(model)) "Weierstrass polynomial not in Cox ring of toric ambient space"
return model
Expand Down
Loading