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/fix derived node attribute inheritance #2174
Scottx611x/fix derived node attribute inheritance #2174
Conversation
…erly connected to their parents
…, only create WorkflowFilesDL for asterisked Workflow outputs
Codecov Report
@@ Coverage Diff @@
## release-1.6.0 #2174 +/- ##
=================================================
+ Coverage 46.35% 46.79% +0.43%
=================================================
Files 412 412
Lines 27977 28200 +223
Branches 1312 1312
=================================================
+ Hits 12970 13196 +226
+ Misses 15007 15004 -3
Continue to review full report at Codecov.
|
…`, and `_get_workflow_step`
…put_name`, and `_get_workflow_step`" This reverts commit 61cd954.
…ce_chain still needs stronger assertions)
refinery/core/models.py
Outdated
) | ||
if graph[edge[0]][edge[1]]['output_id'] == output_id: | ||
output_node_id = edge[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: This is where things were flip-flopped before
This code wasn't broken, just difficult to debug since the naming didn't properly reflect what was happening.
output_node_id
was really the input_node_id
etc.
@@ -563,7 +563,6 @@ def _add_annotated_nodes( | |||
|
|||
if len(bulk_list) > 0: | |||
AnnotatedNode.objects.bulk_create(bulk_list) | |||
bulk_list = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was dead code
@@ -1609,15 +1609,21 @@ def rename_results(self): | |||
if item.get_filetype() == zipfile: | |||
new_file_name = ''.join([root, '.zip']) | |||
renamed_file_store_item_uuid = rename( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename
& rename_datafile
return None
in odd ways. Make an issue for fixing.
- Made: this issue
refinery/core/models.py
Outdated
if (graph[edge[0]][edge[1]]['output_id'] == | ||
str(input_connection.step) + '_' + | ||
input_connection.filename): | ||
input_id = "{}_{}".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Analysis_NodeConnection method for this concatenation pattern: {}_{}
analysis=self, direction=INPUT_CONNECTION)[0].node.assay | ||
analysis=self, | ||
direction=INPUT_CONNECTION | ||
).first().node.assay | ||
# 1. read workflow into graph | ||
graph = create_expanded_workflow_graph( | ||
ast.literal_eval(self.workflow_copy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need literal_eval
??? Yes we do
refinery/core/models.py
Outdated
# get graph edge that corresponds to this output node: | ||
# a. attach output node to source data transformation node | ||
# b. attach output node to target data transformation node | ||
# (if exists) | ||
if len(graph.edges([output_connection.step])) > 0: | ||
for edge in graph.edges_iter([output_connection.step]): | ||
workflow_step = output_connection.step |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workflow_step -> output_connection.step
refinery/core/models.py
Outdated
|
||
# return a sorted list based on the AnalysisNodeConnections step | ||
# attribute | ||
return sorted( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not convinced that it needs to be sorted
it didn't need to be
refinery/tool_manager/models.py
Outdated
for dataset in self._get_galaxy_history_dataset_list(): | ||
creating_job = self._get_galaxy_dataset_job(dataset) | ||
if "upload" not in creating_job["tool_id"]: | ||
workflow_step = self._get_workflow_step(dataset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workflow_step_index ?.. key... workflow_steps_dict
wrap workflow_step_key as str()
refinery/tool_manager/models.py
Outdated
workflow_steps[str(workflow_step)]["workflow_outputs"] | ||
] | ||
if creating_job_output_name in workflow_output_names: | ||
visible_datasets.append(dataset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exposed_datasets?
refinery/tool_manager/models.py
Outdated
if step["job_id"] == galaxy_dataset_dict[self.CREATING_JOB]: | ||
workflow_steps.append(step["order_index"]) | ||
|
||
if not workflow_steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on necessity
refinery/tool_manager/models.py
Outdated
|
||
if not workflow_steps: | ||
workflow_steps.append(0) | ||
|
||
assert len(workflow_steps) == 1, ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this even necessary, why not return in loop?
refinery/tool_manager/models.py
Outdated
""" | ||
creating_job = self._get_galaxy_dataset_job(galaxy_dataset_dict) | ||
creating_job_outputs = creating_job["outputs"] | ||
logger.debug("Dataset: %s", galaxy_dataset_dict) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove loggers
…ction_to_analysis_result_mapping`
output_connection.step, | ||
output_connection.filename | ||
) | ||
output_id = output_connection.get_output_connection_id() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm: I was imagining just one method, get_id
, instead of separate get_output_connection_id
and get_input_connection_id
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, thats less confusing
else: | ||
output_connections_to_analysis_results.append( | ||
(output_connection, None) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there's always an analysis_result from the database.... but maybe it's not really an analysis_result? The if-then could be moved up to where we set it.
|
||
def get_output_connection_id(self): | ||
return "{}_{}".format(self.step, self.name) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oy: I hadn't noticed this discrepancy. Maybe a comment to explain why filename for one and name for the other?
) | ||
analysis_group_number = ( | ||
matching_refinery_to_galaxy_file_mappings[0][self.ANALYSIS_GROUP] | ||
assert len(list(set(analysis_groups))) == 1, ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was necessary after all?
@@ -861,15 +867,54 @@ def get_galaxy_file_relationships(self): | |||
def _get_galaxy_history_dataset_list(self): | |||
""" | |||
Retrieve a list of Galaxy Datasets from the Galaxy History of our | |||
Galaxy Workflow invocation. | |||
Galaxy Workflow invocation all tool outputs in the Galaxy Workflow | |||
editor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm: really not sure what this is trying to say.
# If we reach this point and have no workflow_steps, this means that | ||
# the galaxy dataset in question corresponds to an `upload` or | ||
# `input` step i.e. `0` | ||
return self.INPUT_STEP_NUMBER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure the constant makes this more clear, but it's fine.
Nodes
did not inherit their parent'sAttributes
WorkflowFilesDL
creation to asterisked outputs of a Galaxy Workflow (This is way easier than having an end-user specify outputs they want returned to Refinery by name. They simply have to check the asterisk next to the output files in their Workflow Editor)Tests to write:
is_orphan
_get_exposed_workflow_outputs
_get_creating_job_output_name