Beispiel #1
0
 def to_dict(self) -> dict:
     """
     We use the recursive conversion only if alignments are present, since it may
     potentially be slower due to type checking of member objects.
     """
     return asdict_nonull(
         self) if self.alignment is None else asdict_nonull_recursive(self)
Beispiel #2
0
 def to_dict(self) -> dict:
     return asdict_nonull(self)
Beispiel #3
0
 def to_dicts(self) -> List[dict]:
     return [asdict_nonull(s) for s in self]
Beispiel #4
0
 def to_yaml(self, path: Pathlike):
     data = [asdict_nonull(s) for s in self]
     save_to_yaml(data, path)
Beispiel #5
0
 def to_yaml(self, path: Pathlike):
     data = [{
         **asdict_nonull(cut), 'type': type(cut).__name__
     } for cut in self]
     save_to_yaml(data, path)
Beispiel #6
0
 def to_dict(self) -> Dict[str, Any]:
     return asdict_nonull(self)