コード例 #1
0
ファイル: curation.py プロジェクト: fossabot/cellfinder
def save_yaml_file(output_directory):
    yaml_filename = output_directory / "training.yml"
    yaml_section = [
        {
            "cube_dir": str(output_directory / "cells"),
            "cell_def": "",
            "type": "cell",
            "signal_channel": 0,
            "bg_channel": 1,
        },
        {
            "cube_dir": str(output_directory / "non_cells"),
            "cell_def": "",
            "type": "no_cell",
            "signal_channel": 0,
            "bg_channel": 1,
        },
    ]

    yaml_contents = {"data": yaml_section}
    save_yaml(yaml_contents, yaml_filename)
コード例 #2
0
ファイル: test_yaml_io.py プロジェクト: vigji/imlib
def test_save_yaml(tmpdir):
    test_yaml_path = Path(tmpdir) / "test.yml"
    yaml.save_yaml(yaml_contents, test_yaml_path)
    test_yaml = yaml.open_yaml(test_yaml_path)
    saved_yaml = yaml.open_yaml(yaml_file)
    assert test_yaml == saved_yaml