Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial refactor for NamedArray (#8075)
* initial prototype for NamedArray * move NDArrayMixin and NdimSizeLenMixin inside named_array * vendor is_duck_dask_array * vendor Frozen object * update import * move _default sentinel value * rename subpackage to namedarray per @TomNicholas suggestion * Remove NdimSizeLenMixin * fix typing * add annotations * Remove NDArrayMixin * Apply suggestions from code review Co-authored-by: Illviljan <[email protected]> * fix typing * fix return type * revert NDArrayMixin * [WIP] as_compatible_data refactor * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * duplicate sentinel value and leave the original sentinel object alone * Apply suggestions from code review Co-authored-by: Stephan Hoyer <[email protected]> * use DuckArray * Apply suggestions from code review Co-authored-by: Stephan Hoyer <[email protected]> * use sentinel value from xarray * remove unused code * fix variable constructor * fix as_compatible_data utility function * move _to_dense and _non_zero to NamedArray * more typing * add initial tests * Apply suggestions from code review Co-authored-by: Illviljan <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * attempt to fix some mypy errors * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update core.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update core.py * All input data can be arraylike * Update core.py * Update core.py * get and set attrs at the same level. * data doesn't have to be ndarray * avoid redefining typing use new variable names instead * import on runtime as well to be able to cast * requires ufunc and function to be a valid duck array * Add array_namespace * Update test_dataset.py * Update test_dataset.py * remove Frozen * update tests * update tests * switch to functional API * add fastpath * Test making sizes dict[Hashable, int] * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * A lot of errors... Try Mapping instead * Update groupby.py * Update types.py * Apply suggestions from code review Co-authored-by: Illviljan <[email protected]> Co-authored-by: Deepak Cherian <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update docstrings * update error messages * update tests * test explicitly index array * update tests * remove unused types * Update xarray/tests/test_namedarray.py Co-authored-by: Illviljan <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * use Self --------- Co-authored-by: Illviljan <[email protected]> Co-authored-by: dcherian <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Stephan Hoyer <[email protected]> Co-authored-by: Deepak Cherian <[email protected]>
- Loading branch information