Skip to content

numpy.in1d removed #1239

@LourensVeen

Description

@LourensVeen

Describe the bug
numpy has removed the numpy.in1d function in numpy 2.4.0.

PeTar and tupan use it, and they're downloaded codes so this really needs to be fixed upstream, and then we need to upgrade to a new version.

To Reproduce
This actually shows up when trying to build the docs after building PeTar and/or tupan, because Sphinx imports everything and then crashes on the downloaded code because numpy.in1d isn't found:

./src/amuse_tupan/src/tupan/tupan/analysis/glviewer.py:102:      [self.ps](http://self.ps/)[np.in1d([self.ps](http://self.ps/).id, ps.id)] = ps
./src/amuse_petar/src/PeTar/tools/analysis/bse.py:463:    sel_history=np.in1d(type_change.bid, bid_merge)
./src/amuse_petar/src/PeTar/tools/analysis/bse.py:470:    sel_merge_init = np.in1d(ubid_history_unique, ubid_merge)
./src/amuse_petar/src/PeTar/tools/get_object_snapshot.py:234:            sel1 = np.in1d(data_temp.p1.id, idlist)
./src/amuse_petar/src/PeTar/tools/get_object_snapshot.py:235:            sel2 = np.in1d(data_temp.p2.id, idlist)
./src/amuse_petar/src/PeTar/tools/get_object_snapshot.py:239:            sel = np.in1d(data_temp.bid, idlist)
./src/amuse_petar/src/PeTar/tools/get_object_snapshot.py:272:            sel = np.in1d(data_temp.id, idlist)

It looks like we may not actually be using these files, so the codes will probably work fine, but it would be nice if we could build the documentation.

Expected behavior
A successful documentation build.

Additional context
Thanks @elkogerville for the report!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions