-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
Add documentation to LaurentSeries point to accessors #39366
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit 9986d23; changes) is ready! 🎉 |
I don't know. The original docstring looks simple and to the point. How about adding a short introduction to the head of the doc where you can explain about |
Thanks. I noticed that, in the doc, Since your added explanation is fundamental, I suggest putting it to the very beginning of the doc, before the first example. You may also add an example to support it. If you think the more work is out of the scope of your PR, just let me know. This is still an improvement. I may work upon it later. |
I think it's not that fundamental, but more like if someone need to implement some function that manipulates Laurent series and need to deconstruct it, it is the most efficient to use the accessors instead of, say, Thus the original explanation being only in the "IMPLEMENTATION:" section. Of course if the implementation decides to be changed for some reason, But maybe like this? It's also possible to rename the valuation_zero_part to diff --git a/src/sage/rings/laurent_series_ring_element.pyx b/src/sage/rings/laurent_series_ring_element.pyx
index 758b7012240..211dab70de8 100644
--- a/src/sage/rings/laurent_series_ring_element.pyx
+++ b/src/sage/rings/laurent_series_ring_element.pyx
@@ -1,6 +1,16 @@
r"""
Laurent Series
+Laurent series in Sage are represented internally
+as a power of the variable times the unit part (which need not be a
+unit - it's a polynomial with nonzero constant term). The zero
+Laurent series has unit part 0.
+
+For a Laurent series `f` internally represented as `f = t^n \cdot g` where
+`t` is the variable and `g` has nonzero constant term, `g` can be accessed
+through :meth:`valuation_zero_part` and `n` can be accessed through
+:meth:`valuation`.
+
EXAMPLES::
sage: R.<t> = LaurentSeriesRing(GF(7), 't'); R
@@ -35,15 +45,6 @@ Saving and loading.
sage: loads(K.dumps()) == K # needs sage.rings.real_mpfr
True
-IMPLEMENTATION: Laurent series in Sage are represented internally
-as a power of the variable times the unit part (which need not be a
-unit - it's a polynomial with nonzero constant term). The zero
-Laurent series has unit part 0.
-
-For a Laurent series internally represented as `t^n \cdot f` where
-`t` is the variable, `f` can be accessed through :meth:`valuation_zero_part`
-and `n` can be accessed through :meth:`valuation`.
-
AUTHORS:
- William Stein: original version
@@ -93,8 +94,8 @@ cdef class LaurentSeries(AlgebraElement):
r"""
A Laurent Series.
- We consider a Laurent series of the form `t^n \cdot f` where `f` is a
- power series.
+ We consider a Laurent series of the form `f = t^n \cdot g` where `g` is a
+ power series with nonzero constant term.
INPUT:
|
Just one paragraph (without details uninteresting to users):
? or with |
I feel it's originally too undiscoverable. Since
f
andn
are explicitly mentioned in the documentation I think it's a good idea to mention how to access it programmatically.📝 Checklist
⌛ Dependencies