Opened 8 years ago

Closed 8 years ago

#11974 closed defect (fixed)

transformations don't work with a function that returns a singleton numpy array

Reported by: jason Owned by: jason, was
Priority: minor Milestone: sage-5.1
Component: graphics Keywords: sd40.5
Cc: kcrisman Merged in: sage-5.1.beta2
Authors: Jason Grout Reviewers: Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

This patch just casts things to floats when it makes sense. This makes things consistent with plot3d. See http://ask.sagemath.org/question/858/2d-interpolating-function-from-numpy-arrays-to

Attachments (1)

trac_11974.patch (3.6 KB) - added by jason 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by jason

comment:1 Changed 8 years ago by jason

  • Status changed from new to needs_review

comment:2 Changed 8 years ago by kcrisman

  • Cc kcrisman added

comment:3 Changed 8 years ago by jdemeyer

  • Milestone sage-4.7.3 deleted

Milestone sage-4.7.3 deleted

comment:4 Changed 8 years ago by kcrisman

  • Authors set to Jason Grout
  • Keywords sd40.5 added
  • Milestone set to sage-5.1
  • Reviewers set to Karl-Dieter Crisman
  • Status changed from needs_review to positive_review

Amazingly, this even speeds things up.

# old
sage: timeit('[h(1,2) for h in T.to_cartesian(operator.mul)]')
625 loops, best of 3: 968 µs per loop
# new
sage: timeit('[h(1,2) for h in T.to_cartesian(operator.mul)]')
625 loops, best of 3: 939 µs per loop

Good work, sorry it took so long to get to reviewing this.

Annoyingly, all these doctests are not visible in the built docs because the entire class is an underscore!

comment:5 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.1.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.