#10354: Remove deprecated word objects from the pickle jar
------------------------+---------------------------------------------------
   Reporter:  slabbe    |       Owner:  slabbe    
       Type:  defect    |      Status:  new       
   Priority:  major     |   Milestone:  sage-4.6.2
  Component:  pickling  |    Keywords:            
     Author:            |    Upstream:  N/A       
   Reviewer:            |      Merged:            
Work_issues:            |  
------------------------+---------------------------------------------------

Old description:

> The [http://code.google.com/p/sage-words/ sage-words google code] was
> merged into sage-3.2.2 two years ago in December 2008 (#4653). At that
> time, about a dozen of objects were added in the sage pickle jar using
> that code.
>
> Then, in January 2009, we realized that all of our work was not that good
> and we started to change all the hierarchy of classes. Basically, we
> decided after discussions that it was better to get the mathematical
> classes independent of the chosen representation. This was achieved by
> ticket #6519 merged in sage-4.1.1 during summer 2009.
>
> Twist in the code were made to make the dozen of old word objects pickled
> from version < 4.1.1 still usable. As written by Franco Saliola in #6519
> :
>
> {{{
> this way, an old-style word can be unpickled, and during the unpickling,
> it
> gets converted to a new-style word, and the user is given a warning to
> re-save
> the word
>
> [...]
>
> This is a temporary fix: since the WordContent code is not necessary for
> any
> other part of Sage, it will be deleted in a few months. In the meantime,
> if
> there is anyone with some saved word objects, then unpickling will work.
> }}}
>
> Those deprecation warnings now exists since more than one year, so it's
> now time to complete the cleaning. As I [http://groups.google.com/group
> /sage-combinat-devel/browse_thread/thread/440ae08a74c35df7 wrote] on
> sage-combinat devel mailing list in June 2010 :
>
> {{{
> I would like to remove those 6 pickled object from the pickle jar and
> replace
> them with the new generation of words that got in Sage during summer
> 2009. This
> way, it would really make sure that we do not break the pickle of objects
> that
> are really used. Also, this will allow us to then clean up the code a
> lot,
> because some kind of arabesques are being done to support the old
> stuff...
>
> I know William prefer to keep old objects in the pickle jar, but in this
> case,
> I would like to remove them.... Will put time on this when I have time...
> }}}
>
> Then, William answered in the same conversation :
>
> {{{
> I do prefer keeping old pickles (that's the point of the pickle jar), but
> I
> definitely don't want to get in the way of the sage-combinatorics group,
> and
> understand that your code is under very active development.
>
> Thanks for the work you're doing on cleanup!
>
> William
> }}}
>
> So let's do the cleanup now!
>
> By the way, the current output of the unpickle testing (taken from
> {{{sage/structure/sage_object.pyx}}}) is ugly and will be fixed by this
> ticket :
>
> {{{
> sage: std = os.environ['SAGE_DATA'] +
> '/extcode/pickle_jar/pickle_jar.tar.bz2'
> sage: print "x"; sage.structure.sage_object.unpickle_all(std)
> x...
> Successfully unpickled 586 objects.
> Failed to unpickle 0 objects.
> }}}
>
> The goal of this ticket is to remove, update or add objects to the pickle
> jar so that one can remove the deprecated file
> {{{sage/combinat/words/utils.py}}} and
> {{{sage/combinat/words/content.py}}}. The following objects are OK and
> can be kepted as is:
>
>  - [OK]
> {{{_class__sage_combinat_lyndon_word_LyndonWords_evaluation__.sobj}}}
>  - [OK] {{{_class__sage_combinat_lyndon_word_LyndonWords_nk__.sobj}}}
>  - [OK]
> {{{_class__sage_combinat_lyndon_word_StandardBracketedLyndonWords_nk__.sobj}}}
>  - [OK] {{{_class__sage_combinat_subword_Subwords_w__.sobj}}}
>  - [OK] {{{_class__sage_combinat_subword_Subwords_wk__.sobj}}}
>  - [OK]
> {{{_class__sage_combinat_words_alphabet_OrderedAlphabet_Finite__.sobj}}}
>  - [OK]
> {{{_class__sage_combinat_words_alphabet_OrderedAlphabet_NaturalNumbers__.sobj}}}
>  - [OK]
> {{{_class__sage_combinat_words_alphabet_OrderedAlphabet_PositiveIntegers__.sobj}}}
>  -
> [OK] {{{_class__sage_combinat_words_word_generators_WordGenerator__.sobj}}}
>  - [OK] {{{_class__sage_combinat_words_words_Words_n__.sobj}}}
>
> The following objects must be deleted or updated:
>
>  - {{{_class__sage_combinat_words_morphism_WordMorphism__.sobj}}}
>  -
> {{{_class__sage_combinat_words_shuffle_product_ShuffleProduct_overlapping__.sobj}}}
>  -
> {{{_class__sage_combinat_words_shuffle_product_ShuffleProduct_overlapping_r__.sobj}}}
>  -
> {{{_class__sage_combinat_words_shuffle_product_ShuffleProduct_shifted__.sobj}}}
>  -
> {{{_class__sage_combinat_words_shuffle_product_ShuffleProduct_w1w2__.sobj}}}
>  -
> {{{_class__sage_combinat_words_suffix_trees_ImplicitSuffixTree__.sobj}}}
>  - {{{_class__sage_combinat_words_suffix_trees_SuffixTrie__.sobj}}}
>  - {{{_class__sage_combinat_words_utils_Factorization__.sobj}}}
>  - {{{_class__sage_combinat_words_word_AbstractWord__.sobj}}}
>  - {{{_class__sage_combinat_words_word_Word_over_Alphabet__.sobj}}}
>  -
> {{{_class__sage_combinat_words_word_Word_over_OrderedAlphabet__.sobj}}}
>  -
> {{{_class__sage_combinat_words_word_content_WordContentFromFunction__.sobj}}}
>  -
> {{{_class__sage_combinat_words_word_content_WordContentFromList__.sobj}}}
>  -
> {{{_class__sage_combinat_words_word_generators_ChristoffelWord_Lower__.sobj}}}
>  -
> {{{_class__sage_combinat_words_words_FiniteWords_length_k_over_OrderedAlphabet__.sobj}}}
>  -
> {{{_class__sage_combinat_words_words_FiniteWords_over_OrderedAlphabet__.sobj}}}
>  -
> {{{_class__sage_combinat_words_words_InfiniteWords_over_OrderedAlphabet__.sobj}}}
>  - {{{_class__sage_combinat_words_words_Words_over_Alphabet__.sobj}}}
>  -
> {{{_class__sage_combinat_words_words_Words_over_OrderedAlphabet__.sobj}}}
>

> For references, a ticket where objects were removed/updated from the
> pickle jar : #8911. The update was made by uploading the modified
> {{{sage/data/extcode/pickle_jar.tar.bz2}}} directly on the trac ticket.
>
> Command to create a .tar.bz2 :
>
> tar -jcvf archive_name.tar.bz2 directory_to_compress

New description:

 The [http://code.google.com/p/sage-words/ sage-words google code] was
 merged into sage-3.2.2 two years ago in December 2008 (#4653). At that
 time, about a dozen of objects were added in the sage pickle jar using
 that code.

 Then, in January 2009, we realized that all of our work was not that good
 and we started to change all the hierarchy of classes. Basically, we
 decided after discussions that it was better to get the mathematical
 classes independent of the chosen representation. This was achieved by
 ticket #6519 merged in sage-4.1.1 during summer 2009.

 Twist in the code were made to make the dozen of old word objects pickled
 from version < 4.1.1 still usable. As written by Franco Saliola in #6519 :

 {{{
 this way, an old-style word can be unpickled, and during the unpickling,
 it
 gets converted to a new-style word, and the user is given a warning to re-
 save
 the word

 [...]

 This is a temporary fix: since the WordContent code is not necessary for
 any
 other part of Sage, it will be deleted in a few months. In the meantime,
 if
 there is anyone with some saved word objects, then unpickling will work.
 }}}

 Those deprecation warnings now exists since more than one year, so it's
 now time to complete the cleaning. As I [http://groups.google.com/group
 /sage-combinat-devel/browse_thread/thread/440ae08a74c35df7 wrote] on sage-
 combinat devel mailing list in June 2010 :

 {{{
 I would like to remove those 6 pickled object from the pickle jar and
 replace
 them with the new generation of words that got in Sage during summer 2009.
 This
 way, it would really make sure that we do not break the pickle of objects
 that
 are really used. Also, this will allow us to then clean up the code a lot,
 because some kind of arabesques are being done to support the old stuff...

 I know William prefer to keep old objects in the pickle jar, but in this
 case,
 I would like to remove them.... Will put time on this when I have time...
 }}}

 Then, William answered in the same conversation :

 {{{
 I do prefer keeping old pickles (that's the point of the pickle jar), but
 I
 definitely don't want to get in the way of the sage-combinatorics group,
 and
 understand that your code is under very active development.

 Thanks for the work you're doing on cleanup!

 William
 }}}

 So let's do the cleanup now!

 By the way, the current output of the unpickle testing (taken from
 {{{sage/structure/sage_object.pyx}}}) is ugly and will be fixed by this
 ticket :

 {{{
 sage: std = os.environ['SAGE_DATA'] +
 '/extcode/pickle_jar/pickle_jar.tar.bz2'
 sage: print "x"; sage.structure.sage_object.unpickle_all(std)
 x...
 Successfully unpickled 586 objects.
 Failed to unpickle 0 objects.
 }}}

 The goal of this ticket is to remove, update or add objects to the pickle
 jar so that one can remove the deprecated file
 {{{sage/combinat/words/utils.py}}} and
 {{{sage/combinat/words/content.py}}}. The following objects are OK and can
 be kepted as is:

  - [OK]
 {{{_class__sage_combinat_lyndon_word_LyndonWords_evaluation__.sobj}}}
  - [OK] {{{_class__sage_combinat_lyndon_word_LyndonWords_nk__.sobj}}}
  - [OK]
 {{{_class__sage_combinat_lyndon_word_StandardBracketedLyndonWords_nk__.sobj}}}
  - [OK] {{{_class__sage_combinat_subword_Subwords_w__.sobj}}}
  - [OK] {{{_class__sage_combinat_subword_Subwords_wk__.sobj}}}
  - [OK]
 {{{_class__sage_combinat_words_alphabet_OrderedAlphabet_Finite__.sobj}}}
  - [OK]
 
{{{_class__sage_combinat_words_alphabet_OrderedAlphabet_NaturalNumbers__.sobj}}}
  - [OK]
 
{{{_class__sage_combinat_words_alphabet_OrderedAlphabet_PositiveIntegers__.sobj}}}
  -
 [OK] {{{_class__sage_combinat_words_word_generators_WordGenerator__.sobj}}}
  - [OK] {{{_class__sage_combinat_words_words_Words_n__.sobj}}}

 The following objects must be deleted or updated because they are affected
 by the deletion of {{{sage/combinat/words/utils.py}}} and
 {{{sage/combinat/words/word_content.py}}}:

  - {{{_class__sage_combinat_words_morphism_WordMorphism__.sobj}}}
  -
 
{{{_class__sage_combinat_words_shuffle_product_ShuffleProduct_overlapping__.sobj}}}
  -
 
{{{_class__sage_combinat_words_shuffle_product_ShuffleProduct_overlapping_r__.sobj}}}
  -
 {{{_class__sage_combinat_words_shuffle_product_ShuffleProduct_shifted__.sobj}}}
  -
 {{{_class__sage_combinat_words_shuffle_product_ShuffleProduct_w1w2__.sobj}}}
  -
 {{{_class__sage_combinat_words_suffix_trees_ImplicitSuffixTree__.sobj}}}
  - {{{_class__sage_combinat_words_suffix_trees_SuffixTrie__.sobj}}}
  - {{{_class__sage_combinat_words_utils_Factorization__.sobj}}}
  - {{{_class__sage_combinat_words_word_AbstractWord__.sobj}}}
  - {{{_class__sage_combinat_words_word_Word_over_Alphabet__.sobj}}}
  - {{{_class__sage_combinat_words_word_Word_over_OrderedAlphabet__.sobj}}}
  -
 {{{_class__sage_combinat_words_word_content_WordContentFromFunction__.sobj}}}
  -
 {{{_class__sage_combinat_words_word_content_WordContentFromList__.sobj}}}
  -
 {{{_class__sage_combinat_words_word_generators_ChristoffelWord_Lower__.sobj}}}
  -
 
{{{_class__sage_combinat_words_words_FiniteWords_length_k_over_OrderedAlphabet__.sobj}}}
  -
 {{{_class__sage_combinat_words_words_FiniteWords_over_OrderedAlphabet__.sobj}}}
  -
 
{{{_class__sage_combinat_words_words_InfiniteWords_over_OrderedAlphabet__.sobj}}}
  - {{{_class__sage_combinat_words_words_Words_over_Alphabet__.sobj}}}
  -
 {{{_class__sage_combinat_words_words_Words_over_OrderedAlphabet__.sobj}}}


 For references, a ticket where objects were removed/updated from the
 pickle jar : #8911. The update was made by uploading the modified
 {{{sage/data/extcode/pickle_jar.tar.bz2}}} directly on the trac ticket.

 Command to create a .tar.bz2 :

 tar -jcvf archive_name.tar.bz2 directory_to_compress

--

Comment(by slabbe):

 Here is a pickle jar made of the objects I am adding to the pickle jar :

 http://sage.math.washington.edu/home/slabbe/pickle_jar_new_word_objects.tar.bz2

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

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to