Skip to content

_datetime_nanmin() broken (TypeError) #403

Closed

Description

@RondeauG

There appears to be either a typo (min instead of np.nanmin) or a missing import in the new _datetime_nanmin function.

Specifically, line 363:
array = min(array, skipna=True)

Always results in:
TypeError: 'skipna' is an invalid keyword argument for min()

Permalink:
https://github.com/xarray-contrib/flox/blob/4f6164f74a657d95f795c374e31e91a7e7643e9f/flox/xrutils.py#L363C5-L363C36

Activity

  1. dcherian commented on Nov 12, 2024

    @dcherian
    Collaborator

    dang it. Can you provide an example please? Clearly the current test suite isn't good enough.

  2. RondeauG commented on Nov 12, 2024

    @RondeauG
    Author

    This is failing for me with flox v0.9.14 and xarray v2024.9.0.

    ds = xr.tutorial.open_dataset("air_temperature")
    ds.time.resample(time="D").count()
    

    EDIT: An example using flox directly:

    import flox
    import numpy as np
    array = np.array([np.datetime64("2000-01-01"), np.datetime64("2000-01-02"), np.datetime64("2000-01-03")])
    by = [np.array([0, 0, 1])]
    flox.groupby_reduce(array, by, func="nanmin")
    
  3. added a commit that references this issue on Jan 8, 2025
    f1bd894
  4. added a commit that references this issue on Jan 13, 2025
    df81a8d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions