[Sage] #10358: The sloane_find command is now completely broken

3 views
Skip to first unread message

Sage

unread,
Nov 30, 2010, 10:02:31 PM11/30/10
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
-----------------------------+----------------------------------------------
Reporter: was | Owner: sage-combinat
Type: PLEASE CHANGE | Status: new
Priority: critical | Milestone: sage-4.6.1
Component: combinatorics | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
The sloane_find command, which parses output of a webpage, is now
completely broken due to the Sloane sequence webpage being rewritten. It
silently always finds nothing.

{{{
sage: sloane_find([1,1,2,3,5,8,13,21], nresults=1)
[]
}}}

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, and MATLAB

Sage

unread,
Nov 30, 2010, 10:02:41 PM11/30/10
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
-----------------------------+----------------------------------------------
Reporter: was | Owner: sage-combinat
Type: defect | Status: new
Priority: critical | Milestone: sage-4.6.1
Component: combinatorics | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Changes (by was):

* type: PLEASE CHANGE => defect


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:1>

Sage

unread,
Nov 30, 2010, 10:04:45 PM11/30/10
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------+------------------------------------------------
Reporter: was | Owner: sage-combinat
Type: defect | Status: closed
Priority: critical | Milestone: sage-4.6.1
Component: combinatorics | Resolution: duplicate
Keywords: | Author:
Upstream: N/A | Reviewer:
Merged: | Work_issues:
---------------------------+------------------------------------------------
Changes (by was):

* status: new => closed
* resolution: => duplicate


Comment:

Crap, this is a dup of #10056

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:2>

Sage

unread,
Jan 25, 2011, 8:43:55 AM1/25/11
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------+------------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: closed
Priority: critical | Milestone: sage-4.6.1
Component: combinatorics | Resolution: duplicate
Keywords: | Author:
Upstream: N/A | Reviewer:
Merged: | Work_issues:
---------------------------+------------------------------------------------
Changes (by tmonteil):

* cc: sage-combinat, was (added)
* owner: sage-combinat => tmonteil


Comment:

Hi,

the aim of #10056 was to migrate every url in sage that was dealing with
Sloane's database at once (not only `sloane_find()`), hence this is not
really a duplicate. The issue here is that oeis changed their html
templates, so the sage parsers are not working anymore. I just coded a new
parser, which you can see working on the combinat repository
(`sloane_new_website_parsers-tm.patch`).

I added the more atomic functions in `sage/databases/sloane.py` (the
documentation still needs to be fixed):

- `sloane_discover()` which discovers which sequences correspond to some
list of integers.
- `sloane_first_terms()` which returns the first terms of the sequence.
- `sloane_description()` which returns the one line description of the
sequence.

I don't really know what to do with the broken functions:
- `parse_sequence()` is completely dead and now useless. Should it now
raise a deprecation warning ?
- `sloane_sequence()` and `sloane_find()` are broken, but maybe some
users still need them, should i make them working again as a combination
of the first 3 functions ?

Also, maybe all those functions should be renamed by replacing sloane by
oeis ? This may be too early since i guess most people know more about
Sloane than about oeis. In such a case, what is the procedure/convention
to ensure backward compatibility ?

At the end, we could have a daily crontab to check when the oeis changes
its html template, and adapt the parsers accordingly. Better, we could ask
them to provide an online standard query system, but if i understand a
discussion in the nmbrthry mailing-list, this may not be their whish.

Ciao,
Thierry

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:3>

Sage

unread,
Jan 25, 2011, 8:44:16 AM1/25/11
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------+------------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_work
Priority: critical | Milestone: sage-4.6.1
Component: combinatorics | Resolution: duplicate
Keywords: | Author:
Upstream: N/A | Reviewer:
Merged: | Work_issues:
---------------------------+------------------------------------------------
Changes (by tmonteil):

* status: closed => needs_work


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:4>

Sage

