Skip to content

Commit 44d1b79

Browse files
committed
Fix the alias operator constructors on Ga objects
Previously: * `Ga.pdop` was unusable, since it would call `Pdop.__init__` with a `tuple`, but that function expects a `Symbol` or `Dict` * `Ga.sdop` was not callable with one argument, since it would pass on an unwanted `None` argument to `pdiffs` Also groups these functions to be adjacent, for clarity
1 parent d4fe3db commit 44d1b79

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

galgebra/ga.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,6 @@ def mv_x(self):
516516
def X(self):
517517
return self.mv(sum([coord*base for (coord, base) in zip(self.coords, self.basis)]))
518518

519-
def sdop(self, coefs, pdiffs=None):
520-
return mv.Sdop(coefs, pdiffs, ga=self)
521-
522519
def mv(self, root=None, *args, **kwargs):
523520
"""
524521
Instanciate and return a multivector for this, 'self',
@@ -612,13 +609,17 @@ def grads(self):
612609
raise ValueError("Ga must have been initialized with coords to compute grads")
613610
return self.grad, self.rgrad
614611

612+
def pdop(self, *args, **kwargs):
613+
""" Shorthand to construct a :class:`~galgebra.mv.Pdop` for this algebra """
614+
return mv.Pdop(*args, ga=self, **kwargs)
615+
615616
def dop(self, *args, **kwargs):
616-
"""
617-
Instanciate and return a multivector differential operator for
618-
this, 'self', geometric algebra.
619-
"""
620-
kwargs['ga'] = self
621-
return mv.Dop(*args, **kwargs)
617+
""" Shorthand to construct a :class:`~galgebra.mv.Dop` for this algebra """
618+
return mv.Dop(*args, ga=self, **kwargs)
619+
620+
def sdop(self, *args, **kwargs):
621+
""" Shorthand to construct a :class:`~galgebra.mv.Sdop` for this algebra """
622+
return mv.Sdop(*args, ga=self, **kwargs)
622623

623624
def lt(self, *args, **kwargs):
624625
"""
@@ -1710,9 +1711,6 @@ def blade_derivation(self, blade, ib):
17101711
self._dbases[key] = db
17111712
return db
17121713

1713-
def pdop(self,*args):
1714-
return mv.Pdop(args,ga=self)
1715-
17161714
def pDiff(self, A, coord):
17171715
"""
17181716
Compute partial derivative of multivector function 'A' with

0 commit comments

Comments
 (0)