Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dimension ID coordinates (ROWID++) #292

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft

Support dimension ID coordinates (ROWID++) #292

wants to merge 17 commits into from

Conversation

JSKenyon
Copy link
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
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.

daskms/ordering.py Outdated Show resolved Hide resolved
daskms/reads.py Show resolved Hide resolved
@sjperkins
Copy link
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.

None yet

2 participants