unread,
Jan 25, 2011, 8:45:22 AM1/25/11
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------+------------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_work
Priority: critical | Milestone: sage-4.6.2
Component: combinatorics | Resolution: duplicate
Keywords: | Author:
Upstream: N/A | Reviewer:
Merged: | Work_issues:
---------------------------+------------------------------------------------
Changes (by tmonteil):

* milestone: sage-4.6.1 => sage-4.6.2


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:5>

Sage

unread,
Jan 26, 2011, 5:24:20 AM1/26/11
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------+------------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_work
Priority: critical | Milestone: sage-4.6.2
Component: combinatorics | Resolution: duplicate
Keywords: | Author:
Upstream: N/A | Reviewer:
Merged: | Work_issues:
---------------------------+------------------------------------------------

Comment(by nthiery):

Salut Thierry,

Rather than having a bunch of functions to return the various pieces of a
Sloane result, there could be a single object from which one could query
the pieces via methods. Something like:

{{{
sage: s = sloane_find([1,1,2,5,8,14])[0]
sage: s.description()
...
sage: s[6]
42
}}}


Actually, Anders Claesson [1] had implemented a prototype of this feature
during FPSAC'09, and his demo was quite cool. I guess he would agree to
give his code away for someone else to finalize it and merge it into Sage.

But maybe that should be the topic of a separate ticket.

[1] http://combinatorics.is/anders/

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:6>

Sage

unread,
Oct 22, 2011, 9:23:35 PM10/22/11
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
------------------------------+---------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: closed
Priority: critical | Milestone: sage-4.7.2
Component: combinatorics | Resolution: fixed
Keywords: | Work_issues:
Upstream: N/A | Reviewer:
Author: | Merged:
Dependencies: |
------------------------------+---------------------------------------------
Changes (by leif):

* status: needs_work => closed
* resolution: duplicate => fixed


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:7>

Sage

unread,
Oct 22, 2011, 9:24:03 PM10/22/11
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
------------------------------+---------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-4.7.2
Component: combinatorics | Resolution:
Keywords: | Work_issues:
Upstream: N/A | Reviewer:
Author: | Merged:
Dependencies: |
------------------------------+---------------------------------------------
Changes (by leif):

* status: closed => new
* resolution: fixed =>


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:8>

Sage

unread,
Oct 22, 2011, 10:00:34 PM10/22/11
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
------------------------------+---------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-4.7.2
Component: combinatorics | Resolution:
Keywords: | Work_issues:
Upstream: N/A | Reviewer:
Author: | Merged:
Dependencies: |
------------------------------+---------------------------------------------
Changes (by kini):

* cc: kini (added)


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:9>

Sage

unread,
Oct 23, 2011, 11:49:14 AM10/23/11
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
------------------------------+---------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-4.7.2
Component: combinatorics | Resolution:
Keywords: | Work_issues:
Upstream: N/A | Reviewer:
Author: | Merged:
Dependencies: |
------------------------------+---------------------------------------------

Comment(by tmonteil):

By the way, if you need to play with OEIS now, here is the current version
of the patch in preparation, on sage-combinat:
[http://combinat.sagemath.org/patches/file/0506836c7c66
/sloane_new_website_parsers-tm.patch]

The methods still parse the new website correctly, but i didn't put
everything in a single class yet as Nicolas suggested.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:10>

Sage

unread,
Oct 24, 2011, 3:07:42 AM10/24/11
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
------------------------------+---------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-4.7.2
Component: combinatorics | Resolution:
Keywords: | Work_issues:
Upstream: N/A | Reviewer:
Author: | Merged:
Dependencies: |
------------------------------+---------------------------------------------

Comment(by kini):

Oh, no particular hurry. I just happened to notice OEIS was broken, and
was surprised to find that this ticket was closed, so I asked leif to
reopen it. Glad to hear there is a patch in the works. If possible could
you post it here once in a while? As the ticket hadn't been changed for 9
months I thought nobody was working on it. Thanks!

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:11>

Sage

unread,
Feb 9, 2012, 9:54:40 PM2/9/12
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
------------------------------+---------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-5.0
Component: combinatorics | Resolution:
Keywords: Cernay2012 | Work_issues:
Upstream: N/A | Reviewer:
Author: | Merged:
Dependencies: |
------------------------------+---------------------------------------------
Changes (by tmonteil):

* keywords: => Cernay2012


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:12>

Sage

unread,
Aug 1, 2012, 8:57:30 AM8/1/12
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------------+------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-5.3
Component: combinatorics | Resolution:
Keywords: Cernay2012 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------

Comment (by slabbe):

Thierry, can you upload your patch here? Was it ready?

Sébastien

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:13>

Sage

unread,
Jan 3, 2013, 1:05:34 PM1/3/13
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------------+------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-5.6
Component: combinatorics | Resolution:
Keywords: Cernay2012 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------

Comment (by kcrisman):

See also #13884, though it should be dealt with here.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:14>

Sage

unread,
Jan 20, 2013, 5:07:35 AM1/20/13
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------------+------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-5.6
Component: combinatorics | Resolution:
Keywords: Cernay2012 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------

Comment (by ncohen):

> Thierry, can you upload your patch here? Was it ready?

6 months old question left unanswered.. Time for a ping `:-P`

Nathann

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:15>

Sage

unread,
Jan 20, 2013, 5:12:26 AM1/20/13
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------------+------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-5.6
Component: combinatorics | Resolution:
Keywords: Cernay2012 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------

Comment (by kini):

http://combinat.sagemath.org/patches/log/2cde7c3154c3
/sloane_new_website_parsers-tm.patch

Nothing happened for two years, and the patch is still sitting in the
combinat queue without being posted on trac.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:16>

Sage

unread,
Jan 20, 2013, 5:15:05 AM1/20/13
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------------+------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-5.6
Component: combinatorics | Resolution:
Keywords: Cernay2012 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------

Comment (by ncohen):

"The Sage-Combinat experience" `:-P`

So, should we set this ticket to `need_work`, or `needs_info`, or
`wait_for_the_combinat_queue_to_be_reviewed` ? `:-P`

Nathann

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:17>

Sage

unread,
Jan 21, 2013, 6:32:59 AM1/21/13
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------------+------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-5.6
Component: combinatorics | Resolution:
Keywords: Cernay2012 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------

Comment (by tmonteil):

Hi,

sorry for the delay, the version on the combinat queue is not the good
one, during the Cernay combinat days in last february (less than one
year!), i build a new class named oeis, that allows to get all kind of
information from the oeis db (cross references, web links, ...).

I upload a temporary version here so that you can try it, but the
documentation is not finished, and non backward-compatible changes may
still appear.

Thierry

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:18>

Sage

unread,
Jun 5, 2013, 10:08:08 AM6/5/13
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------------+------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-5.10
Component: combinatorics | Resolution:
Keywords: Cernay2012 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Changes (by jpflori):

* cc: jpflori (added)


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:19>

Sage

unread,
Jun 8, 2013, 1:06:21 PM6/8/13
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------------+------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-5.10
Component: combinatorics | Resolution:
Keywords: Cernay2012 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------

Comment (by tmonteil):

The patch needs to be rebased after #13701, some doctests, and make urls
clickable from the notebook.

I will finish this during sage days 49.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:20>

Sage

unread,
Jun 21, 2013, 10:25:56 AM6/21/13
to sage...@googlegroups.com
#10358: The sloane_find command is now completely broken
---------------------------------+------------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: new
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Changes (by chrisjamesberg):

* cc: chrisjamesberg (added)


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:21>

Sage

unread,
Jun 21, 2013, 1:26:32 PM6/21/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Changes (by {'newvalue': u'Thierry Monteil', 'oldvalue': ''}):

* keywords: Cernay2012 => Cernay2012 days49
* status: new => needs_review
* author: => Thierry Monteil


Old description:


> The sloane_find command, which parses output of a webpage, is now
> completely broken due to the Sloane sequence webpage being rewritten. It
> silently always finds nothing.
>
> {{{
> sage: sloane_find([1,1,2,3,5,8,13,21], nresults=1)
> []
> }}}

