Merge branch 'release_19.01' into dev

This commit is contained in:
Nicola Soranzo
2019-04-02 11:02:46 +01:00
5 changed files with 47 additions and 8 deletions
+3 -4
View File
@@ -3521,14 +3521,13 @@ class DatasetCollection(Dictifiable, UsesAnnotations, RepresentById):
self.populated_state = DatasetCollection.populated_states.FAILED
self.populated_state_message = message
def finalize(self):
def finalize(self, collection_type_description):
# All jobs have written out their elements - everything should be populated
# but might not be - check that second case! (TODO)
self.mark_as_populated()
if self.has_subcollections:
# THIS IS WRONG - SHOULD ONLY BE TO THE DEPTH OF THE MAP OVER.
if self.has_subcollections and collection_type_description.has_subcollections():
for element in self.elements:
element.child_collection.finalize()
element.child_collection.finalize(collection_type_description.child_collection_type_description())
@property
def dataset_instances(self):
+3 -1
View File
@@ -314,7 +314,9 @@ class ExecutionTracker(object):
implicit_collection_jobs = implicit_collection.implicit_collection_jobs
implicit_collection_jobs.populated_state = "ok"
trans.sa_session.add(implicit_collection_jobs)
implicit_collection.collection.finalize()
implicit_collection.collection.finalize(
collection_type_description=self.collection_info.structure.collection_type_description
)
trans.sa_session.add(implicit_collection.collection)
trans.sa_session.flush()
+1 -1
View File
@@ -108,7 +108,7 @@ class InputValueWrapper(ToolParameterValueWrapper):
return getattr(self.value, key)
def __int__(self):
return int(str(self))
return int(float(self))
def __float__(self):
return float(str(self))
+35
View File
@@ -1165,6 +1165,41 @@ steps:
assert len(identifiers) == 6
assert "oe1-ie1" in identifiers
@skip_without_tool("collection_paired_test")
def test_workflow_flatten_with_mapped_over_execution(self):
with self.dataset_populator.test_history() as history_id:
self._run_jobs(r"""
class: GalaxyWorkflow
inputs:
input_fastqs: collection
steps:
split_up:
tool_id: collection_split_on_column
in:
input1: input_fastqs
flatten:
tool_id: '__FLATTEN__'
in:
input: split_up/split_output
join_identifier: '-'
test_data:
input_fastqs:
type: list
elements:
- identifier: samp1
content: "0\n1"
""", history_id=history_id)
history = self._get('histories/%s/contents' % history_id).json()
flattened_collection = history[-1]
assert flattened_collection['history_content_type'] == 'dataset_collection'
assert flattened_collection['collection_type'] == 'list'
assert flattened_collection['element_count'] == 2
nested_collection = self.dataset_populator.get_history_collection_details(history_id, hid=3)
assert nested_collection['collection_type'] == 'list:list'
assert nested_collection['element_count'] == 1
assert nested_collection['elements'][0]['object']['populated']
assert nested_collection['elements'][0]['object']['element_count'] == 2
@skip_without_tool("__APPLY_RULES__")
def test_workflow_run_apply_rules(self):
with self.dataset_populator.test_history() as history_id:
+5 -2
View File
@@ -1,9 +1,11 @@
<tool id="cheetah_casting" name="cheetah_casting" version="1.0.0">
<command>
#set $int_val_inc = int($inttest) + 1
#set $int_flot_val_inc = int($floattest) + 1
#set $float_val_inc = float($floattest) + 1
echo $int_val_inc >> $out_file1;
echo $float_val_inc >> $out_file1;
echo $int_val_inc >> '$out_file1';
echo $int_flot_val_inc >> '$out_file1';
echo $float_val_inc >> '$out_file1';
</command>
<inputs>
<param name="inttest" value="1" type="integer" />
@@ -19,6 +21,7 @@
<output name="out_file1">
<assert_contents>
<has_line line="2" />
<has_line line="3" />
<has_line line="3.5" />
</assert_contents>
</output>