-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
219 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
data-pipeline/src/data_pipeline/pipelines/gnomad_v4_coverage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# from loguru import logger | ||
import os | ||
import pytest | ||
import tempfile | ||
|
||
from data_pipeline.config import ComputeEnvironment, DataEnvironment, DataPaths, PipelineConfig | ||
|
||
# from data_pipeline.pipeline import Pipeline | ||
|
||
|
||
@pytest.fixture | ||
def input_tmp(): | ||
with tempfile.TemporaryDirectory() as temp_dir: | ||
with open(os.path.join(temp_dir, "sample_tiny.txt"), "w") as f: | ||
f.write("tiny dataset") | ||
with open(os.path.join(temp_dir, "sample_full.txt"), "w") as f: | ||
f.write("full dataset") | ||
yield temp_dir | ||
|
||
|
||
@pytest.fixture | ||
def output_tmp(): | ||
with tempfile.TemporaryDirectory() as temp_dir: | ||
yield temp_dir | ||
|
||
|
||
@pytest.mark.only | ||
def test_config_created(input_tmp, output_tmp): | ||
config = PipelineConfig.create(name="test", input_root=input_tmp, output_root=output_tmp) | ||
assert isinstance(config, PipelineConfig) | ||
assert isinstance(config.input_paths, DataPaths) | ||
assert isinstance(config.output_paths, DataPaths) | ||
assert isinstance(config.compute_env, ComputeEnvironment) | ||
assert isinstance(config.data_env, DataEnvironment) | ||
|
||
|
||
@pytest.mark.only | ||
def test_config_read_input_file(input_tmp, output_tmp): | ||
config = PipelineConfig.create( | ||
name="test", | ||
input_root=input_tmp, | ||
output_root=output_tmp, | ||
) | ||
sample = os.path.join(config.input_paths.root, "sample_tiny.txt") | ||
with open(sample, "r") as f: | ||
assert f.read() == "tiny dataset" | ||
|
||
|
||
# @pytest.mark.only | ||
# def test_pipeline_tasks(ht_1_fixture: TestHt, ht_2_fixture: TestHt): | ||
# def task_1_fn(): | ||
# pass | ||
|
||
# pipeline = Pipeline("p1") | ||
|
||
# pipeline.add_task( | ||
# name="task_1_join_hts", | ||
# task_function=task_1_fn, | ||
# output_path="/gnomad_v4/gnomad_v4_exome_variants_base.ht", | ||
# inputs={ | ||
# "input_ht_1": ht_1_fixture.path, | ||
# }, | ||
# ) |
Oops, something went wrong.