Ticket #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 | 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
Change History
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!
Note: See
TracTickets for help on using
tickets.

