Skip to content

Commit 17be699

Browse files
Merge pull request #30 from CompEpigen/dev
Dev
2 parents 6721477 + 3f8bb07 commit 17be699

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

cwlab/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
from __future__ import absolute_import
33

4-
__version__ = "0.3.0"
4+
__version__ = "0.3.1"
55

66
import os
77
from flask import Flask

cwlab/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def import_wf(
430430
wf_type = get_workflow_type_from_file_ext(wf_path)
431431
else:
432432
assert wf_type in supported_workflow_types, "Provided workflow type \"{wf_type}\" is not supported."
433-
if name is None:
433+
if name is None or name == "":
434434
name = os.path.splitext(os.path.basename(wf_path))[0]
435435
if os.path.splitext(name)[1] in supported_workflow_exts[wf_type]:
436436
name = os.path.splitext(name)[0]

cwlab/wf_input/make_runs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import sys
55
import re
66
from .read_wf import supported_workflow_exts
7+
from copy import copy
78

89
supported_workflow_types = supported_workflow_exts.keys()
910

@@ -18,9 +19,10 @@ def make_CWL_File_or_Directory(path, is_dir=False, secondary_files=[""]):
1819
if sec_ext[0] == "^":
1920
capture_sec_ext = re.search('^(\^+)(.*)', sec_ext)
2021
n_exts_to_rm = len(capture_sec_ext.group(1))
22+
value_root = copy(path)
2123
for idx in range(0,n_exts_to_rm):
22-
value_root = os.path.splitext(path)[0]
23-
sec_file_item_path = path + capture_sec_ext.group(2)
24+
value_root = os.path.splitext(value_root)[0]
25+
sec_file_item_path =value_root + capture_sec_ext.group(2)
2426
else:
2527
sec_file_item_path = path + sec_ext
2628
cwl_sec_file_array.append( {"class": "File", "path": sec_file_item_path } )

cwlab/wf_input/match_types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import fnmatch
33
import sys
44
import re
5+
from copy import copy
56

67
def path_exists(path_str, is_dir=False):
78
if is_dir:
@@ -61,7 +62,7 @@ def class_file(value_string, secondary_files, validate_paths=True, search_paths=
6162
if sec_ext[0] == "^":
6263
capture_sec_ext = re.search('^(\^+)(.*)', sec_ext)
6364
n_exts_to_rm = len(capture_sec_ext.group(1))
64-
value_root = path
65+
value_root = copy(path)
6566
for idx in range(0,n_exts_to_rm):
6667
value_root = os.path.splitext(value_root)[0]
6768
sec_file_item_path =value_root + capture_sec_ext.group(2)

cwlab/wf_input/read_cwl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys, os
22
from .read_xls import clean_string
3+
from ruamel.yaml.comments import CommentedMap, CommentedSeq
34

45
def is_basic_type_instance(value):
56
return (isinstance(value, int) or
@@ -113,6 +114,15 @@ def read_config_from_cwl_file(cwl_file):
113114
if type_ == "File" and "secondaryFiles" in inp_rec:
114115
if isinstance(inp_rec["secondaryFiles"], str):
115116
secondary_files = [ inp_rec["secondaryFiles"] ]
117+
elif isinstance(inp_rec["secondaryFiles"], CommentedMap) and \
118+
"pattern" in inp_rec["secondaryFiles"].keys():
119+
secondary_files = [ inp_rec["secondaryFiles"]["pattern"] ]
120+
elif isinstance(inp_rec["secondaryFiles"], CommentedSeq):
121+
secondary_files = []
122+
for sec_file in inp_rec["secondaryFiles"]:
123+
assert isinstance(sec_file, CommentedMap) and "pattern" in sec_file, \
124+
print_pref + "E: invalid secondaryFiles field for parameter " + name
125+
secondary_files.append(sec_file["pattern"])
116126
elif isinstance(inp_rec["secondaryFiles"], list):
117127
secondary_files = inp_rec["secondaryFiles"]
118128
else:

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='cwlab',
10-
version='0.3.0',
10+
version='0.3.1',
1111
description='A platform-agnostic, cloud-ready framework for simplified deployment of the Common Workflow Language using a graphical web interface',
1212
long_description=open(README).read(),
1313
long_description_content_type="text/x-rst",
@@ -35,9 +35,9 @@
3535
'pyexcel-xlsx',
3636
'PyYAML',
3737
'pexpect',
38-
'janis-pipelines>=0.7.0'
38+
'janis-pipelines>=0.7.0',
3939
'cwltool==1.0.20181201184214; platform_system=="Windows"',
40-
'cwltool>=1.0.20180809224403; platform_system!="Windows"',
40+
'cwltool >=1.0.20180809224403, <=1.0.20191022103248; platform_system!="Windows"',
4141
'psutil',
4242
'miniwdl>=0.0.5'
4343
],

0 commit comments

Comments
 (0)