Ticket #11974 (closed defect: fixed)

Opened 19 months ago

Last modified 12 months ago

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 Work issues:
Report Upstream: N/A Reviewers: Karl-Dieter Crisman
Authors: Jason Grout Merged in: sage-5.1.beta2
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

trac_11974.patch Download (3.6 KB) - added by jason 19 months ago.

Change History

Changed 19 months ago by jason

comment:1 Changed 19 months ago by jason

  • Status changed from new to needs_review

comment:2 Changed 19 months ago by kcrisman

  • Cc kcrisman added

comment:3 Changed 19 months ago by jdemeyer

  • Milestone sage-4.7.3 deleted

Milestone sage-4.7.3 deleted

comment:4 Changed 12 months ago by kcrisman

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

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 12 months ago by jdemeyer

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