Opened 6 years ago
Closed 5 years ago
#17158 closed enhancement (fixed)
Remove some functions from sage/misc/functional.py
Reported by:  jdemeyer  Owned by:  

Priority:  major  Milestone:  sage6.4 
Component:  misc  Keywords:  cleanup 
Cc:  Merged in:  
Authors:  Jeroen Demeyer  Reviewers:  Ralf Stephan 
Report Upstream:  N/A  Work issues:  
Branch:  b7eb59f (Commits)  Commit:  b7eb59f3e5e048780f8abd9cc5cf33617d5f273d 
Dependencies:  #17157  Stopgaps: 
Description (last modified by )
Some functions in functional.py
aren't used or are duplicated in other places. Fix this.
I'm keeping the log()
function for now because it is imported globally as log_b
and it is actually used in the Sage library in various places.
I'm deprecating the global functions one()
and zero()
since I don't see the point of having them.
Change History (12)
comment:1 Changed 6 years ago by
 Description modified (diff)
comment:2 Changed 6 years ago by
 Description modified (diff)
comment:3 Changed 6 years ago by
 Branch set to u/jdemeyer/ticket/17158
 Created changed from 10/15/14 08:37:25 to 10/15/14 08:37:25
 Modified changed from 10/16/14 13:12:24 to 10/16/14 13:12:24
comment:4 Changed 6 years ago by
 Commit set to a7910319f84e6751fe345ad9f4942d42d1a4f245
 Status changed from new to needs_review
comment:5 followup: ↓ 6 Changed 6 years ago by
So you're saying that a lot of the removed functions aren't imported globally? But you are removing a lot of global imports  where do they live instead? I have a feeling that at least for a few of the symbolic ones there was a reason for having this lastditch place for them.
Also, I notice some other cleanup that is not related to this (e.g. in monoids), which seems odd.
comment:6 in reply to: ↑ 5 Changed 6 years ago by
Replying to kcrisman:
So you're saying that a lot of the removed functions aren't imported globally? But you are removing a lot of global imports  where do they live instead?
Most of them can either be called as methods (a.exp()
instead of exp(a)
) or imported from a different place (usually in sage.functions
or sage.structure
in the case of parent()
).
I have a feeling that at least for a few of the symbolic ones there was a reason for having this lastditch place for them.
I don't know what it could be... in any case all doctests pass without them.
Also, I notice some other cleanup that is not related to this (e.g. in monoids), which seems odd.
I had to move that import to break a cyclic import loop.
comment:7 Changed 6 years ago by
Hmm, indeed apparently some of these imports are redundant and/or wiped out, e.g.exp??
gives the source from sage.functions.log.
comment:8 Changed 5 years ago by
 Commit changed from a7910319f84e6751fe345ad9f4942d42d1a4f245 to b7eb59f3e5e048780f8abd9cc5cf33617d5f273d
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
b7eb59f  Remove some functions from sage/misc/functional.py

comment:9 Changed 5 years ago by
Rebased to sage6.5.beta2.
comment:10 Changed 5 years ago by
 Reviewers set to Ralf Stephan
comment:11 Changed 5 years ago by
 Keywords cleanup added
 Status changed from needs_review to positive_review
I stumbled over this ticket because I noticed the same issue. Looks fine and passes make ptestlong
.
comment:12 Changed 5 years ago by
 Branch changed from u/jdemeyer/ticket/17158 to b7eb59f3e5e048780f8abd9cc5cf33617d5f273d
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
Improve formula for Bell numbers
Remove some functions from sage/misc/functional.py