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

Fix compatibility issue on Windows for NumPy 2.x #496

Merged
merged 5 commits into from
Sep 26, 2024

Conversation

jcarpent
Copy link
Contributor

No description provided.

@jcarpent jcarpent marked this pull request as draft August 27, 2024 13:25
@jcarpent
Copy link
Contributor Author

Related to numpy/numpy#26091

@jorisv
Copy link
Contributor

jorisv commented Sep 25, 2024

This patch turn the EIGENPY_ARRAY_API symbol public again (like when building with numpy 1.2x).

I don't understand how this symbol is used by numpy API and I think this can create issue if a library using eigenpy want to use his own XXX_ARRAY_API. Anyway, we had the same issue with numpy 1.2x.

One way to avoid exposing this symbol would be to never call PyArray_ function in our header file. But since we heavily use template, this should only be possible by wrapping all PyArray_ function.

Some pinocchio unit test fail when linking against eigenpy + numpy 2.

@jorisv
Copy link
Contributor

jorisv commented Sep 25, 2024

Issue in Pinocchio seem related to a new way to manage conversion to user type to numpy array.

  • In numpy 2 the signature should be __array__(self, dtype=None, copy=None)
  • In numpy 1.2x the signature should be __array__(self)

Fix in this PR stack-of-tasks/pinocchio#2436

@jorisv jorisv self-assigned this Sep 25, 2024
@jorisv jorisv marked this pull request as ready for review September 25, 2024 10:41
@jorisv
Copy link
Contributor

jorisv commented Sep 25, 2024

@jcarpent I will make a test on Windows and if it's ok we can merge this PR.

@jorisv jorisv marked this pull request as draft September 25, 2024 13:22
@jorisv jorisv marked this pull request as ready for review September 25, 2024 15:00
@jorisv
Copy link
Contributor

jorisv commented Sep 25, 2024

@jcarpent This PR is also working on Windows.

We can merge it.

I will create an issue to add a CI job to build against numpy 1.2x but I will probably do that in the pixi PR.

@jcarpent jcarpent merged commit 9dde142 into stack-of-tasks:devel Sep 26, 2024
35 checks passed
nim65s added a commit to nim65s/robotpkg that referenced this pull request Oct 9, 2024
    ## [3.10.0] - 2024-09-26

    ### Added

    - `GenericMapPythonVisitor`/`StdMapPythonVisitor` can now take an extra visitor argument in the `expose()` method, similar to `StdVectorPythonVisitor`

    ### Changed

    - Move `GenericMapPythonVisitor` to its own header `eigenpy/map.hpp`
    - Rename `overload_base_get_item_for_std_map` to `overload_base_get_item_for_map`, move out of `eigenpy::details` namespace
    - Move `EmptyPythonVisitor` to new header `eigenpy/utils/empty-visitor.hpp`

    ## [3.9.1] - 2024-09-19

    ### Added

    - Add test returning reference of std::pair stack-of-tasks/eigenpy#503
    - Add more general visitor `GenericMapPythonVisitor` for map types test `boost::unordered_map<std::string, int>` stack-of-tasks/eigenpy#504
    - Support for non-[default-contructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible) types in map types stack-of-tasks/eigenpy#504
    - Add type_info helpers stack-of-tasks/eigenpy#502
    - Add NumPy 2 support stack-of-tasks/eigenpy#496

    ### Changed

    - Move `StdMapPythonVisitor` out of `eigenpy::python` namespace, which was a mistake stack-of-tasks/eigenpy#504

    ## [3.9.0] - 2024-08-31

    ### Changed
    - The `exposeStdVectorEigenSpecificType()` template function now takes the vector allocator as a template parameter stack-of-tasks/eigenpy#500

    ### Added
    - Add bp::dist to std::map converter stack-of-tasks/eigenpy#499

    ## [3.8.2] - 2024-08-26

    ### Fixed
    - Fix function signature on Windows stack-of-tasks/eigenpy#494

    ## [3.8.1] - 2024-08-25

    ### Fixed
    - Fix compatibility issue with NumPy 2.x on Windows stack-of-tasks/eigenpy#492

    ## [3.8.0] - 2024-08-14

    ### Added
    - Add compatibility with jrl-cmakemodules workspace stack-of-tasks/eigenpy#485
    - Remove support of Python 3.7 stack-of-tasks/eigenpy#490

    ### Fixed
    - Remove CMake CMP0167 warnings stack-of-tasks/eigenpy#487
    - Fix compilation error on armhf stack-of-tasks/eigenpy#488
nim65s added a commit to nim65s/robotpkg that referenced this pull request Oct 11, 2024
    ## [3.10.0] - 2024-09-26

    ### Added

    - `GenericMapPythonVisitor`/`StdMapPythonVisitor` can now take an extra visitor argument in the `expose()` method, similar to `StdVectorPythonVisitor`

    ### Changed

    - Move `GenericMapPythonVisitor` to its own header `eigenpy/map.hpp`
    - Rename `overload_base_get_item_for_std_map` to `overload_base_get_item_for_map`, move out of `eigenpy::details` namespace
    - Move `EmptyPythonVisitor` to new header `eigenpy/utils/empty-visitor.hpp`

    ## [3.9.1] - 2024-09-19

    ### Added

    - Add test returning reference of std::pair stack-of-tasks/eigenpy#503
    - Add more general visitor `GenericMapPythonVisitor` for map types test `boost::unordered_map<std::string, int>` stack-of-tasks/eigenpy#504
    - Support for non-[default-contructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible) types in map types stack-of-tasks/eigenpy#504
    - Add type_info helpers stack-of-tasks/eigenpy#502
    - Add NumPy 2 support stack-of-tasks/eigenpy#496

    ### Changed

    - Move `StdMapPythonVisitor` out of `eigenpy::python` namespace, which was a mistake stack-of-tasks/eigenpy#504

    ## [3.9.0] - 2024-08-31

    ### Changed
    - The `exposeStdVectorEigenSpecificType()` template function now takes the vector allocator as a template parameter stack-of-tasks/eigenpy#500

    ### Added
    - Add bp::dist to std::map converter stack-of-tasks/eigenpy#499

    ## [3.8.2] - 2024-08-26

    ### Fixed
    - Fix function signature on Windows stack-of-tasks/eigenpy#494

    ## [3.8.1] - 2024-08-25

    ### Fixed
    - Fix compatibility issue with NumPy 2.x on Windows stack-of-tasks/eigenpy#492

    ## [3.8.0] - 2024-08-14

    ### Added
    - Add compatibility with jrl-cmakemodules workspace stack-of-tasks/eigenpy#485
    - Remove support of Python 3.7 stack-of-tasks/eigenpy#490

    ### Fixed
    - Remove CMake CMP0167 warnings stack-of-tasks/eigenpy#487
    - Fix compilation error on armhf stack-of-tasks/eigenpy#488
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants