home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 484015016

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
484015016 MDExOlB1bGxSZXF1ZXN0MzA5OTc4MDM4 3238 tests for arrays with units 14808389 closed 0     45 2019-08-22T14:03:55Z 2020-04-07T06:37:40Z 2019-10-17T03:13:40Z MEMBER   0 pydata/xarray/pulls/3238

This PR adds tests that verify that xarray properly wraps arrays with units.

  • [x] Passes black . && mypy . && flake8
  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API

They are currently restricted to using pint but may easily be extended to use other unit libraries. However, most of the libraries I know use subclassing instead of wrapping, so using them together with dask might not be ideal as unit conflicts will only be detected on compute().

As a reference for myself, here are the operations I plan on adding tests for: * top-level functions: - [x] replication: full_like, ones_like, zeros_like * dataarray methods - [x] creating: DataArray() - [x] representation: __repr__, __str__ - [x] content manipulation: assign_coords, assign_attrs, pipe, rename, swap_dims, expand_dims, drop, reset_coords, copy, astype, item - [x] indexing: loc, isel, sel, squeeze, interp, interp_like, reindex, reindex_like - [x] missing value handling: isnull, notnull, combine_first, count, dropna, fillna, ffill, bfill, interpolate_na, where, isin - [x] comparisons: equals, identical, broadcast_equals - [x] aggregation: all, any, argmax, argmin, max, mean, median, min, prod, sum, std, var - [x] ndarray methods: argsort, clip, conj, conjugate, imag, searchsorted, round, real, T, cumsum, cumprod, rank - [x] reshaping and reorganizing: transpose, stack, unstack, set_index, reset_index, reorder_levels, shift, roll, sortby, to_unstacked_dataset - [x] arithmetic: unary (-, abs, round), binary (+, *, @) - [x] ufuncs (univariate: sin, cos, bivariate: minimum, maximum) - [x] grouped operations: assign_coords, first, last, fillna, where, quantile - [x] computation: reduce, groupby, groupby_bins, rolling, rolling_exp, coarsen, resample, diff, dot, quantile, differentiate, integrate

The parts of the API that are currently not covered by this PR are: * top level: - combining: align, concat, merge, auto_combine, combine_by_coords, combine_nested - computation: broadcast, dot, apply_ufunc * dataarray: - computation: get_axis_num * dataset

From what is already done, mypy . fails because of pint (this the same as with quantities in #2956). What would I do to fix that?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3238/reactions",
    "total_count": 5,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 5,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 1 row from issues_id in issues_labels
  • 45 rows from issue in issue_comments
Powered by Datasette · Queries took 0.475ms · About: xarray-datasette