@@ -60,6 +60,10 @@ def testSelectAll(self):
6060 self .assertEqual (sel , sel2 )
6161 self .assertEqual (sel .query_string , query_string )
6262
63+ # create the same selection from a dict
64+ sel3 = selections .select (shape , {})
65+ self .assertEqual (sel , sel3 )
66+
6367 def testSelectAll2D (self ):
6468 shape = (4 , 5 )
6569 sel = selections .select (shape , ...)
@@ -80,6 +84,10 @@ def testSelectAll2D(self):
8084 self .assertEqual (sel , sel2 )
8185 self .assertEqual (sel .query_string , query_string )
8286
87+ # create the same selection from a dict
88+ sel3 = selections .select (shape , {})
89+ self .assertEqual (sel , sel3 )
90+
8391 def testSlice1D (self ):
8492 shape = (10 ,)
8593 sel = selections .select (shape , slice (2 , 7 ))
@@ -102,6 +110,10 @@ def testSlice1D(self):
102110 self .assertEqual (sel , sel2 )
103111 self .assertEqual (sel .query_string , query_string )
104112
113+ # create the same selection from a dict
114+ sel3 = selections .select (shape , {"start" : 2 , "stop" : 7 })
115+ self .assertEqual (sel , sel3 )
116+
105117 def testSliceWithStep (self ):
106118 shape = (10 ,)
107119 sel = selections .select (shape , slice (0 , 10 , 2 ))
@@ -124,6 +136,10 @@ def testSliceWithStep(self):
124136 self .assertEqual (sel , sel2 )
125137 self .assertEqual (sel .query_string , query_string )
126138
139+ # create the same selection from a dict
140+ sel3 = selections .select (shape , {"start" : 0 , "stop" : 10 , "step" : 2 })
141+ self .assertEqual (sel , sel3 )
142+
127143 def testSlice2D (self ):
128144 shape = (8 , 10 )
129145 sel = selections .select (shape , (slice (1 , 4 ), slice (2 , 9 )))
@@ -146,6 +162,10 @@ def testSlice2D(self):
146162 self .assertEqual (sel , sel2 )
147163 self .assertEqual (sel .query_string , query_string )
148164
165+ # create the same selection from a dict
166+ sel3 = selections .select (shape , {"start" : [1 , 2 ], "stop" : [4 , 9 ]})
167+ self .assertEqual (sel , sel3 )
168+
149169 def testBroadcast1D (self ):
150170 shape = (10 ,)
151171 sel = selections .select (shape , ...)
@@ -388,6 +408,7 @@ def testFancyCoord(self):
388408 self .assertEqual (len (slices ), 2 )
389409 self .assertEqual (slices [0 ], slice (0 , 5 , 1 ))
390410 self .assertEqual (slices [1 ], [3 , 7 ])
411+
391412 # create the same selection from a string
392413 query_string = "[0:5,[3,7]]"
393414 sel2 = selections .select (shape , query_string )
0 commit comments