Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion src/Rings/mpoly-graded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
multi_hilbert_series_parent::Generic.LaurentMPolyWrapRing{ZZRingElem, ZZMPolyRing}

function MPolyDecRing(R::S, d::Vector{FinGenAbGroupElem}) where {S}
@req !(R isa MPolyDecRing) "cannot graded polynomial ring which is already decorated"
Comment thread
fingolfin marked this conversation as resolved.
Outdated
@assert length(d) == ngens(R)
r = new{elem_type(base_ring(R)), S}()
r.R = R
Expand All @@ -16,6 +17,7 @@
return r
end
function MPolyDecRing(R::S, d::Vector{FinGenAbGroupElem}, lt) where {S}
@req !(R isa MPolyDecRing) "cannot filter polynomial ring which is already decorated"
@assert length(d) == ngens(R)
r = new{elem_type(base_ring(R)), S}()
r.R = R
Expand Down Expand Up @@ -135,7 +137,7 @@ of `R`, and return the new ring, together with the vector of variables.
As above, where the grading is the standard $\mathbb Z$-grading on `R`.

# Examples
```jldoctest
```jldoctest grade-ex
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])

Expand All @@ -156,7 +158,12 @@ Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1]
```

Grading an already graded polynomial ring is not supported.
Comment thread
fingolfin marked this conversation as resolved.
```jldoctest grade-ex
julia> grade(S)
ERROR: ArgumentError: cannot graded polynomial ring which is already decorated
Comment thread
fingolfin marked this conversation as resolved.
Outdated
```
"""
function grade(R::MPolyRing, W::AbstractVector{<:IntegerUnion})
Expand Down
6 changes: 0 additions & 6 deletions test/Serialization/PolynomialsSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ cases = [
@test loaded == m1 * m2
@test grading_group(parent(loaded)) == grading_group(M)
end

GM, _ = grade(M, A)
test_save_load_roundtrip(path, GM) do loaded
@test loaded == GM
@test forget_grading(loaded) == forget_grading(GM)
end
Comment thread
fingolfin marked this conversation as resolved.
end

for case in cases
Expand Down
2 changes: 1 addition & 1 deletion test/Serialization/upgrades/setup_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if !isdefined(Main, :serialization_upgrade_test_path) ||
!isdir(Main.serialization_upgrade_test_path) ||
!isfile(joinpath(Main.serialization_upgrade_test_path, "LICENSE.md"))

serialization_upgrade_test_path = let commit_hash = "a28d9e4dcc89de46377061e2f42ee09739735b97"
serialization_upgrade_test_path = let commit_hash = "ec819b9ddc0fc2bd0b842cfb1ea2341bd34beff4"
Comment thread
lgoettgens marked this conversation as resolved.
Outdated
tarball = Downloads.download("https://github.com/oscar-system/serialization-upgrade-tests/archive/$(commit_hash).tar.gz")

destpath = open(CodecZlib.GzipDecompressorStream, tarball) do io
Expand Down
Loading