printing of ZNElement#82
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Your PR no longer requires formatting changes. Thank you for your contribution! |
lkdvos
left a comment
There was a problem hiding this comment.
This is a bit of a personal comment but might be relevant: I find that in general the unicode symbols are quite hard to type, and actually are not that helpful in this case: \bbZ<TAB>\_2<TAB>Element is a finger workout if you compare this to Z2Element, so I'm not hugely convinced of the usefulness of this.
One thing I do see is that type_repr(::Type{ZNElement{N, p}}) where {N, p} = "GroupElement[$(type_repr(Z{N})), p]" is probably a better definition?
Just trying to follow what the goal is here, did you intend for "prettier" printing, as in more close to math output, or just shorter or more convenient?
|
I found for julia> I(0)
GroupElement[ℤ{2}, 0](0)
julia> V = Vect[I](0 => 1, 1 => 1)
Vect[GroupElement[ℤ{2}, 0]](…) of dim 2:
0 => 1
1 => 1
julia> W = V^2 ← V^2
(Vect[GroupElement[ℤ{2}, 0]](0 => 1, 1 => 1) ⊗ Vect[GroupElement[ℤ{2}, 0]](0 => 1, 1 => 1)) ← (Vect[GroupElement[ℤ{2}, 0]](0 => 1, 1 => 1) ⊗ Vect[GroupElement[ℤ{2}, 0]](0 => 1, 1 => 1))This PR would make this julia> I(0)
ℤ₂Element{0}(0)
julia> V = Vect[I](0 => 1, 1 => 1)
Vect[ℤ₂Element{0}](…) of dim 2:
0 => 1
1 => 1
julia> W = V^2 ← V^2
(Vect[ℤ₂Element{0}](0 => 1, 1 => 1) ⊗ Vect[ℤ₂Element{0}](0 => 1, 1 => 1)) ← (Vect[ℤ₂Element{0}](0 => 1, 1 => 1) ⊗ Vect[ℤ₂Element{0}](0 => 1, 1 => 1))The unicode is also just defined as aliases, as you can see here I still just type |
This is an attempt to making
ZNElementprinting prettier.