Commits

Juan BC  committed 2798468

added support for load yyf format

  • Participants
  • Parent commits 586a6d0

Comments (0)

Files changed (3)

File data/example.yyf

+# this is an example of Yatel Yaml Format or YYF
+
+haplotypes:
+    - hap_id: hap0
+      a: 1
+      b: 2
+      c: 3
+    - hap_id: hap1
+      b: "hola"
+      c: "chau"
+
+facts:
+    - hap_id: hap0
+      x: 1
+      y: 2
+    - hap_id: hap1
+      z: 1
+
+edges:
+    - weight: 10
+      haps_id:
+          - hap0
+          - hap1
+    - weight: 30
+      haps_id:
+          - hap0
+          - hap 1
     "pyzmq",
     "ipython>=0.13",
     "pilas>=0.7",
+    "PyYAML",
 ]
 
 MANUAL_REQUIRE = {

File yatel/dom.py

         self._hap_id = hap_id
         self._attrs = attrs
 
+    def __repr__(self):
+        """x.__repr__() <==> repr(x)"""
+        return "<{0} for '{1}' at {2}>".format(self.__class__.__name__,
+                                                 self._hap_id, hex(id(self)))
+
     def __eq__(self, obj):
         """x.__eq__(y) <==> x==y"""
         return obj is not None \
         self._weight = float(weight)
         self._haps_id = haps_id
 
+    def __repr__(self):
+        """x.__repr__() <==> repr(x)"""
+        return "<{0} '{1} {2}' at {3}>".format(self.__class__.__name__,
+                                                 str(self._haps_id),
+                                                 self._weight,
+                                                 hex(id(self)))
+
     def __eq__(self, obj):
         """x.__eq__(y) <==> x==y"""
         return obj is not None \