Skip to content

migration to numpy 2 #194

@arnolegendre

Description

@arnolegendre

Hello,

I am currently using Pandana for its efficient implementation of Contraction Hierarchies for fast routing computations. However, I am experiencing compatibility issues when trying to run it in a Python 3.12 environment with NumPy 2.1.3.

I attempted to compile Pandana from source, and the compilation seemed successful. However, when I try to instantiate a network and run the example script, I encounter the following error:

Building network from file: 'D:\\Users\\AL\\repos\\pandana\\tests\\osm_sample.h5'
Traceback (most recent call last):
  File "D:\Users\AL\repos\pandana\examples\simple_example.py", line 41, in <module>
    net = pdna.Network(nodes.x, nodes.y, edges["from"], edges.to,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\users\al\repos\pandana\pandana\network.py", line 94, in __init__
    self.net = cyaccess(
               ^^^^^^^^^
  File "src\\cyaccess.pyx", line 59, in pandana.cyaccess.cyaccess.__cinit__
    def __cinit__(
ValueError: Buffer dtype mismatch, expected 'long' but got 'long long'
D:\Users\AL\venv\venv_py312_2502\Lib\site-packages\tables\file.py:130: UnclosedFileWarning: Closing remaining open file: D:\Users\AL\repos\pandana\tests\osm_sample.h5
  warnings.warn(UnclosedFileWarning(msg))

Is there any plan to update Pandana for compatibility with NumPy 2.x? I would appreciate any guidance on resolving this issue or suggestions for alternative libraries that could meet my fast routing needs.

Thank you for your assistance!

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