summaryrefslogtreecommitdiffstats
path: root/src/act4e_solutions
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2023-11-18 11:33:06 +0100
committerNao Pross <np@0hm.ch>2023-11-18 11:33:06 +0100
commitf04d6d2e90e962552de80a4e7b5a45e9f4080c71 (patch)
tree377e8054c6f9097ca64d916cc3f5b4872c0775eb /src/act4e_solutions
parentMerge remote-tracking branch 'template/alphubel-prod' into alphubel-prod (diff)
downloadact4e-f04d6d2e90e962552de80a4e7b5a45e9f4080c71.tar.gz
act4e-f04d6d2e90e962552de80a4e7b5a45e9f4080c71.zip
Fix semicategory loading
Diffstat (limited to 'src/act4e_solutions')
-rw-r--r--src/act4e_solutions/semicategory_representation.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/act4e_solutions/semicategory_representation.py b/src/act4e_solutions/semicategory_representation.py
index 4ab9909..dd82485 100644
--- a/src/act4e_solutions/semicategory_representation.py
+++ b/src/act4e_solutions/semicategory_representation.py
@@ -107,8 +107,9 @@ class MySemiCategory(Generic[OD, MD], I.SemiCategory[ROD, RMD]):
return MyFiniteSet(morphisms)
def compose(self, ob1: ROD, ob2: ROD, ob3: ROD, m1: RMD, m2: RMD) -> RMD:
- m3 = self._composition(ob1.obdata, ob2.obdata, ob3.obdata, m1.mordata, m2.mordata)
- return I.RichMorphism(";".join((m1.label, m2.label)), m3)
+ m3data = self._composition(ob1.obdata, ob2.obdata, ob3.obdata, m1.mordata, m2.mordata)
+ m3 = I.RichMorphism(";".join((m1.label, m2.label)), m3data)
+ return m3
def identity(self, ob: ROD) -> RMD:
if not self._objects[ob.label]:
@@ -142,10 +143,10 @@ class SolSemiCategoryRepresentation(I.SemiCategoryRepresentation):
raise I.InvalidFormat()
if "identity" in ob.keys() and ob["identity"]:
- identity = I.RichMorphism(f"id_{obname}", ob["identity"]["mordata"])
+ identity = I.RichMorphism(f"id_{obname}", MorData.load(h, ob["identity"]["mordata"]))
sc.add_morphism(obname, obname, identity)
- sc.add_object(I.RichObject(obname, ob["obdata"]))
+ sc.add_object(I.RichObject(obname, ObData.load(h, ob["obdata"])))
# Get the morphisms
for morname, mor in data["morphisms"].items():
@@ -153,6 +154,7 @@ class SolSemiCategoryRepresentation(I.SemiCategoryRepresentation):
raise I.InvalidFormat()
src, tar = mor["source"], mor["target"]
- sc.add_morphism(mor["source"], mor["target"], I.RichMorphism(morname, mor["mordata"]))
+ morphism = I.RichMorphism(morname, MorData.load(h, mor["mordata"]))
+ sc.add_morphism(mor["source"], mor["target"], morphism)
return sc