-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from monarch-initiative/extract-targz
Add "file_archive" attribute for SourceConfig
- Loading branch information
Showing
14 changed files
with
103 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
koza-env/ | ||
tests/resources/source-files/string.tsv* | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
"""Koza, an ETL framework for LinkML data models""" | ||
__version__ = '0.1.10' | ||
__version__ = '0.1.11' |
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
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,23 @@ | ||
import os, yaml | ||
from pathlib import Path | ||
|
||
from koza.model.config.source_config import PrimaryFileConfig | ||
from koza.io.yaml_loader import UniqueIncludeLoader | ||
|
||
def test_archive_targz(): | ||
source = Path('tests/resources/string.yaml') | ||
unzipped_data = Path('tests/resources/source-files/string.tsv.gz') | ||
# Delete unzipped archive if it exists | ||
if os.path.exists(unzipped_data.absolute()): | ||
os.remove(unzipped_data.absolute()) | ||
|
||
# Create a SourceConfig object with test config | ||
with open(source.absolute(), 'r') as src: | ||
source_config = PrimaryFileConfig(**yaml.load(src, Loader=UniqueIncludeLoader)) | ||
|
||
# This method only happens after validation - force it now | ||
source_config.__post_init_post_parse__() | ||
|
||
assert os.path.exists(unzipped_data) | ||
|
||
#test_archive_targz() |
Binary file not shown.
Binary file not shown.
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,45 @@ | ||
name: 'zfin_phenotype_0' | ||
|
||
format: 'csv' | ||
|
||
delimiter: '\t' | ||
|
||
#header_delimiter: '\t' | ||
|
||
file_archive: 'tests/resources/source-files/string.tar.gz' | ||
|
||
files: | ||
- 'string.tsv' | ||
|
||
global_table: 'tests/resources/translation_table.yaml' | ||
|
||
columns: | ||
- 'protein1' | ||
- 'protein2' | ||
- 'neighborhood' | ||
- 'fusion' | ||
- 'cooccurence' | ||
- 'coexpression' | ||
- 'experimental' | ||
- 'database' | ||
- 'textmining' | ||
- 'combined_score' : 'int' | ||
|
||
filters: | ||
- column: 'combined_score' | ||
inclusion: 'include' | ||
filter_code: 'lt' | ||
value: 700 | ||
|
||
#transform_code: './examples/string/protein-links-detailed.py' | ||
|
||
#transform_mode: 'loop' | ||
|
||
edge_properties: | ||
- 'id' | ||
- 'subject' | ||
- 'predicate' | ||
- 'object' | ||
- 'category' | ||
- 'relation' | ||
- 'provided_by' |
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