Check that `fake_target_chunksize` returns the expected chunksize and dtype. - It pretends to dask we are chunking an array with an 8-byte dtype, ie. a float64. - This is the same as the above test, but specifically for a CFTime array case - split for testing reasons
()
| 644 | |
| 645 | @requires_cftime |
| 646 | def test_fake_target_chunksize_cftime() -> None: |
| 647 | """ |
| 648 | Check that `fake_target_chunksize` returns the expected chunksize and dtype. |
| 649 | - It pretends to dask we are chunking an array with an 8-byte dtype, ie. a float64. |
| 650 | - This is the same as the above test, but specifically for a CFTime array case - split for testing reasons |
| 651 | """ |
| 652 | import cftime |
| 653 | |
| 654 | target_chunksize = 1024 |
| 655 | |
| 656 | input_array = np.array( |
| 657 | [ |
| 658 | cftime.Datetime360Day(2000, month, day, 0, 0, 0, 0) |
| 659 | for month in range(1, 11) |
| 660 | for day in range(1, 11) |
| 661 | ], |
| 662 | dtype=object, |
| 663 | ).reshape(10, 10) |
| 664 | |
| 665 | faked_chunksize, dtype = fake_target_chunksize(input_array, target_chunksize) # type: ignore[arg-type,unused-ignore] |
| 666 | |
| 667 | assert faked_chunksize == 73 |
| 668 | assert dtype == np.float64 |
nothing calls this directly
no test coverage detected
searching dependent graphs…