Re: [sage-notebook] remove server/notebook/worksheet.py from Sage library?

2 views
Skip to first unread message
Message has been deleted

Tim Joseph Dumol

unread,
Jun 13, 2010, 6:38:22 AM6/13/10
to sage-n...@googlegroups.com
sage/server/notebook/worksheet.py cannot be removed since the sources
under server/notebook/* are still used by SageNB for conversion from
the old pickled data storage format to the new one. Perhaps they can
be excluded from the doctest coverage statistics?

On Sun, Jun 13, 2010 at 6:08 PM, Minh Nguyen <nguye...@gmail.com> wrote:
> Hi folks,
>
> Ticket #3565 [1] aims to bring the doctest coverage of the module
> server/notebook/worksheet.py up to 100%. As I understand it, this
> module is no longer maintained nor being worked on because Sage
> notebook development is now done in the SageNB repository. For any
> Sage notebook experts out there: Can we remove the module
>
> server/notebook/worksheet.py
>
> from the Sage library?
>
> [1] http://trac.sagemath.org/sage_trac/ticket/3565
>
> --
> Regards
> Minh Van Nguyen
>

--
Tim Joseph Dumol <tim (at) timdumol (dot) com>
http://timdumol.com

William Stein

unread,
Jun 13, 2010, 9:23:50 AM6/13/10
to sage-n...@googlegroups.com
On Sunday, June 13, 2010, Tim Joseph Dumol <t...@timdumol.com> wrote:
> sage/server/notebook/worksheet.py cannot be removed since the sources
> under server/notebook/* are still used by SageNB for conversion from
> the old pickled data storage format to the new one. Perhaps they can
> be excluded from the doctest coverage statistics?
>

big +1


> On Sun, Jun 13, 2010 at 6:08 PM, Minh Nguyen <nguye...@gmail.com> wrote:
>> Hi folks,
>>
>> Ticket #3565 [1] aims to bring the doctest coverage of the module
>> server/notebook/worksheet.py up to 100%. As I understand it, this
>> module is no longer maintained nor being worked on because Sage
>> notebook development is now done in the SageNB repository. For any
>> Sage notebook experts out there: Can we remove the module
>>
>> server/notebook/worksheet.py
>>
>> from the Sage library?
>>
>> [1] http://trac.sagemath.org/sage_trac/ticket/3565
>>
>> --
>> Regards
>> Minh Van Nguyen
>>
>
>
>
> --
> Tim Joseph Dumol <tim (at) timdumol (dot) com>
> http://timdumol.com
>

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Carl Witty

unread,
Jul 19, 2010, 3:50:29 PM7/19/10
to sage-notebook
On Jun 13, 3:38 am, Tim Joseph Dumol <t...@timdumol.com> wrote:
> sage/server/notebook/worksheet.py cannot be removed since the sources
> under server/notebook/* are still used by SageNB for conversion from
> the old pickled data storage format to the new one. Perhaps they can
> be excluded from the doctest coverage statistics?

Sage has a function
sage.structure.sage_object.register_unpickle_override, that lets you
change the name lookup process that unpickling uses. If the SageNB
classes are still compatible with the old Sage classes, then you can
just add a series of calls like:
register_unpickle_override('sage.server.notebook.user_conf',
'UserConfiguration', sagenb.notebook.user_conf.UserConfiguration) and
that should fix unpickling the old pickles.

Also, Sage has a function explain_pickle that's sometimes useful when
trying to understand old pickles; it "decompiles" a pickle into
executable Python code, so you can see exactly what is in a pickle
even if you don't have the original classes around.

Carl

William Stein

unread,
Jul 19, 2010, 4:00:45 PM7/19/10
to sage-n...@googlegroups.com
On Mon, Jul 19, 2010 at 9:50 PM, Carl Witty <carl....@gmail.com> wrote:
> On Jun 13, 3:38 am, Tim Joseph Dumol <t...@timdumol.com> wrote:
>> sage/server/notebook/worksheet.py cannot be removed since the sources
>> under server/notebook/* are still used by SageNB for conversion from
>> the old pickled data storage format to the new one. Perhaps they can
>> be excluded from the doctest coverage statistics?
>
> Sage has a function
> sage.structure.sage_object.register_unpickle_override, that lets you
> change the name lookup process that unpickling uses.  If the SageNB
> classes are still compatible with the old Sage classes, then you can
> just add a series of calls like:
> register_unpickle_override('sage.server.notebook.user_conf',
> 'UserConfiguration', sagenb.notebook.user_conf.UserConfiguration) and
> that should fix unpickling the old pickles.

Unfortunately, the new classes are not compatible with the old ones.
Or at a minimum, we definitely don't want to require that they be
required to be compatible. I put a lot of work into the new storage
format (which makes no reference to python code) in order to obtain
this freedom.

> Also, Sage has a function explain_pickle that's sometimes useful when
> trying to understand old pickles; it "decompiles" a pickle into
> executable Python code, so you can see exactly what is in a pickle
> even if you don't have the original classes around.

Regarding the notebook, I noticed to my surprise that misc/cython.pyx
has these lines in it (which should be fixed, of course):

------------
import sage.server.support
d = {}
sage.server.support.cython_import_all(tmpfile, d,
verbose=verbose,
compile_message=compile_message,
use_cache=use_cache,
create_local_c_file=False)
------------

I've made fixing the above: http://trac.sagemath.org/sage_trac/ticket/9552

Also, regarding the notebook, I think the best plan is to deprecate
the old notebook server format at some point. I.e., to print a
message such as: "you have a very old sage notebook install. To fix
this, you *must* install sage version between 4.1 and 5.0 and run the
notebook() command." Since the notebook server format was changed in
around October 2009, we definitely shouldn't deprecate loading old
notebook servers until at least that date. I could see deprecating in
2011 (i.e., after about 18 months from the format change).

Note that old *worksheets* will still work, and should continue to do
so indefinitely. They are easy to support. What is hard is a whole
server install.

Reply all
Reply to author
Forward
0 new messages