Skip to content

Commit

Permalink
use local file for now; will still fail because of test-setup with mo…
Browse files Browse the repository at this point in the history
…ck/fakefs etc
  • Loading branch information
tedil committed Mar 27, 2024
1 parent 4d7dbd2 commit ec93a52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 3 additions & 6 deletions snappy_pipeline/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,9 @@ def expand_ref(config_path, dict_data, lookup_paths=None, dict_class=OrderedDict
return resolved, tuple(lookup_paths), tuple(config_files)


def validate_config(config: dict[Any, Any], workflow: str, file=sys.stderr):
print(f"\nValidating config.yaml for {workflow}", file=file)
config_schema_path = os.path.join(
os.path.dirname(snakefile_path(workflow)), "config.schema.yaml"
)
validate(config, config_schema_path)
def validate_config(config: dict[Any, Any], schema_path: str, file=sys.stderr):
print(f"\nValidating config.yaml using {schema_path}", file=file)
validate(config, schema_path)


def print_config(config, file=sys.stderr):
Expand Down
3 changes: 2 additions & 1 deletion snappy_pipeline/workflows/adapter_trimming/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ def __init__(self, parent):
super().__init__(parent)
self.base_path_in = "work/input_links/{library_name}"
self.base_path_out = "work/{trimmer}.{{library_name}}"
validate_config({"adapter_trimming": self.config}, "adapter_trimming")
schema_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "config.schema.yaml"))
validate_config({"adapter_trimming": self.config}, schema_path)
#: Path generator for linking in
self.path_gen = LinkInPathGenerator(
self.parent.work_dir,
Expand Down

0 comments on commit ec93a52

Please sign in to comment.