Comments (6)
The left operand gets the first shot at implementing the operation. Only if it fails does the right operand attempt with its __radd__
method. Because MultiVector
implements the Sequence
interface, np.asarray()
knows how to convert it to a numpy array via np.asarray()
. The numpy scalar types will attempt to convert the other operand to a numpy array via np.asarray()
. Since this succeeds, np.float64.__add__()
succeeds, and MultiVector.__radd__()
does not get a chance to run.
I don't have a good idea offhand how to get around this.
from clifford.
thanks very much for the info.
is it clear to you that the operator change would cause this? the exp()
function operating on a MultiVector
now fails also, which i suspect is related.
a similar question is raised in this SO post. after looking at their suggestions the __array_priority__
does not work, but __array_wrap__
does. however this hook seems to be after the numpy __add__
has happened...
they also suggest to subclassing ndarray
. however, i am not sure that i have the time/ability to make this change to the whole class, or to decide whether it is a good idea.
from clifford.
so if the left hand operator fails, the right operand attempt with its __radd__
method, then would it be possible to make the ufunc 'fail' by doing something in __array_prepare__
from clifford.
arsenovic@bd3bb72 . . . embarrasing
from clifford.
@arsenovic is this now fixed or still a problem?
from clifford.
i think we can close
from clifford.
Related Issues (20)
- repr of subalgebras
- Documentation typos HOT 1
- Add an ipython magic command for quick algebra construction
- leftLaInv fails for complex valued multivectors
- Pickling fails with NUMBA_DISABLE_JIT=1
- Doc builds on master are broken HOT 1
- Improve import time
- Installation issue... Jupyter Notebook HOT 8
- Unexpected numerical result, large difference between matrix and clifford method HOT 3
- Brew version HOT 4
- frame2Mat should return somthing...
- Problem with .inv() function
- Is there a function for line-line intersection?
- Possibly wrong up projection in clifford.gac
- Deviation between MultiVector and MVArray calculation
- Express CGA multivectors in terms of point the origin+infinity
- Support for basis blades that are non-canonical HOT 1
- Meet fails when line intersects sphere at only one point
- AttributeError: module 'numba' has no attribute 'generated_jit' HOT 2
- Deprecated Numba function "generated_jit" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clifford.