• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pydata / xarray / 4182 / 3
96%
master: 96%

Build:
DEFAULT BRANCH: master
Ran 18 Dec 2017 05:44AM UTC
Files 53
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Dec 2017 05:38AM UTC coverage: 72.392% (+0.06%) from 72.332%
CONDA_ENV=py34

push

travis-ci

web-flow
Indexing Variable objects with a mask (#1751)

* Variable indexing with a mask

This will be useful for multi-dimensional reindexing: marking masked items with
-1 is exactly the convention used by pandas.Index.get_indexer().

Example usage:

    In [6]: variable = xr.Variable(('x',), [1, 2, 3])

    In [7]: variable._getitem_with_mask([0, 1, 2, -1])
    Out[7]:
    <xarray.Variable (x: 4)>
    array([  1.,   2.,   3.,  nan])

    In [8]: variable._getitem_with_mask(xr.Variable(('x', 'y'), [[0, -1], [-1, 1]]), fill_value=-99)
    Out[8]:
    <xarray.Variable (x: 2, y: 2)>
    array([[  1, -99],
           [-99,   2]])

This uses where() so it isn't the most efficient (there is some wasted effort
doing indexing, as noted in the TODOs), but the implementation is pretty clean
and already works with dask.

For now, I'm leaving this as private API, but let's expose it publicly in the
future if we are happy with it. I would probably leave it as a Variable method
since this is pretty low-level.

* More tests for _getitem_with_mask & fixes for dask

6482 of 8954 relevant lines covered (72.39%)

0.72 hits per line

Source Files on job 4182.3 (CONDA_ENV=py34)
  • Tree
  • List 0
  • Changed 3
  • Source Changed 3
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 4182
  • Travis Job 4182.3
  • 49243646 on github
  • Prev Job for CONDA_ENV=py34 on master (#4173.3)
  • Next Job for CONDA_ENV=py34 on master (#4186.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc