コード例 #1
0
def test_yaml_save_load_roundtrip(extension):
    data = {'some': ['data']}
    with NamedTemporaryFile() as f:
        path = Path(f.name).with_suffix(extension)
        save_to_yaml(data, path)
        f.flush()
        data_deserialized = load_yaml(path)
    assert data == data_deserialized
コード例 #2
0
ファイル: features.py プロジェクト: popcornell/lhotse
 def to_yaml(self, path: Pathlike):
     save_to_yaml(asdict(self), path)
コード例 #3
0
 def to_yaml(self, path: Pathlike):
     data = asdict(self.config)
     data['feature_type'] = self.name  # Insert the typename for config readability
     save_to_yaml(data, path=path)
コード例 #4
0
 def to_yaml(self, path: Pathlike):
     data = [asdict(r) for r in self]
     save_to_yaml(data, path)
コード例 #5
0
 def to_yaml(self, path: Pathlike):
     data = [asdict_nonull(s) for s in self]
     save_to_yaml(data, path)
コード例 #6
0
ファイル: cut.py プロジェクト: popcornell/lhotse
 def to_yaml(self, path: Pathlike):
     data = [{
         **asdict_nonull(cut), 'type': type(cut).__name__
     } for cut in self]
     save_to_yaml(data, path)