@@ -292,15 +292,15 @@ def test_0_d(self) -> None:
292292\end{tabular}"""
293293 )
294294
295- class TestColIndex :
296- """Tests for the `col_index ` support."""
295+ class TestIndex :
296+ """Tests for the `index ` support."""
297297
298298 def test_default (self ) -> None :
299- """`col_index ` forms the row names."""
300- col_index = ["Row 1" , "Row 2" ]
299+ """`index ` forms the row names."""
300+ index = ["Row 1" , "Row 2" ]
301301 mat = np .arange (1 , 5 ).reshape (2 , 2 )
302302
303- out = to_tabular (mat , col_index = col_index )
303+ out = to_tabular (mat , index = index )
304304
305305 assert (
306306 out
@@ -315,24 +315,24 @@ def test_default(self) -> None:
315315 )
316316
317317 def test_bad_dimensions (self ) -> None :
318- """An error is raised if wrong dimension of `col_index `."""
319- col_index = ["Row 1" , "Row 2" ]
318+ """An error is raised if wrong dimension of `index `."""
319+ index = ["Row 1" , "Row 2" ]
320320 mat = np .arange (1 , 4 ).reshape (3 , 1 )
321321
322322 with pytest .raises (DimensionMismatchError ) as exc :
323- to_tabular (mat , col_index = col_index )
323+ to_tabular (mat , index = index )
324324
325325 assert str (exc .value ) == (
326- "Number of `col_index ` items (2) doesn't match number of rows (3)"
326+ "Number of `index ` items (2) doesn't match number of rows (3)"
327327 )
328328
329329 def test_given_col_names (self ) -> None :
330330 """A given index name as part of `col_names` is used."""
331- col_index = ["Row 1" , "Row 2" ]
331+ index = ["Row 1" , "Row 2" ]
332332 col_names = ["My Index" , "Col 1" , "Col 2" ]
333333 mat = np .arange (1 , 5 ).reshape (2 , 2 )
334334
335- out = to_tabular (mat , col_index = col_index , col_names = col_names )
335+ out = to_tabular (mat , index = index , col_names = col_names )
336336
337337 assert (
338338 out
@@ -348,10 +348,10 @@ def test_given_col_names(self) -> None:
348348
349349 def test_given_col_align (self ) -> None :
350350 """A given col align char can be used for the col index."""
351- col_index = ["Row 1" , "Row 2" ]
351+ index = ["Row 1" , "Row 2" ]
352352 mat = np .arange (1 , 5 ).reshape (2 , 2 )
353353
354- out = to_tabular (mat , col_index = col_index , col_align = ["r" , "c" , "c" ])
354+ out = to_tabular (mat , index = index , col_align = ["r" , "c" , "c" ])
355355
356356 assert (
357357 out
@@ -367,7 +367,7 @@ def test_given_col_align(self) -> None:
367367
368368 def test_given_col_name_and_align (self ) -> None :
369369 """A given col index name and align can be used for the index."""
370- col_index = ["Row 1" , "Row 2" ]
370+ index = ["Row 1" , "Row 2" ]
371371 col_names = ["My Index" , "Col 1" , "Col 2" ]
372372 col_align = ["r" , "c" , "c" ]
373373 mat = np .arange (1 , 5 ).reshape (2 , 2 )
@@ -376,7 +376,7 @@ def test_given_col_name_and_align(self) -> None:
376376 mat ,
377377 col_align = col_align ,
378378 col_names = col_names ,
379- col_index = col_index ,
379+ index = index ,
380380 )
381381
382382 assert (
@@ -393,7 +393,7 @@ def test_given_col_name_and_align(self) -> None:
393393
394394 def test_col_align_bad_dimensions (self ) -> None :
395395 """Bad dimensions of `col_align` is caught."""
396- col_index = ["Row 1" , "Row 2" ]
396+ index = ["Row 1" , "Row 2" ]
397397 col_names = ["My Index" , "Col 1" , "Col 2" ]
398398 col_align = ["r" , "c" ]
399399 mat = np .arange (1 , 5 ).reshape (2 , 2 )
@@ -403,7 +403,7 @@ def test_col_align_bad_dimensions(self) -> None:
403403 mat ,
404404 col_align = col_align ,
405405 col_names = col_names ,
406- col_index = col_index ,
406+ index = index ,
407407 )
408408
409409 assert str (exc .value ) == (
0 commit comments