From 1cdc6f6bf992dc522ff144b1e624c9e92c95c0b9 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Feb 2021 09:02:43 -0500 Subject: [PATCH] eja: fix element constructor error message for Cartesian products. --- mjo/eja/eja_algebra.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 0653396..7fb8027 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -3157,8 +3157,11 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct, e(0, 1) + e(1, 2) """ m = len(self.cartesian_factors()) - z = tuple( self.cartesian_factors()[i](elt[i]) for i in range(m) ) - return self._cartesian_product_of_elements(z) + try: + z = tuple( self.cartesian_factors()[i](elt[i]) for i in range(m) ) + return self._cartesian_product_of_elements(z) + except: + raise ValueError("not an element of this algebra") Element = FiniteDimensionalEJAElement -- 2.44.2