pydata / pydata/xarray

support for units with pint

Open
#3,594 8 comments 18 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement topic-arrays
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

pint's implementation of NEP-18 (see hgrecco/pint#905) is close enough so we can finally start working on the pint support (i.e. make the integration tests pass). This would be the list of tasks to get there:

  • integration tests:
    • implement integration tests for DataArray, Dataset and top-level functions (#3238, #3447, #3493)
    • add tests for Variable as discussed in #3493 (#3654)
    • clean up the current tests (#3600)
    • use the standard assert_identical and assert_allclose functions (#3611, #3643, #3654, #3706, #3975)
    • clean up the TestVariable.test_pad tests
  • actually get xarray to support units:
    • top-level functions (#3611)
    • Variable (#3706)
      • rolling_window and identical need larger modifications
    • DataArray (#3643)
    • Dataset
    • silence all the UnitStrippedWarnings in the testsuite (#4163)
    • try to get nanprod to work with quantities
    • add support for per variable fill values (#4165)
    • repr with units (#2773)
    • type hierarchy (e.g. for np.maximum(data_array, quantity) vs np.maximum(quantity, data_array)) (#3950)
  • update the documentation

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the two unchecked tasks in the issue: making nanprod work with quantities and resolving the type hierarchy for mixed quantity operations. Start with the existing integration tests for DataArray, Dataset, Variable, and top-level functions, then run the relevant test suite. Done means both remaining behaviors work without regressions and the listed integration tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, pandas, python
Domain
data, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.