diff options
author | Nao Pross <np@0hm.ch> | 2023-11-05 14:03:14 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2023-11-05 14:03:14 +0100 |
commit | 06b717ae03432e48511961df416af37153a7bb07 (patch) | |
tree | 23b13e239a0667d2d1f061e1ea6fd2bd315b1fc0 /src | |
parent | Pass TestFiniteMonotoneMapProperties (diff) | |
download | act4e-06b717ae03432e48511961df416af37153a7bb07.tar.gz act4e-06b717ae03432e48511961df416af37153a7bb07.zip |
Pass TestFinitePosetConstructionProduct
Diffstat (limited to 'src')
-rw-r--r-- | src/act4e_solutions/posets_product.py | 1 | ||||
-rw-r--r-- | src/act4e_solutions/posets_representation.py | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/act4e_solutions/posets_product.py b/src/act4e_solutions/posets_product.py index 214a13a..3dc1bde 100644 --- a/src/act4e_solutions/posets_product.py +++ b/src/act4e_solutions/posets_product.py @@ -28,7 +28,6 @@ class MyFinitePosetProduct(I.FinitePosetProduct[C, E]): def holds(self, a: E, b: E) -> bool: a = self._carrier.unpack(a) b = self._carrier.unpack(b) - print(list(map(lambda p: p.carrier().elements(), self._posets)), a, b) # For all elements in both tuples, each element must be comparable with # the element with the same index in the other tuple. If one is not diff --git a/src/act4e_solutions/posets_representation.py b/src/act4e_solutions/posets_representation.py index 9adc22e..99fafdb 100644 --- a/src/act4e_solutions/posets_representation.py +++ b/src/act4e_solutions/posets_representation.py @@ -6,6 +6,7 @@ from pprint import pprint import numpy as np from .sets_representation import SolFiniteSetRepresentation +from .posets_product import MyFinitePosetProduct import act4e_interfaces as I @@ -118,7 +119,11 @@ class MyFinitePoset(I.FinitePoset[X]): class SolFinitePosetRepresentation(I.FinitePosetRepresentation): def load(self, h: I.IOHelper, s: I.FinitePoset_desc) -> I.FinitePoset[Any]: if "poset_product" in s.keys(): - raise NotImplementedError + posets = [] + for p in s["poset_product"]: + posets.append(self.load(h, p)) + + return MyFinitePosetProduct(posets) if "poset_sum" in s.keys(): raise NotImplementedError |