dask-ms icon indicating copy to clipboard operation
dask-ms copied to clipboard

Support dimension ID coordinates (ROWID++)

Open JSKenyon opened this issue 1 year ago • 1 comments

  • [ ] Tests added / passed

    $ py.test -v -s daskms/tests
    

    If the pep8 tests fail, the quickest way to correct this is to run autopep8 and then flake8 and pycodestyle to fix the remaining issues.

    $ pip install -U autopep8 flake8 pycodestyle
    $ autopep8 -r -i daskms
    $ flake8 daskms
    $ pycodestyle daskms
    
  • [ ] Fully documented, including HISTORY.rst for all changes and one of the docs/*-api.rst files for new API

    To build the docs locally:

    pip install -r requirements.readthedocs.txt
    cd docs
    READTHEDOCS=True make html
    

This PR adds generic ID coordinates to datasets read by dask-ms. This extends the existing ROWID functionality to all dimensions. The advantage of this approach is that it becomes possible to leverage the excellent xarray selection mechanisms without making writing to disk complicated e.g. a user may select and write out a channel subset without having to coerce the selected data into the same shape as the original.

Currently, the new functionality works for multidimensional arrays but there remain a number of issues:

  • [x] Previous code relied on absence of chunking in non-row dimensions to trigger putcol behaviour. This is not safe when using IDs as a single chunk may correspond to multiple locations on disk.
  • [x] New code always generates dim_runs (extension of row_runs), regardless of chunking/data type. This currently causes dictionary writes to fail.
  • [ ] New code may end up using slower putcolslice unnecessarily in some cases.
  • [ ] Changes do not make use of inlined_array due to mysterious bugs occurring in testing. This likely needs to be addressed for the purposes of maintaining a tidy graph.
  • [ ] Test suite needs to be substantially improved.
  • [ ] Changes currently break arrow schemas.

JSKenyon avatar Sep 28 '23 09:09 JSKenyon