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

BUG: Distinguish exact vs. equivalent dtype for C type aliases. #21995

Merged
merged 11 commits into from Sep 7, 2022

Commits on Jul 16, 2022

  1. BUG: Distinguish exact vs. equivalent dtype for C type aliases.

    For `asarray` and for the `dtype` equality operator,
    equivalent dtype aliases were considered exact matches.
    This change ensures that the returned array has a descriptor
    that exactly matches the requested dtype.
    
    Note: Intended behavior of `np.dtype('i') == np.dtype('l')`
    is to test compatibility, not identity. This change does not
    affect the behavior of `PyArray_EquivTypes()`, and the
    `__eq__` operator for `dtype` continues to map to
    `PyArray_EquivTypes()`.
    
    Fixes numpy#1468.
    eirrgang committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    45357de View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a3eedb0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    78cd6b0 View commit details
    Browse the repository at this point in the history
  4. Get the base object.

    Use the correct API call to actually set the base object.
    eirrgang committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    45281b8 View commit details
    Browse the repository at this point in the history
  5. Add unit testing.

    eirrgang committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    81b9760 View commit details
    Browse the repository at this point in the history
  6. Don't regenerate the descriptor unnecessarily.

    Fix a false mismatch. Separate dtype objects, even if equivalent,
    cause distinct array views to be created.
    eirrgang committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    871a1f9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5651445 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2022

  1. Expand test_asarray.py.

    * Improve comments/docs.
    * Improve descriptiveness of variable names.
    * Add additional test expressions that would not pass without
      this patch.
    eirrgang committed Jul 17, 2022
    Configuration menu
    Copy the full SHA
    e286f46 View commit details
    Browse the repository at this point in the history
  2. Lint.

    Shorten some lines.
    eirrgang committed Jul 17, 2022
    Configuration menu
    Copy the full SHA
    01438a8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b1a8ff8 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2022

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