commit/galaxy-central: jmchilton: Change paired collections terminology from left/right to forward/reverse.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f24bb5dde1f5/ Changeset: f24bb5dde1f5 User: jmchilton Date: 2014-05-15 20:01:36 Summary: Change paired collections terminology from left/right to forward/reverse. If you have paired datasets in your database they will no longer work - send me an e-mail and I can give you an SQL update statement. Affected #: 5 files diff -r b5a1cd130f71b20a25f1bf110b0e1e24843df4b7 -r f24bb5dde1f5f23353bd410001bf2b2ce82a9653 lib/galaxy/dataset_collections/types/paired.py --- a/lib/galaxy/dataset_collections/types/paired.py +++ b/lib/galaxy/dataset_collections/types/paired.py @@ -2,8 +2,10 @@ from galaxy.model import DatasetCollectionElement -LEFT_IDENTIFIER = "left" -RIGHT_IDENTIFIER = "right" +FORWARD_IDENTIFIER = "forward" +REVERSE_IDENTIFIER = "reverse" + +INVALID_IDENTIFIERS_MESSAGE = "Paired instance must define '%s' and '%s' datasets ." % ( FORWARD_IDENTIFIER, REVERSE_IDENTIFIER ) class PairedDatasetCollectionType( BaseDatasetCollectionType ): @@ -16,16 +18,16 @@ pass def build_collection( self, elements ): - left_dataset = elements.get("left", None) - right_dataset = elements.get("right", None) - if not left_dataset or not right_dataset: - self._validation_failed("Paired instance must define 'left' and 'right' datasets .") + forward_dataset = elements.get( FORWARD_IDENTIFIER, None ) + reverse_dataset = elements.get( REVERSE_IDENTIFIER, None ) + if not forward_dataset or not reverse_dataset: + self._validation_failed( INVALID_IDENTIFIERS_MESSAGE ) left_association = DatasetCollectionElement( - element=left_dataset, - element_identifier=LEFT_IDENTIFIER, + element=forward_dataset, + element_identifier=FORWARD_IDENTIFIER, ) right_association = DatasetCollectionElement( - element=right_dataset, - element_identifier=RIGHT_IDENTIFIER, + element=reverse_dataset, + element_identifier=REVERSE_IDENTIFIER, ) return self._new_collection_for_elements([left_association, right_association]) diff -r b5a1cd130f71b20a25f1bf110b0e1e24843df4b7 -r f24bb5dde1f5f23353bd410001bf2b2ce82a9653 test/api/helpers.py --- a/test/api/helpers.py +++ b/test/api/helpers.py @@ -292,8 +292,8 @@ hda1, hda2 = self.__datasets( history_id, count=2, contents=contents ) element_identifiers = [ - dict( name="left", src="hda", id=hda1[ "id" ] ), - dict( name="right", src="hda", id=hda2[ "id" ] ), + dict( name="forward", src="hda", id=hda1[ "id" ] ), + dict( name="reverse", src="hda", id=hda2[ "id" ] ), ] return element_identifiers diff -r b5a1cd130f71b20a25f1bf110b0e1e24843df4b7 -r f24bb5dde1f5f23353bd410001bf2b2ce82a9653 test/api/test_tools.py --- a/test/api/test_tools.py +++ b/test/api/test_tools.py @@ -204,8 +204,8 @@ first_object = first_element[ "object" ] assert first_object[ "collection_type" ] == "paired" assert len( first_object[ "elements" ] ) == 2 - first_object_left_element = first_object[ "elements" ][ 0 ] - self.assertEquals( outputs[ 0 ][ "id" ], first_object_left_element[ "object" ][ "id" ] ) + first_object_forward_element = first_object[ "elements" ][ 0 ] + self.assertEquals( outputs[ 0 ][ "id" ], first_object_forward_element[ "object" ][ "id" ] ) @skip_without_tool( "cat1" ) def test_map_over_two_collections( self ): diff -r b5a1cd130f71b20a25f1bf110b0e1e24843df4b7 -r f24bb5dde1f5f23353bd410001bf2b2ce82a9653 test/functional/tools/collection_mixed_param.xml --- a/test/functional/tools/collection_mixed_param.xml +++ b/test/functional/tools/collection_mixed_param.xml @@ -13,8 +13,8 @@ <test><param name="f1"><collection type="paired"> - <element name="left" value="simple_line.txt" /> - <element name="right" value="simple_line_alternative.txt" /> + <element name="forward" value="simple_line.txt" /> + <element name="reverse" value="simple_line_alternative.txt" /></collection></param><param name="f2" value="simple_lines_both.txt" /> diff -r b5a1cd130f71b20a25f1bf110b0e1e24843df4b7 -r f24bb5dde1f5f23353bd410001bf2b2ce82a9653 test/functional/tools/collection_paired_test.xml --- a/test/functional/tools/collection_paired_test.xml +++ b/test/functional/tools/collection_paired_test.xml @@ -1,6 +1,6 @@ <tool id="collection_paired_test" name="paired_test" version="0.1.0"><command> - cat #for $f in $f1# ${f} #end for# >> $out1; + cat $f1.forward $f1.reverse >> $out1; </command><inputs><param name="f1" type="data_collection" collection_type="paired" /> @@ -12,8 +12,8 @@ <test><param name="f1"><collection type="paired"> - <element name="left" value="simple_line.txt" /> - <element name="right" value="simple_line_alternative.txt" /> + <element name="forward" value="simple_line.txt" /> + <element name="reverse" value="simple_line_alternative.txt" /></collection></param><output name="out1"> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org