Skip to content

Commit

Permalink
Handle scratch_directory as None as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Grande committed Jun 25, 2020
1 parent 8931548 commit 2c251b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions oncopipe/oncopipe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ def setup_subdirs(module_config, subdirectories, scratch_subdirs=()):
)

# If `scratch_directory` is None, then don't worry about `scratch_subdirs`
scratch_directory = module_config.get("scratch_directory", "")
scratch_directory = module_config.get("scratch_directory")
if scratch_directory is None:
scratch_subdirs = ()

Expand All @@ -1626,11 +1626,11 @@ def setup_subdirs(module_config, subdirectories, scratch_subdirs=()):
name = module_config["name"]
version = module_config["version"]
parent_dir = module_config["dirs"]["_parent"]
scratch_parent_dir = os.path.join(scratch_directory, f"{name}-{version}")
for num, subdir in zip(numbers, subdirectories):
subdir_full = os.path.join(parent_dir, f"{num}-{subdir}/")
module_config["dirs"][subdir] = subdir_full
if subdir in scratch_subdirs:
scratch_parent_dir = os.path.join(scratch_directory, f"{name}-{version}")
scratch_subdir_full = os.path.join(scratch_parent_dir, f"{num}-{subdir}/")
os.makedirs(scratch_subdir_full, exist_ok=True)
relative_symlink(scratch_subdir_full, subdir_full, overwrite=False)
Expand Down
2 changes: 1 addition & 1 deletion oncopipe/oncopipe/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

__title__ = "oncopipe"
__description__ = "Functions for running Snakemake modules"
__version__ = "1.0.4"
__version__ = "1.0.5"
__author__ = "Bruno Grande"
__author_email__ = "[email protected]"
__license__ = "MIT"
Expand Down

0 comments on commit 2c251b5

Please sign in to comment.