Skip to content

Commit

Permalink
upgrading github action to clear error message
Browse files Browse the repository at this point in the history
  • Loading branch information
proccaserra committed Oct 23, 2023
1 parent a2a5a98 commit b265303
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/buildandtestpython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
python-version: [3.8, 3.9, '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Download Test Data
Expand Down
24 changes: 15 additions & 9 deletions isatools/isatab/dump/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ def flatten(current_list):
log.warning(s_graph.nodes())

sample_in_path_count = 0
protocol_in_path_count = 0
longest_path = _longest_path_and_attrs(paths, s_graph.indexes)

for node_index in longest_path:
node = s_graph.indexes[node_index]
if isinstance(node, Source):
Expand All @@ -76,8 +77,9 @@ def flatten(current_list):
map(lambda x: get_comment_column(
olabel, x), node.comments))
elif isinstance(node, Process):
olabel = "Protocol REF.{}".format(node.executes_protocol.name)
olabel = "Protocol REF.{}".format(protocol_in_path_count)
columns.append(olabel)
protocol_in_path_count += 1
if node.executes_protocol.name not in protnames.keys():
protnames[node.executes_protocol.name] = protrefcount
protrefcount += 1
Expand All @@ -104,6 +106,7 @@ def flatten(current_list):
columns += flatten(map(lambda x: get_fv_columns(olabel, x),
node.factor_values))


omap = get_object_column_map(columns, columns)
# load into dictionary
df_dict = dict(map(lambda k: (k, []), flatten(omap)))
Expand All @@ -113,6 +116,7 @@ def flatten(current_list):
df_dict[k].extend([""])

sample_in_path_count = 0
protocol_in_path_count = 0
for node_index in path_:
node = s_graph.indexes[node_index]
if isinstance(node, Source):
Expand All @@ -129,8 +133,8 @@ def flatten(current_list):
df_dict[colabel][-1] = co.value

elif isinstance(node, Process):
olabel = "Protocol REF.{}".format(
node.executes_protocol.name)
olabel = "Protocol REF.{}".format(protocol_in_path_count)
protocol_in_path_count += 1
df_dict[olabel][-1] = node.executes_protocol.name
for pv in node.parameter_values:
pvlabel = "{0}.Parameter Value[{1}]".format(
Expand Down Expand Up @@ -263,6 +267,8 @@ def flatten(current_list):
if _longest_path_and_attrs(paths, a_graph.indexes) is None:
raise IOError(
"Could not find any valid end-to-end paths in assay graph")

protocol_in_path_count = 0
for node_index in _longest_path_and_attrs(paths, a_graph.indexes):
node = a_graph.indexes[node_index]
if isinstance(node, Sample):
Expand All @@ -279,9 +285,9 @@ def flatten(current_list):
node.factor_values))

elif isinstance(node, Process):
olabel = "Protocol REF.{}".format(
node.executes_protocol.name)
olabel = "Protocol REF.{}".format(protocol_in_path_count)
columns.append(olabel)
protocol_in_path_count += 1
if node.executes_protocol.name not in protnames.keys():
protnames[node.executes_protocol.name] = protrefcount
protrefcount += 1
Expand Down Expand Up @@ -338,12 +344,12 @@ def pbar(x):
for k in df_dict.keys(): # add a row per path
df_dict[k].extend([""])

protocol_in_path_count = 0
for node_index in path_:
node = a_graph.indexes[node_index]
if isinstance(node, Process):
olabel = "Protocol REF.{}".format(
node.executes_protocol.name
)
olabel = "Protocol REF.{}".format(protocol_in_path_count)
protocol_in_path_count += 1
df_dict[olabel][-1] = node.executes_protocol.name
if node.executes_protocol.protocol_type:
oname_label = get_column_header(
Expand Down

0 comments on commit b265303

Please sign in to comment.