#11316: Weighted degree term orders added
--------------------------------+-------------------------------------------
   Reporter:  klee              |          Owner:  AlexGhitza  
       Type:  enhancement       |         Status:  needs_review
   Priority:  major             |      Milestone:  sage-4.7.1  
  Component:  basic arithmetic  |       Keywords:              
Work_issues:                    |       Upstream:  N/A         
   Reviewer:                    |         Author:  Kwankyu Lee 
     Merged:                    |   Dependencies:              
--------------------------------+-------------------------------------------
Changes (by SimonKing):

  * priority:  minor => major


Comment:

 Here is a further way to solve the problem.

 I noticed that you use a method `is_weighted_degree_order` for testing
 whether `__weights` is not None, and you consequently use it (hence, you
 do not have `if self.__weights is not None`) in other parts of your code.
 That is good!

 If you have an old pickle then `__weights` is not present. Hence,
 `self.__weights` will result in an attribute error, and this error
 indicates that you have no weighted degree order.

 Hence, the fourth suggestion is to remove `__setstate__`, and to simply
 rewrite `is_weighted_degree_order` as follows:
 {{{
 def is_weighted_degree_order(self):
     try:
         return self.__weights is not None
     except AttributeError:
         self.__weights = None
         return False
 }}}

 That's another clean solution. There might be additional changes in your
 code needed, but I guess these changes would be minor.

 I would like to see timings for all four solutions. Namely, it may be that
 frequent calls to functions like `is_weighted_degree_order` slows down
 arithmetic.

 By the way: I think that the addition of weighted degree orders is no
 "minor" extension. Therefore I'm bumping up the priority of this ticket.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11316#comment:19>
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