Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scottx611x/derived node attributes bugfix #2076

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6ae7f20
Merge remote-tracking branch 'origin/scottx611x/associate_workflow_ou…
scottx611x Aug 29, 2017
2c787b5
Update Galaxy mock data
scottx611x Aug 29, 2017
e556752
Fix `help`
scottx611x Aug 29, 2017
c70cf48
Add constants
scottx611x Aug 29, 2017
33f4f84
Dynamically create analysis group numbers based on the structure of o…
scottx611x Aug 29, 2017
589a3db
Fix docstring
scottx611x Aug 29, 2017
c652e2f
Use temp var for easier readability
scottx611x Aug 29, 2017
b7c43ae
Add mechanism to derive which Refinery file a workflow output was der…
scottx611x Aug 29, 2017
5932769
Fix tests
scottx611x Aug 29, 2017
25a1b08
Fix typo
scottx611x Aug 29, 2017
d20e3c6
Add docstrings
scottx611x Aug 30, 2017
c6751fb
Don't overuse `@property`. Make method private
scottx611x Aug 30, 2017
08a6dbd
Remove statements from debugging
scottx611x Aug 30, 2017
cab9eab
Change to default value
scottx611x Aug 30, 2017
556fbe7
Fix styling
scottx611x Aug 30, 2017
87e1190
Remove comment stating the obvious
scottx611x Aug 30, 2017
bbfeab9
Flip if/else logic to be more clear
scottx611x Aug 30, 2017
e13f35d
Add constant
scottx611x Aug 30, 2017
2e3c546
Add test coverage for `Workflowtool._has_dataset_collection_input()`
scottx611x Aug 30, 2017
1b3b9c2
Fix typo
scottx611x Aug 30, 2017
7fe2e2b
Add logic to determine analysis group numbering, and test coverage
scottx611x Aug 30, 2017
8d4ecf2
Fix spelling
scottx611x Aug 30, 2017
4445fe9
Add tests coverage for an edge case in the recursive calls to `Workfl…
scottx611x Aug 30, 2017
63d0bb4
Fix bug where incorrect AnnotatedNode information was being indexed i…
scottx611x Aug 31, 2017
5d9b4d0
Add test coverage for `_get_analysis_group_number`
scottx611x Aug 31, 2017
f2d58af
Simplify logic
scottx611x Sep 1, 2017
9fd4ebb
Tidy mock glaxy data
scottx611x Sep 1, 2017
d81ba97
DRY: condense repeated calls in tests
scottx611x Sep 1, 2017
8d8f94e
Fix tests
scottx611x Sep 1, 2017
8b3d582
Merge remote-tracking branch 'origin/scottx611x/analysis_groups' into…
scottx611x Sep 1, 2017
7728c3c
Address issue while creating expanded workflow graph where Dataset Co…
scottx611x Sep 5, 2017
d9949ba
Update AnalysisNodeConnection input creation and update tests
scottx611x Sep 5, 2017
6be5f9d
Assert that we assign the correct name to input AnalysisNodeConnections
scottx611x Sep 5, 2017
4cc389c
Merge remote-tracking branch 'origin/scottx611x/associate_workflow_ou…
scottx611x Sep 5, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions refinery/galaxy_connector/galaxy_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import networkx as nx

from core.utils import get_aware_local_time
import tool_manager

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -529,6 +530,11 @@ def configure_workflow(workflow_dict, ret_list):
def create_expanded_workflow_graph(dictionary):
graph = nx.MultiDiGraph()
steps = dictionary["steps"]
galaxy_input_types = [
'data_input',
tool_manager.models.WorkflowTool.DATA_COLLECTION_INPUT
]

# iterate over steps to create nodes
for current_node_id, step in steps.iteritems():
# ensure node id is an integer
Expand All @@ -553,9 +559,10 @@ def create_expanded_workflow_graph(dictionary):
parent_node_id = input_connection["id"]
# test if parent node is a tool node or an input node to pick the
# right name for the outgoing edge
if graph.node[parent_node_id]['type'] == 'data_input':
parent_node_output_name = \
if graph.node[parent_node_id]['type'] in galaxy_input_types:
parent_node_output_name = (
steps[str(parent_node_id)]['inputs'][0]['name']
)
else:
parent_node_output_name = input_connection['output_name']

Expand Down
5 changes: 3 additions & 2 deletions refinery/tool_manager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ class WorkflowTool(Tool):
GALAXY_WORKFLOW_INVOCATION_DATA = "galaxy_workflow_invocation_data"
GALAXY_TO_REFINERY_MAPPING_LIST = "galaxy_to_refinery_mapping_list"
HISTORY_DATASET_COLLECTION_ASSOCIATION = "hdca"
INPUT_DATASET_COLLECTION = "Input Dataset Collection"
LIST = "list"
PAIRED = "paired"
REVERSE = "reverse"
Expand Down Expand Up @@ -581,9 +582,9 @@ def create_analysis_input_node_connections(self):
analysis=self.analysis,
node=node,
direction=INPUT_CONNECTION,
name=node.name,
name=file_store_item.datafile.name,
step=0,
filename=file_store_item.datafile.name,
filename=self.INPUT_DATASET_COLLECTION,
is_refinery_file=file_store_item.is_local()
)

Expand Down
12 changes: 12 additions & 0 deletions refinery/tool_manager/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1429,10 +1429,22 @@ def test_analysis_node_connections_are_created_for_all_input_nodes(self):
]
self.assertEqual(len(analysis_node_connections), len(tool_nodes))
for analysis_node_connection in analysis_node_connections:
file_store_item = (
analysis_node_connection.node.get_file_store_item()
)
self.assertEqual(
analysis_node_connection.direction,
INPUT_CONNECTION
)
self.assertEqual(
analysis_node_connection.filename,
WorkflowTool.INPUT_DATASET_COLLECTION
)
self.assertEqual(analysis_node_connection.step, 0)
self.assertEqual(
analysis_node_connection.name,
file_store_item.datafile.name
)

def test_galaxy_parameter_dict_creation(self):
self.create_valid_tool(
Expand Down