New description:

The sloane_find command, which parses output of a webpage, is broken for
years due to the Sloane sequence webpage being rewritten. It silently

always finds nothing.

{{{
sage: sloane_find([1,1,2,3,5,8,13,21], nresults=1)
[]
}}}

The aim of this ticket is to propose a new interface with OEIS
http://oeis.org/

--

Comment:

There is a room for lots of improvements, but i submit it now under the
social pressure ;)

Most tests use an internet connection, so do not forget
`--optional=sage,internet` when testing.

The name of the method `.natural_object()` might be improved (`.sage()` is
not better since an OEIS sequence is already a Sage object).

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:22>

Sage

unread,
Jun 21, 2013, 1:40:40 PM6/21/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------

Comment (by kcrisman):

Just a brief question - why the `oeis()` rather than `sloane_find()`? Are
you just completely replacing the sloane.py? I just don't quite get why
this isn't just all put in sloane.py, and perhaps the new code replacing
the broken code... Not that I have a vested interest in this.

I do recommend that all references to `is broken for more than a year` be
changed to `is broken` or perhaps `has been broken for some time`.

Also, it would be nice to have references like
{{{
class:`sage.databases.oeis.OEIS`_
}}}
or whatever the correct format is.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:23>

Sage

unread,
Jun 22, 2013, 5:23:24 AM6/22/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------

Comment (by tmonteil):

Here is how i understand the mess. There are three different things
related to OEIS in Sage.

- `sage/databases/sloane.py` (still) contains a class `SloaneEncyclopedia`
that
corresponds to a local partial copy of the OEIS. It is really a
database.
This file used to contain a function `sloane_find()` as well that, given
a
sequence, looked on the web and answered the name, the title, and the
first
terms of the OEIS sequences containing it.

- `sage/databases/oeis.py` (which is created by this patch) contains two
classes,
- `OEIS`, that represents the on-line database, so that you can ask it
questions
like
- give me the sequence whose ID is 'A000040'
- give me 5 sequences whose description deal with "decimals".
- give me 3 sequences that contain `[2,3,5,7]` as a subsequence.
- (todo) : give me the explanation of the keyword 'cofr'
- ...
- `OEISSequence` that represents a sequence, so that you can ask it
questions like
- what is your name ?
- what are your first terms ?
- are you finite ?
- do you have some references, links,... ?
- what is your starting index ?
- which natural Sage object do you represent (continued fraction,
decimal
number, sequence, power series,...) ?
- ...

- `sage/combinat/sloane_functions.py` contains a generic class
`SloaneSequence`,
and a class (that inherits from the generic one) for each implementation
of a
given OEIS sequence. Such a class allows to dynamically give more terms
than
the one stored in OEIS. This functionality could perhaps be redesigned
in
something lighter (like a dictionary of functions), to ease adding new
entries).

Of course `OEIS` and `sloane_find()` are related, which is why i posted
the patch
on this ticket. But, the answers are not of the same type (direct
informations
versus an OEIS sequences that you can ask for informations), hence if i
name
the class `OEIS` as `sloane_find`, old code using `sloane_find()` won't
work either,
hence the deprecation warning instead. Also it would have been harder to
extend the `function sloane_find()`, where it will be easy for the classes
`OEIS`/`OEISSequence`.

Actually, i do not know whether `oeis.py` should stay in the
`sage/databases/`
directory, since is it not an interface to a local database but a tool to
fetch an online website, like `finance/stock.py` and
`interfaces/magma_free.py`

Perhaps should i move it to `sage/combinat/` directory (where
`sloane_functions.py` is), or maybe we should move all three tools to a
`sage/combinat/oeis/` directory (but then `sloane.py` will not be in
`sage/databases/` anymore) ? The current choice is the laziest.

