pocketpy / gsoc-2024-dev

GSoC'24 develop repository for pybind11 and numpy
https://pocketpy.dev/gsoc/ideas/
6 stars 1 forks source link

Divergence in pybind11 executables #45

Closed faze-geek closed 2 weeks ago

faze-geek commented 1 month ago

Hi with the latest merged PR we have all the requirements to compile test_numpy.py .

When I run the tests with the exectable I build locally with the original pybind11 it passes all the tests.

(base) anurag@Anurags-MacBook-Air build % python3 test_numpy.py
(base) anurag@Anurags-MacBook-Air build % 

While with pocketpy pybind11 it fails here -

(base) anurag@Anurags-MacBook-Air gsoc-2024-dev % build/gsoc2024
Traceback (most recent call last):
  File "<exec>", line 32
    assert_equal(a + 1, np.array([[2., 2., 2.], [2., 2., 2.]]))
  File "<exec>", line 30, in assert_equal
    assert (a == b).all()
AttributeError: 'bool' object has no attribute 'all'
faze-geek commented 1 month ago

On adding a print statement before the line,

print(a + 1 == np.array([[2., 2., 2.], [2., 2., 2.]]))
assert_equal(a + 1, np.array([[2., 2., 2.], [2., 2., 2.]]))

original pybind11 executable (expected) -

(base) anurag@Anurags-MacBook-Air build % python3 test_numpy.py
[[ true,  true,  true],
       [ true,  true,  true]]

pocketpy pybind11 executable -

(base) anurag@Anurags-MacBook-Air gsoc-2024-dev % build/gsoc2024
False
Traceback (most recent call last):
  File "<exec>", line 33
    assert_equal(a + 1, np.array([[2., 2., 2.], [2., 2., 2.]]))
  File "<exec>", line 30, in assert_equal
    assert (a == b).all()
AttributeError: 'bool' object has no attribute 'all'
16bit-ykiko commented 2 weeks ago

fixed in v2.