Skip to content

Commit 0e0025a

Browse files
committed
More small edits
1 parent 4ab6541 commit 0e0025a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/sage/databases/sloane.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Local copy of the On-Line Encyclopedia of Integer Sequences
33
4-
The `SloaneEncyclopedia` object provides access to a local copy of the database
4+
The ``SloaneEncyclopedia`` object provides access to a local copy of the database
55
containing only the sequences and their names. To use this, you must download
66
and install the database using ``SloaneEncyclopedia.install()``, or
77
``SloaneEncyclopedia.install_from_gz()`` if you have already downloaded the
@@ -11,14 +11,14 @@
1111
1212
::
1313
14-
sage: SloaneEncyclopedia[60843] # optional - sloane_database
14+
sage: SloaneEncyclopedia[60843] # optional - sloane_database
1515
[1, 6, 21, 107]
1616
1717
To get the name of a sequence, type
1818
1919
::
2020
21-
sage: SloaneEncyclopedia.sequence_name(1) # optional - sloane_database
21+
sage: SloaneEncyclopedia.sequence_name(1) # optional - sloane_database
2222
'Number of groups of order n.'
2323
2424
To search locally for a particular subsequence, type
@@ -33,7 +33,7 @@
3333
3434
::
3535
36-
sage: SloaneEncyclopedia.find([1,2,3,4,5], 100) # optional - sloane_database
36+
sage: SloaneEncyclopedia.find([1,2,3,4,5], 100) # optional - sloane_database
3737
[(15, [1, 2, 3, 4, 5, 7, 7, 8, 9, 11, 11, ...
3838
3939
Results in either case are of the form [ (number, list) ].
@@ -263,7 +263,8 @@ def load(self):
263263
try:
264264
file_seq = bz2.BZ2File(self.__file__, 'r')
265265
except IOError:
266-
raise IOError("The Sloane Encyclopedia database must be installed. Use e.g. 'SloaneEncyclopedia.install()' to download and install it.")
266+
raise IOError("The Sloane Encyclopedia database must be installed."
267+
" Use e.g. 'SloaneEncyclopedia.install()' to download and install it.")
267268

268269
self.__data__ = {}
269270

@@ -293,7 +294,8 @@ def load(self):
293294
self.__loaded_names__ = True
294295
except KeyError:
295296
# Some sequence in the names file is not in the database
296-
raise KeyError("Sloane OEIS sequence and name files do not match. Try reinstalling, e.g. SloaneEncyclopedia.install(overwrite=True).")
297+
raise KeyError("Sloane OEIS sequence and name files do not match."
298+
" Try reinstalling, e.g. SloaneEncyclopedia.install(overwrite=True).")
297299
except IOError:
298300
# The names database is not installed
299301
self.__loaded_names__ = False
@@ -321,7 +323,8 @@ def sequence_name(self, N):
321323
"""
322324
self.load()
323325
if not self.__loaded_names__:
324-
raise IOError("The Sloane OEIS names file is not installed. Try reinstalling, e.g. SloaneEncyclopedia.install(overwrite=True).")
326+
raise IOError("The Sloane OEIS names file is not installed."
327+
" Try reinstalling, e.g. SloaneEncyclopedia.install(overwrite=True).")
325328

326329
if N not in self.__data__: # sequence N does not exist
327330
return ''

0 commit comments

Comments
 (0)