Skip to content

Support dimension ID coordinates (ROWID++)#292

Draft
JSKenyon wants to merge 17 commits intomasterfrom
dim_ids
Draft

Support dimension ID coordinates (ROWID++)#292
JSKenyon wants to merge 17 commits intomasterfrom
dim_ids

Conversation

@JSKenyon
Copy link
Copy Markdown
Collaborator

@JSKenyon JSKenyon commented Sep 28, 2023

  • 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:

  • 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.
  • 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 JSKenyon marked this pull request as draft September 28, 2023 09:30
Copy link
Copy Markdown
Member

@sjperkins sjperkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, need to do some more reviewing here.

@sjperkins
Copy link
Copy Markdown
Member

Thought: Implement this down to arcae. Coordinates are a generalisation of startrow ,nrow,blc,trc, rincr and inc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants