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 format_descriptor<> & npy_format_descriptor<> PyObject * specializations. #4674

Merged
merged 24 commits into from
May 23, 2023

Commits on May 17, 2023

  1. Add npy_format_descriptor<PyObject *> to enable `py::array_t<PyObje…

    …ct *>` to/from-python conversions.
    Ralf W. Grosse-Kunstleve committed May 17, 2023
    Configuration menu
    Copy the full SHA
    5168c13 View commit details
    Browse the repository at this point in the history
  2. resolve clang-tidy warning

    Ralf W. Grosse-Kunstleve committed May 17, 2023
    Configuration menu
    Copy the full SHA
    d53a796 View commit details
    Browse the repository at this point in the history
  3. Use existing constructor instead of adding a static method. Thanks @S…

    …kylion007 for pointing out.
    Ralf W. Grosse-Kunstleve committed May 17, 2023
    Configuration menu
    Copy the full SHA
    5bea2a8 View commit details
    Browse the repository at this point in the history
  4. Add format_descriptor<PyObject *>

    Trivial addition, but still in search for a meaningful test.
    Ralf W. Grosse-Kunstleve committed May 17, 2023
    Configuration menu
    Copy the full SHA
    50eaa3a View commit details
    Browse the repository at this point in the history

Commits on May 18, 2023

  1. Add test_format_descriptor_format

    Ralf W. Grosse-Kunstleve committed May 18, 2023
    Configuration menu
    Copy the full SHA
    82ce80f View commit details
    Browse the repository at this point in the history
  2. Ensure the Eigen type_casters do not segfault when loading arrays w…

    …ith dtype=object
    Ralf W. Grosse-Kunstleve committed May 18, 2023
    Configuration menu
    Copy the full SHA
    20b9baf View commit details
    Browse the repository at this point in the history
  3. Use static_assert() !std::is_pointer<> to replace runtime guards.

    Ralf W. Grosse-Kunstleve committed May 18, 2023
    Configuration menu
    Copy the full SHA
    0640eb3 View commit details
    Browse the repository at this point in the history
  4. Add comments to explain how to check for ref-count bugs. (NO code cha…

    …nges.)
    Ralf W. Grosse-Kunstleve committed May 18, 2023
    Configuration menu
    Copy the full SHA
    ddb625e View commit details
    Browse the repository at this point in the history
  5. Make the "Pointer types ... are not supported" message Eigen-specific…

    …, as suggested by @lalaland. Move to new pybind11/eigen/common.h header.
    Ralf W. Grosse-Kunstleve committed May 18, 2023
    Configuration menu
    Copy the full SHA
    03dafde View commit details
    Browse the repository at this point in the history
  6. Change "format_descriptor_format" implementation as suggested by @lal…

    …aland. Additional tests meant to ensure consistency between py::format_descriptor<>, np.array, np.format_parser turn out to be useful only to highlight long-standing inconsistencies.
    Ralf W. Grosse-Kunstleve committed May 18, 2023
    Configuration menu
    Copy the full SHA
    28492ed View commit details
    Browse the repository at this point in the history
  7. resolve clang-tidy warning

    Ralf W. Grosse-Kunstleve committed May 18, 2023
    Configuration menu
    Copy the full SHA
    1593ebc View commit details
    Browse the repository at this point in the history
  8. Account for np.float128, np.complex256 not being available on Windows…

    …, in a future-proof way.
    Ralf W. Grosse-Kunstleve committed May 18, 2023
    Configuration menu
    Copy the full SHA
    3f04188 View commit details
    Browse the repository at this point in the history
  9. Fully address i|q|l ambiguity (hopefully).

    Ralf W. Grosse-Kunstleve committed May 18, 2023
    Configuration menu
    Copy the full SHA
    38aa697 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2023

  1. Remove the new np.format_parser()-based test, it's much more distra…

    …cting than useful.
    Ralf W. Grosse-Kunstleve committed May 19, 2023
    Configuration menu
    Copy the full SHA
    7f124bb View commit details
    Browse the repository at this point in the history
  2. Use bi.itemsize to disambiguate "l" or "L"

    Ralf W. Grosse-Kunstleve committed May 19, 2023
    Configuration menu
    Copy the full SHA
    d432ce7 View commit details
    Browse the repository at this point in the history
  3. Use py::detail::compare_buffer_info<T>::compare() to validate the `…

    …format_descriptor<T>::format()` strings.
    Ralf W. Grosse-Kunstleve committed May 19, 2023
    Configuration menu
    Copy the full SHA
    18e1bd2 View commit details
    Browse the repository at this point in the history
  4. Add buffer_info::compare<T> to make `detail::compare_buffer_info<T>…

    …::compare` more visible & accessible.
    Ralf W. Grosse-Kunstleve committed May 19, 2023
    Configuration menu
    Copy the full SHA
    029b157 View commit details
    Browse the repository at this point in the history
  5. silence clang-tidy warning

    Ralf W. Grosse-Kunstleve committed May 19, 2023
    Configuration menu
    Copy the full SHA
    d9e3bd3 View commit details
    Browse the repository at this point in the history
  6. pytest-compatible access to np.float128, np.complex256

    Ralf W. Grosse-Kunstleve committed May 19, 2023
    Configuration menu
    Copy the full SHA
    e9a289c View commit details
    Browse the repository at this point in the history
  7. Revert "pytest-compatible access to np.float128, np.complex256"

    This reverts commit e9a289c.
    Ralf W. Grosse-Kunstleve committed May 19, 2023
    Configuration menu
    Copy the full SHA
    8abe0e9 View commit details
    Browse the repository at this point in the history
  8. Use sizeof(long double) == sizeof(double) instead of std::is_same<>

    Ralf W. Grosse-Kunstleve committed May 19, 2023
    Configuration menu
    Copy the full SHA
    b09e75b View commit details
    Browse the repository at this point in the history
  9. Report skipped long double tests.

    Ralf W. Grosse-Kunstleve committed May 19, 2023
    Configuration menu
    Copy the full SHA
    ba7063e View commit details
    Browse the repository at this point in the history
  10. Change the name of the new buffer_info member function to `item_typ…

    …e_is_equivalent_to`. Add comment defining "equivalent" by example.
    Ralf W. Grosse-Kunstleve committed May 19, 2023
    Configuration menu
    Copy the full SHA
    a4d61b4 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2023

  1. Change item_type_is_equivalent_to<>() from static function to mem…

    …ber function, as suggested by @lalaland
    Ralf W. Grosse-Kunstleve committed May 20, 2023
    Configuration menu
    Copy the full SHA
    ef34d29 View commit details
    Browse the repository at this point in the history