(self)
| 6539 | reason="counting number of tasks in graph fails on windows for some reason", |
| 6540 | ) |
| 6541 | def test_inline_array(self) -> None: |
| 6542 | with create_tmp_file() as tmp: |
| 6543 | original = Dataset({"foo": ("x", np.random.randn(10))}) |
| 6544 | original.to_netcdf(tmp) |
| 6545 | chunks = {"time": 10} |
| 6546 | |
| 6547 | def num_graph_nodes(obj): |
| 6548 | return len(obj.__dask_graph__()) |
| 6549 | |
| 6550 | with ( |
| 6551 | open_dataset(tmp, inline_array=False, chunks=chunks) as not_inlined_ds, |
| 6552 | open_dataset(tmp, inline_array=True, chunks=chunks) as inlined_ds, |
| 6553 | ): |
| 6554 | assert num_graph_nodes(inlined_ds) < num_graph_nodes(not_inlined_ds) |
| 6555 | |
| 6556 | with ( |
| 6557 | open_dataarray( |
| 6558 | tmp, inline_array=False, chunks=chunks |
| 6559 | ) as not_inlined_da, |
| 6560 | open_dataarray(tmp, inline_array=True, chunks=chunks) as inlined_da, |
| 6561 | ): |
| 6562 | assert num_graph_nodes(inlined_da) < num_graph_nodes(not_inlined_da) |
| 6563 | |
| 6564 | |
| 6565 | @requires_scipy_or_netCDF4 |
nothing calls this directly
no test coverage detected