Skip to content

Commit 6e3a60c

Browse files
committed
Don't allow a ga kwarg to be passed and ignored
Previously, `sm`, `lt`, and `mv` would all ignore a `ga` kwarg if passed. Now it is an error to pass the argument. The code is simpler too.
1 parent 44d1b79 commit 6e3a60c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

galgebra/ga.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ def mv(self, root=None, *args, **kwargs):
524524
if root is None: # Return ga basis and compute grad and rgrad
525525
return self.mv_basis
526526

527-
kwargs['ga'] = self
527+
# ensure that ga is not already in kwargs
528+
kwargs = dict(ga=self, **kwargs)
528529

529530
if not utils.isstr(root):
530531
return mv.Mv(root, *args, **kwargs)
@@ -630,17 +631,14 @@ def lt(self, *args, **kwargs):
630631
self._lt_flg = True
631632
(self.lt_coords, self.lt_x) = lt.Lt.setup(ga=self)
632633

633-
kwargs['ga'] = self
634-
return lt.Lt(*args, **kwargs)
634+
return lt.Lt(*args, ga=self, **kwargs)
635635

636636
def sm(self, *args, **kwargs):
637637
"""
638638
Instanciate and return a submanifold for this
639639
geometric algebra. See :class:`Sm` for instantiation inputs.
640640
"""
641-
kwargs['ga'] = self
642-
SM = Sm(*args, **kwargs)
643-
return SM
641+
return Sm(*args, ga=self, **kwargs)
644642

645643
def parametric(self, coords):
646644
if not isinstance(coords, list):

0 commit comments

Comments
 (0)