Of course those 3 tools related to OEIS should be interfaced together
(e.g. if
there are too many online queries, suggest the user to install the offline
database ; if there is a Sage implementation of some OEIS sequence, then
use
it when iterating over it once the first terms are exhausted ; and so on).
This is planned but, will take some more tests, and perhaps having 3
different tools for 3 different purposes is a good start. Having the web,
the DB and the
functions interfaced will also allow to be more lazy (e.g an OEIS sequence
could be created with only its ID, without fetching the web as long as
there are local
answers, this could be easily done in the OEIS/OEISSequence framework).

I will change the deprecation messages, and description of broken
functions as you suggested.

Concerning the reference class:`sage.databases.oeis.OEIS`_, i already put
one in the general description of sloane.py (as a SEEALSO::). Should i
also put one in the deprecation warnings as well ?

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:24>

Sage

unread,
Jun 27, 2013, 2:21:30 PM6/27/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------

Comment (by ncohen):

Helloooooooo !!

I noticed small things

* `find_by_description` does not use `first_result`
* {{{``absolute_value`` - (bool, default False) expliquer le bordel.}}}
* Shouldn't `OEISSequence.fields` be renamed to `_fields` ? It's weird to
have this constant among so many functions in the tab-completion.
* In your deprecation warnings could you replace "oeis" by "oeis()" ? To
emphasize that "oeis" is a function that should be used instead of
"sloane_find" ?
* I am not a big fan of the design of `first_terms` which builds the list
of all terms, and that is subsequently called by `__call__` and
`__getitem__` that ignore most values and return only one. But of course
efficiency is not really a problem here `:-P`
* The documentation of the OEIS module begins a tad harshly. A sentence
saying "The OEIS is an online database for integer sequences, you can
query it through Sage in order to guess how an integer sequence contiues
and what it may mean" would be nice before all Sage examples are given
`:-)`

This being said I like your new code, and I think that it fits well in
`database/`...

Nathann

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:25>

Sage

unread,
Jun 28, 2013, 12:52:06 PM6/28/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_info
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Changes (by ncohen):

* status: needs_review => needs_info


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:26>

Sage

unread,
Jul 2, 2013, 5:07:43 AM7/2/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_info
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Changes (by VivianePons):

* cc: VivianePons (added)


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:27>

Sage

unread,
Jul 16, 2013, 6:47:58 AM7/16/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_info
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------

Comment (by tmonteil):

Here is the first review patch.

Suggested by Karl-Dieter:

- I do recommend that all references to is broken for more than a year be
changed to is broken or perhaps has been broken for some time.
- Done.
- Also, it would be nice to have references like

class:`sage.databases.oeis.OEIS`_ or whatever the correct format is.

- Done
- I added :mod:`OEIS <sage.databases.oeis>`
- I also added similar cross references between the three Sloane-
related modules.

Suggested by Nathann:

- find_by_description does not use first_result
- Done.
- I think it disapeared when migrating from my first patch and the new
framework.
- ``absolute_value`` - (bool, default False) expliquer le bordel.
- Done.
- Why did my en_GB spell checker did not alert me about that ? ;)
- Shouldn't OEISSequence.fields be renamed to _fields ? It's weird to have

this constant among so many functions in the tab-completion.

- Done.
- I like to see it exists, but i agree this may be confusing, and
perhaps
someone that need this will find it even if it is called _fields.
- In your deprecation warnings could you replace "oeis" by "oeis()" ? To

emphasize that "oeis" is a function that should be used instead of
"sloane_find" ?

- Done.
- I am not a big fan of the design of first_terms which builds the list of

all
terms, and that is subsequently called by __call__ and __getitem__ that
ignore most values and return only one. But of course efficiency is not
really a problem here :-P

- Done.
- Actually, the result we get from the website is a string from which
we
have to extract the first terms, and if i want the 10th term, id no
not
see how to find it without parsing the whole string (or at least a
big
part of it since i do not know the length of the 9 previous integers
of
the sequence). There used to be a @cached_method here (and i forgot
to
remove the associated import_statement), so i put it back, hence
many
calls to __call__ or __getitem__ will cost string parsing only the
first
time.
- Also, i think it is good to have such a separate method to say that
those first terms come from the online database. This might be
useful
when interfacing with `sloane_functions`, and then have a differnt
method like `further_terms` or so, to distinguish them (and allow
cross
testing).
- The documentation of the OEIS module begins a tad harshly. A sentence

