-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
diff and pdiff method of class Mv throws exception when differentiate by a coordinate symbol #513
Comments
pdiff method of Mv class also throws the same exception when invoking (x*ex).pdiff(x). AttributeError Traceback (most recent call last) 1 frames AttributeError: 'Mul' object has no attribute 'obj' |
@mammalwong Can you also post minimal working example for this issue? Thanks! |
In version 0.5.1
raise exception:
Another related issue:
raise exception:
|
Thank you, @mammalwong , the fix should be in master now as #510 is now merged. |
x is a coordinate symbol (a plain sympy Symbol object) and ex is a Mv instance of a Ga basis symbol. I tried to invoke (x*ex).diff(x) and the method throws exception. From the exception stack frame below, it looks like Mv.diff passed self.obj to Ga.pDiff and pDiff try to resolve .obj again from obj.
AttributeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 (x*ex).diff(x)
1 frames
/usr/local/lib/python3.10/dist-packages/galgebra/mv.py in diff(self, coord)
1070 obj += tmp1 * tmp2
1071 else:
-> 1072 obj = self.Ga.pDiff(self.obj, coord)
1073 return Mv(obj, ga=self.Ga)
1074
/usr/local/lib/python3.10/dist-packages/galgebra/ga.py in pDiff(self, A, coord)
2050 # variable, but including case of non-constant basis vectors
2051
-> 2052 dA = self.mv(expand(diff(A.obj, coord)))
2053
2054 if self.connect_flg and self.dslot == -1 and not A.is_scalar(): # Basis blades are function of coordinates
AttributeError: 'Mul' object has no attribute 'obj'
The text was updated successfully, but these errors were encountered: