Test basic indexing produces identical results for transform and pandas index.
(data, sizes)
| 74 | xrst.dimension_sizes(min_dims=1, max_dims=3, min_side=1, max_side=5), |
| 75 | ) |
| 76 | def test_basic_indexing(data, sizes): |
| 77 | """Test basic indexing produces identical results for transform and pandas index.""" |
| 78 | pandas_da = create_pandas_da(sizes) |
| 79 | transform_da = create_transform_da(sizes) |
| 80 | idxr = data.draw(xrst.basic_indexers(sizes=sizes)) |
| 81 | pandas_result = pandas_da.isel(idxr) |
| 82 | transform_result = transform_da.isel(idxr) |
| 83 | # TODO: any indexed dim in pandas_result should be an indexed dim in transform_result |
| 84 | # This requires us to return a new CoordinateTransformIndex from .isel. |
| 85 | # for dim in pandas_result.xindexes: |
| 86 | # assert isinstance(transform_result.xindexes[dim], CoordinateTransformIndex) |
| 87 | assert_equal(pandas_result, transform_result) |
| 88 | |
| 89 | # not supported today |
| 90 | # pandas_result = pandas_da.sel(idxr) |
| 91 | # transform_result = transform_da.sel(idxr) |
| 92 | # assert_identical(pandas_result, transform_result) |
| 93 | |
| 94 | |
| 95 | @given( |
nothing calls this directly
no test coverage detected
searching dependent graphs…