saying
"The OEIS is an online database for integer sequences, you can query it
through Sage in order to guess how an integer sequence contiues and what
it
may mean" would be nice before all Sage examples are given :-)

- Done.

Moreover, i took the opportunity to fix a few things:

- I added empty default values to the variables of sloane_find() and
sloane_sequence() so that calling them without argument will lead to the
deprecation warning instead of an error.
- Thanks to the patchbot, i noticed that Sage startuptime was slower with
oeis, this is due to the import of modules that are not imported
elsewhere
in Sage: `HTMLParser` and `webbrowser`. Therefore, i now import them in
the
right methods only, and make oeis lazy_imported as well.
- Thanks to the patchbot, i put doctest coverage of oeis.py to 100% (i
forgot
to doctest `.__init__()` and untestable functions like `.browse()`)
- I removed an old unused option in `FancyTuple`, and fixed some typos.
- I added a .browse() method to OEIS class.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:28>

Sage

unread,
Jul 16, 2013, 7:03:07 AM7/16/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Changes (by tmonteil):

* status: needs_info => needs_review


Old description:


> The sloane_find command, which parses output of a webpage, is broken for
> years due to the Sloane sequence webpage being rewritten. It silently
> always finds nothing.
>
> {{{
> sage: sloane_find([1,1,2,3,5,8,13,21], nresults=1)
> []
> }}}
>
> The aim of this ticket is to propose a new interface with OEIS
> http://oeis.org/

New description:

The sloane_find command, which parses output of a webpage, is broken for
years due to the Sloane sequence webpage being rewritten. It silently
always finds nothing.

{{{
sage: sloane_find([1,1,2,3,5,8,13,21], nresults=1)
[]
}}}

The aim of this ticket is to propose a new interface with OEIS
http://oeis.org/

Apply:
* [attachment:trac_10358-oeis-tm.patch]
* [attachment:trac_10358-oeis-review_1-tm.patch]

--

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:29>

Sage

unread,
Jul 17, 2013, 3:45:01 PM7/17/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------

Comment (by ncohen):

I am playing with oeis again and thought of two others things..

* How come that there is no ".sequence" entry when you have a oeis
sequence ? Sounds natural, doesn't it ? Wouldn't it be muuuuch more
natural than "first_n_terms" ? `O_o`

* How come that there is no way to print all the information that OEIS
knows on the sequence ? Something like `seq.show_all()` or `seq.show` ?
Right now everything is split in manymany fields, which is nice if you
want to write some code but if you just want to know everything there is
to know about this sequence, well.. It's quite uneasy to use, isn't it ?

Oh, and perhaps you should use viewer.browser instead of webbroser ?

http://www.sagemath.org/doc/reference/misc/sage/misc/viewer.html

Nathann

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:30>

Sage

unread,
Jul 17, 2013, 5:57:48 PM7/17/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: positive_review
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Changes (by ncohen):

* status: needs_review => positive_review


Comment:

Hmmmmmm... Looks like your way of picking the browser makes more sense
than mine. It's bit weird though that `viewer.browser` does not use
webbrowser at all `O_o`

Nathann

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:31>

Sage

unread,
Jul 17, 2013, 5:58:13 PM7/17/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_work
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Changes (by ncohen):

* status: positive_review => needs_work


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:32>

Sage

unread,
Jul 17, 2013, 5:58:21 PM7/17/13
to sage...@googlegroups.com
#10358: New interface with OEIS
-------------------------------------+--------------------------------------
Reporter: was | Owner: tmonteil
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: Cernay2012 days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Thierry Monteil | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Changes (by ncohen):

* status: needs_work => needs_review


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10358#comment:33>

Reply all
Reply to author
Forward
0 new messages