Skip to content

Commit 33316d1

Browse files
author
Noel Roemmele
committed
Changed listEnumerated to list_enumerated and made comments into seperate tests.
1 parent 349bc2d commit 33316d1

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/sage/plot/plot.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3108,19 +3108,21 @@ def list_plot(data, plotjoined=False, **kwargs):
31083108
sage: d['ymin']
31093109
100.0
31103110
3111-
Verify that :trac:`38037` is fixed::
3111+
Verify that :issue:`38037` is fixed::
31123112
31133113
sage: list_plot([(0,-1),(1,-2),(2,-3),(3,-4),(4,None)])
31143114
Traceback (most recent call last):
31153115
...
31163116
TypeError: unable to coerce to a ComplexNumber:
31173117
<class 'sage.rings.integer.Integer'>
31183118
3119-
#Non enumerated list example
3119+
Test the codepath where ``list_enumerated`` is ``False``::
3120+
31203121
sage: list_plot([3+I, 4, I, 1+5*i, None, 1+i])
31213122
Graphics object consisting of 1 graphics primitive
31223123
3123-
#Enumerated list example
3124+
Test the codepath where ``list_enumerated`` is ``True``::
3125+
31243126
sage: list_plot([4, 3+I, I, 1+5*i, None, 1+i])
31253127
Graphics object consisting of 1 graphics primitive
31263128
"""
@@ -3140,12 +3142,12 @@ def list_plot(data, plotjoined=False, **kwargs):
31403142
else:
31413143
list_data = list(data.items())
31423144
return list_plot(list_data, plotjoined=plotjoined, **kwargs)
3143-
listEnumerated = False
3145+
list_enumerated = False
31443146
try:
31453147
from sage.rings.real_double import RDF
31463148
RDF(data[0])
31473149
data = list(enumerate(data))
3148-
listEnumerated = True
3150+
list_enumerated = True
31493151
except TypeError: # we can get this TypeError if the element is a list
31503152
# or tuple or numpy array, or an element of CC, CDF
31513153
# We also want to avoid doing CC(data[0]) here since it will go
@@ -3156,7 +3158,7 @@ def list_plot(data, plotjoined=False, **kwargs):
31563158
# element of the Symbolic Ring.
31573159
if isinstance(data[0], Expression):
31583160
data = list(enumerate(data))
3159-
listEnumerated = True
3161+
list_enumerated = True
31603162

31613163
try:
31623164
if plotjoined:
@@ -3170,7 +3172,7 @@ def list_plot(data, plotjoined=False, **kwargs):
31703172
# gets to (1, I).
31713173
from sage.rings.cc import CC
31723174
# It is not guaranteed that we enumerated the data so we have two cases
3173-
if listEnumerated:
3175+
if list_enumerated:
31743176
data = [(z.real(), z.imag()) for z in [CC(z[1]) for z in data]]
31753177
else:
31763178
data = [(z.real(), z.imag()) for z in [CC(z) for z in data]]

0 commit comments

Comments
 (0)