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

Add support for UFloat in PintArray (#139) #140

Open
wants to merge 58 commits into
base: master
Choose a base branch
from

Commits on Oct 15, 2022

  1. Add support for UFloat in PintArray (hgrecco#139)

    Signed-off-by: MichaelTiemann <[email protected]>
    MichaelTiemannOSC committed Oct 15, 2022
    Configuration menu
    Copy the full SHA
    b5954fd View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2022

  1. Fix failures and errors found by test_pandas_extensions test suite.

    Big remaining problem is unhanshable UFloat type.
    
    Signed-off-by: MichaelTiemann <[email protected]>
    MichaelTiemannOSC committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    0ad1cf9 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2022

  1. Configuration menu
    Copy the full SHA
    52ab185 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2022

  1. Configuration menu
    Copy the full SHA
    f3cdcad View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2022

  1. Add support for UFloat in PintArray (hgrecco#139)

    Signed-off-by: MichaelTiemann <[email protected]>
    MichaelTiemannOSC committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    3ffb617 View commit details
    Browse the repository at this point in the history
  2. Fix failures and errors found by test_pandas_extensions test suite.

    Big remaining problem is unhanshable UFloat type.
    
    Signed-off-by: MichaelTiemann <[email protected]>
    MichaelTiemannOSC committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    2f89897 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dce2668 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d4ca9f0 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'ducks-unlimited' of https://github.com/MichaelTiemannOS…

    …C/pint-pandas into ducks-unlimited
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    c375aeb View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2023

  1. Update pint_array.py

    Deal with duality of np.nan and _ufloat_nans when constructing PintArrays, creating float64 magnitude arrays when possible and ufloat magnitudes when necessary.  Note that PintArray columns don't advertise whether magnitudes are np.float64 or np.obejct; they are what they are.  Also commented out warning, which simply creates noise.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jan 2, 2023
    Configuration menu
    Copy the full SHA
    9fffcc5 View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2023

  1. Update pint_array.py

    Fix conditional expression.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    8b06708 View commit details
    Browse the repository at this point in the history
  2. Update pint_array.py

    Don't try to build a large-enough-to-hold-uncertainties array if we are not using uncertainties in any way.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    c5b7926 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2023

  1. Configuration menu
    Copy the full SHA
    232857c View commit details
    Browse the repository at this point in the history
  2. Fix and blacken merge

    The manual merge process created a syntax error and various things that black didn't like.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jun 26, 2023
    Configuration menu
    Copy the full SHA
    0b0e4d4 View commit details
    Browse the repository at this point in the history
  3. Fix ruff complaints in testsuite

    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jun 26, 2023
    Configuration menu
    Copy the full SHA
    959570f View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2023

  1. Fix numerous regressions in test_pandas_extensiontests

    Fixes include:
    * Factorization
    * NaN handling (several more issues still need to be resolved)
    * Proper unit declarations in test_offset_concat
    * Integration of new `numeric_dtype` parameter
    
    A major outstanding issue (presently being discussed as pandas-dev/pandas#53904) concerns whether we can make AffineScalarFunc hashable and/or whether other legacy Pandas code (which has been deprecated) can be further removed.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    5270a46 View commit details
    Browse the repository at this point in the history
  2. Update pint_array.py

    Make `ruff` and `black` happy.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    6ddf204 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2023

  1. Update to us pd.NA instead of np.nan / _ufloat_nan

    To resolve the question of the proper na_value for EA dtypes (np.nan vs. uncertainties _ufloat_nan), use the gender-neutral pd.NA value.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 2, 2023
    Configuration menu
    Copy the full SHA
    e1d367c View commit details
    Browse the repository at this point in the history
  2. Update pint_array.py

    Make black happy.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 2, 2023
    Configuration menu
    Copy the full SHA
    dbf5ad1 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2023

  1. Progress: 2608 pass, 97 skip, 84 xfail, 6 xpass

    With these changes (and pandas-dev/pandas#53970 and hgrecco/pint#1615) the test suite passes or xpasses everything (no failures or error).  Indeed, the uncertainties code has essentially doubled the scope of the test suite (to test with and without it).
    
    The biggest gotcha is that the EA for complex numbers is not compatible with the EA for uncertainties, due to incompatible hacks:
    
    The hack for complex numbers is to np.nan (which is, technically, a complex number) for na_value across all numeric types.  But that doesn't work for uncertainties, because uncertainties doesn't accept np.nan as an uncertain value.
    
    The hack for uncertainties is to use pd.NA for na_value.  This works for Int64, Float64, and uncertainties, but doesn't work for complex (which cannot tolerate NAType).
    
    Some careful subclassing fills in what doesn't easily work, with fixtures to prevent the improper mixing of complex and uncertainty types in the same python environment.  Happy to discuss!
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    3c6eff4 View commit details
    Browse the repository at this point in the history
  2. Make ruff and black happy

    Except that ruff cannot be made happy, see astral-sh/ruff#2044
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    a0625f8 View commit details
    Browse the repository at this point in the history
  3. Make ruff happy (na_frame fixture import vs F811)

    Moving the # noqa: F811 to the correct line allows the file to pass ruff.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    94d3524 View commit details
    Browse the repository at this point in the history
  4. Make black happy

    Arrgh!
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    a6c4040 View commit details
    Browse the repository at this point in the history
  5. Make black happy

    Missed this.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    1506df2 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2023

  1. Fix DataFrame reduction for upcoming Pandas

    Issue hgrecco#174 reports that DataFrame reduction was broken by the latest Pint-Pandas changes.  This commit adapts Pint-Pandas to work with upcoming Pandas 2.1, currently scheduled for release Aug 20, 2023.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 23, 2023
    Configuration menu
    Copy the full SHA
    772636b View commit details
    Browse the repository at this point in the history
  2. Make black happy...

    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 23, 2023
    Configuration menu
    Copy the full SHA
    b759adb View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2023

  1. Update pint_array.py

    Remove print statement mistakenly copied into _accumulate code that was never (properly) tested.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    bfb4a99 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. Switch to np.nan as NaN value

    Using np.nan actually simplifies the integration of uncertainties into pint_pandas.  Recent changes in Pandas 2.1 are now sufficient to pass all Pint-Pandas tests.
    
    Also added a fixture validating that we can use either `np.nan` or `ufloat(np.nan, 0)` as NA value (the latter being something that should naturally arise in the course of uncertainties calculations, not just missing data from the start).
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    9d169f1 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2023

  1. Updated to Pandas 2.1.0.dev0+1401.gb0bfd0effd

    The internal Pandas 2.1 interfaces continue to move and change.  These changes adapt to those changes, adjsting and removing some redundant subclass methods.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Aug 6, 2023
    Configuration menu
    Copy the full SHA
    289c604 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2023

  1. Keep up with pandas21_compat changes

    Merge in important bugfixes for `na_value` handling.  And keep `black` happy.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Aug 12, 2023
    Configuration menu
    Copy the full SHA
    602a804 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    866bf7a View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2023

  1. Configuration menu
    Copy the full SHA
    9f723f9 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2023

  1. Cleanups after merge

    First draft of 100% working test cases after (re)merging with changes extracted from these changes as part of PR hgrecco#196.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    f0c7e64 View commit details
    Browse the repository at this point in the history
  2. Update test_issues.py

    Fix so that it works in a world without uncertainties (or with uncertainties).
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    5b39a3e View commit details
    Browse the repository at this point in the history
  3. Add uncertainties to CI/CD

    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    8ed4c1d View commit details
    Browse the repository at this point in the history
  4. Update CI/CD to anticipate, not install or test uncertainties

    For now disable testing of `uncertainties` specifically, as that also requires an uncertainties-aware `pint`.  When that becomes available we can update the CI/CD scripts to enable optional uncertainty testing with versions of pint and pint-pandas that can tolerate it.
    
    From local testing with uncertainties, remember: if you don't put a fixture XYZ in the parameter list, then testing `if XYZ` is really testing whether the fixture's function is not None (it's always not None).  When XYZ is in the parameter list, testing `if XYZ` tells you whether the value of XYZ fixture is non-False.
    
    Also increase version compatibility by using `np.array([f(x) for x in arr])` instead of `arr.map(f)` when `arr` is a numpy array.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    2cb50f4 View commit details
    Browse the repository at this point in the history
  5. Update CHANGES

    Added blurb about supporting `uncertainties`.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    8c4bf7d View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2023

  1. Configuration menu
    Copy the full SHA
    37c6f6d View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2023

  1. Configuration menu
    Copy the full SHA
    fc2814a View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2023

  1. Test with Pint-0.23rc0 and uncertainties in ci/cd

    Settle changes that work with Pandas 2.1.0 and Pint-0.23rc0 and see if we can pass Pint-Pandas CI/CD.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    e365cbc View commit details
    Browse the repository at this point in the history
  2. 2nd attempt integrating uncertainties and CI/CD

    Allow pip install command to unpack uncertainties option into multiple arguments.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    108cb71 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2023

  1. Use include to handle uncertainties testing

    By using `include` directive, we can add a special case to the matrix of possibilities.  In this case we add to the matrix the case where pandas>=2.1.0 and pint>=0.23rc0, which are both necessary for the UFloat array changes to work.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    a5758e7 View commit details
    Browse the repository at this point in the history
  2. Only test uncertainties in ci.yml

    Don't test uncertainties in ci-pint-pre or ci-pint-master, as these don't have the necessary versions of Pandas or Pint to make the matrix include operation work.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    82442ab View commit details
    Browse the repository at this point in the history
  3. Update ci.yml

    Also test Pint-Pandas without uncertainties.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    5d351fc View commit details
    Browse the repository at this point in the history
  4. Update ci.yml

    Trying again with different syntax to avoid duplicate key issue.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    c4e3a06 View commit details
    Browse the repository at this point in the history
  5. Update ci.yml

    Trying yet another syntax to make `uncertainties` one of two options when pandas==2.1.0 and pint==0.23rc0.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    8d5feb9 View commit details
    Browse the repository at this point in the history
  6. Update ci.yml

    Try using null instead of "" for uncertainties that we don't want to run.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    bfe9a77 View commit details
    Browse the repository at this point in the history
  7. Update ci.yml

    Try using "null" to represent a condition where we don't want uncertainties installed.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    25adf35 View commit details
    Browse the repository at this point in the history
  8. Update ci.yml

    Try using "no-thank-you" instead of "null" for matrix permutations not intended to use uncertainties.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    afc3eb4 View commit details
    Browse the repository at this point in the history
  9. Update ci.yml

    Wrap `uncertainties` matrix parameter in `[]`.  If we get this working, can try setting parameter to `''`' from several commits ago.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    e281dfc View commit details
    Browse the repository at this point in the history
  10. Update ci.yml

    Use single quotes when testing the value of `uncertainties`.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    a208163 View commit details
    Browse the repository at this point in the history
  11. Update ci.yml

    Tweak conditional matrix logic by using a "same-but-different" value for `pint` value assignment.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    296bbdc View commit details
    Browse the repository at this point in the history
  12. Update ci.yml

    Untabify yaml file...
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    585f38d View commit details
    Browse the repository at this point in the history
  13. Update ci.yml

    Make uncertainties a default null value in the matrix.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    75d4c56 View commit details
    Browse the repository at this point in the history
  14. Update ci.yml

    Attempt to explicitly add python-version and numpy to `uncertainties` case.  Otherwise, pytest never gets installed.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    6988212 View commit details
    Browse the repository at this point in the history
  15. Update ci.yml

    We cannot reference the matrix when building the matrix, so unroll all parameter values.
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    764b609 View commit details
    Browse the repository at this point in the history
  16. Update ci-*.yml files

    Remove unused `uncertainties` from -pre and -master CI files.
    
    Only test one configuration of Python against uncertainties (trying to work around duplicate key problem).
    
    Signed-off-by: Michael Tiemann <[email protected]>
    MichaelTiemannOSC committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    9ed23c1 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2023

  1. Configuration menu
    Copy the full SHA
    b609001 View commit details
    Browse the repository at this point in the history