Opened 11 years ago

Closed 7 years ago

#10136 closed defect (fixed)

`log(x).operator() == log` should return `True`

Reported by: burcin Owned by: burcin
Priority: major Milestone: sage-6.2
Component: symbolics Keywords: log, ln, function
Cc: Merged in:
Authors: Burcin Erocal Reviewers: Ralf Stephan
Report Upstream: N/A Work issues:
Branch: a105f80 (Commits, GitHub, GitLab) Commit: a105f80b73a9c76fd1717270f5d029e794353a8b
Dependencies: Stopgaps:

Status badges

Description (last modified by burcin)

Reported by Francois Maltey on sage-devel:

> log(x).operator() == ln # is True, yes the alias ln is better than
> the log name
> log(x).operator() == log # is False (this feature looks like the 
> binomial one)
> log(x).operator() == sage.function.log.function_log # is True

We should define a __call__() method in the Function_log class from sage/functions/log.py, to handle the base argument. Then ln() and log() can be the same function and log(x).operator() == log will return True.

Apply trac_10136-log_operator.patch

Attachments (1)

trac_10136-log_operator.patch (8.7 KB) - added by burcin 8 years ago.

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by burcin

comment:1 Changed 8 years ago by burcin

  • Authors set to Burcin Erocal
  • Description modified (diff)
  • Status changed from new to needs_review

comment:2 Changed 8 years ago by ppurka

Just a minor comment: the "INPUT" description for log is now lost. Just by looking at *args, **kwds it is not possible to know what should be the order of the argument and the base of the log. Also, **kwds gives the impression that it can take in a lot of kwd arguments, whereas I think it takes only the keyword hold=True.

comment:3 Changed 8 years ago by kcrisman

Also, my guess is that log? will no longer be very helpful. I haven't tried this, though.

comment:4 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:5 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:6 Changed 7 years ago by rws

  • Keywords log ln function added
  • Reviewers set to Ralf Stephan
  • Status changed from needs_review to positive_review

@ppurka: log, like exp, never had an "INPUT" description; the hold parameter is introduced informally in both cases; please open a separate ticket.

@kcrisman: log? is fine, and identical to ln?

Reviewer's patch addresses this patchbot failure:

File "src/sage/ext/fast_callable.pyx", line 1524, in sage.ext.fast_callable._expression_binop_helper.get_builtin_functions
Failed example:
    sorted(list(builtins.values()))
Expected:
    ['abs', 'abs', 'acos', 'acosh', 'add', 'asin', 'asinh', 'atan', 'atanh', 'ceil', 'cos', 'cosh', 'cot', 'csc', 'div', 'exp', 'floor', 'floordiv', 'inv', 'log', 'log', 'mul', 'neg', 'pow', 'sec', 'sin', 'sinh', 'sqrt', 'sub', 'tan', 'tanh']
Got:
    ['abs', 'abs', 'acos', 'acosh', 'add', 'asin', 'asinh', 'atan', 'atanh', 'ceil', 'cos', 'cosh', 'cot', 'csc', 'div', 'exp', 'floor', 'floordiv', 'inv', 'log', 'mul', 'neg', 'pow', 'sec', 'sin', 'sinh', 'sqrt', 'sub', 'tan', 'tanh']

I hazard that this small change won't need another review, so I'll set positive.

comment:7 Changed 7 years ago by rws

  • Branch set to u/rws/ticket/10136
  • Modified changed from 02/18/14 08:36:08 to 02/18/14 08:36:08

comment:8 Changed 7 years ago by git

  • Commit set to a105f80b73a9c76fd1717270f5d029e794353a8b
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

a105f80Merge branch 'develop' into ticket/10136

comment:9 Changed 7 years ago by rws

  • Status changed from needs_review to positive_review

comment:10 Changed 7 years ago by vbraun

  • Branch changed from u/rws/ticket/10136 to a105f80b73a9c76fd1717270f5d029e794353a8b
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.