Skip to content

Tests fail with NumPy 2.3.1 #347

@Hellseher

Description

@Hellseher

Hi,

While refreshing NumPy stack in Guix I've noticed that blosc@1.11.3 starts failing on check phase:

starting phase `check'
Using custom
<frozen runpy>:128: RuntimeWarning: 'blosc.test' found in sys.modules after import of package 'blosc', but prior to execution of 'blosc.test'; this may result in unpredictable behaviour
test_all_compressors (__main__.TestCodec.test_all_compressors) ... ok
test_all_filters (__main__.TestCodec.test_all_filters) ... ok
test_basic_codec (__main__.TestCodec.test_basic_codec) ... ok
test_bithuffle_leftovers (__main__.TestCodec.test_bithuffle_leftovers) ... ok
test_bitshuffle_not_multiple (__main__.TestCodec.test_bitshuffle_not_multiple) ... ok
test_cbuffer_validate (__main__.TestCodec.test_cbuffer_validate) ... ok
test_cbuffer_validate_failures (__main__.TestCodec.test_cbuffer_validate_failures) ... ok
test_compress_exceptions (__main__.TestCodec.test_compress_exceptions) ... ok
test_compress_input_types (__main__.TestCodec.test_compress_input_types) ... ok
test_compress_ptr_exceptions (__main__.TestCodec.test_compress_ptr_exceptions) ... ok
test_decompress_exceptions (__main__.TestCodec.test_decompress_exceptions) ... ok
test_decompress_input_types (__main__.TestCodec.test_decompress_input_types) ... ok
test_decompress_input_types_as_bytearray (__main__.TestCodec.test_decompress_input_types_as_bytearray) ... ok
test_decompress_ptr_exceptions (__main__.TestCodec.test_decompress_ptr_exceptions) ... ok
test_decompress_ptr_input_types (__main__.TestCodec.test_decompress_ptr_input_types) ... ok
test_decompress_releasegil (__main__.TestCodec.test_decompress_releasegil) ... ok
test_get_blocksize (__main__.TestCodec.test_get_blocksize) ... ok
test_get_cbuffer_sizes (__main__.TestCodec.test_get_cbuffer_sizes) ... ok
test_get_clib (__main__.TestCodec.test_get_clib) ... ok
test_no_leaks (__main__.TestCodec.test_no_leaks) ... ok
test_pack_array_exceptions (__main__.TestCodec.test_pack_array_exceptions) ... ok
test_set_nthreads_exceptions (__main__.TestCodec.test_set_nthreads_exceptions) ... ok
test_unpack_array_exceptions (__main__.TestCodec.test_unpack_array_exceptions) ... ok
test_unpack_array_with_from_py27_exceptions (__main__.TestCodec.test_unpack_array_with_from_py27_exceptions) ... ok
test_unpack_array_with_unicode_characters (__main__.TestCodec.test_unpack_array_with_unicode_characters) ... ok
test_unpack_array_with_unicode_characters_from_py27 (__main__.TestCodec.test_unpack_array_with_unicode_characters_from_py27) ... ok
cbuffer_validate (blosc.toplevel)
Doctest: blosc.toplevel.cbuffer_validate ... ok
compress (blosc.toplevel)
Doctest: blosc.toplevel.compress ... ok
compress_ptr (blosc.toplevel)
Doctest: blosc.toplevel.compress_ptr ... FAIL
decompress (blosc.toplevel)
Doctest: blosc.toplevel.decompress ... ok
decompress_ptr (blosc.toplevel)
Doctest: blosc.toplevel.decompress_ptr ... ok
free_resources (blosc.toplevel)
Doctest: blosc.toplevel.free_resources ... ok
get_blocksize (blosc.toplevel)
Doctest: blosc.toplevel.get_blocksize ... ok
get_cbuffer_sizes (blosc.toplevel)
Doctest: blosc.toplevel.get_cbuffer_sizes ... ok
pack_array (blosc.toplevel)
Doctest: blosc.toplevel.pack_array ... ok
set_blocksize (blosc.toplevel)
Doctest: blosc.toplevel.set_blocksize ... ok
set_nthreads (blosc.toplevel)
Doctest: blosc.toplevel.set_nthreads ... ok
set_releasegil (blosc.toplevel)
Doctest: blosc.toplevel.set_releasegil ... ok
unpack_array (blosc.toplevel)
Doctest: blosc.toplevel.unpack_array ... ok

======================================================================
FAIL: compress_ptr (blosc.toplevel)
Doctest: blosc.toplevel.compress_ptr
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/gnu/store/1qmk0ip6gvjs9i9pwj74n4yddqcl45rg-python-3.11.11/lib/python3.11/doctest.py", line 2243, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for blosc.toplevel.compress_ptr
  File "/tmp/guix-build-python-blosc-1.11.3.drv-0/blosc-1.11.3/blosc/toplevel.py", line 455, in compress_ptr

----------------------------------------------------------------------
File "/tmp/guix-build-python-blosc-1.11.3.drv-0/blosc-1.11.3/blosc/toplevel.py", line 515, in blosc.toplevel.compress_ptr
Failed example:
    np_ans = numpy.fromstring(d, dtype=np_array.dtype)
Exception raised:
    Traceback (most recent call last):
      File "/gnu/store/1qmk0ip6gvjs9i9pwj74n4yddqcl45rg-python-3.11.11/lib/python3.11/doctest.py", line 1355, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest blosc.toplevel.compress_ptr[5]>", line 1, in <module>
        np_ans = numpy.fromstring(d, dtype=np_array.dtype)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ValueError: The binary mode of fromstring is removed, use frombuffer instead
----------------------------------------------------------------------
File "/tmp/guix-build-python-blosc-1.11.3.drv-0/blosc-1.11.3/blosc/toplevel.py", line 516, in blosc.toplevel.compress_ptr
Failed example:
    bool((np_array == np_ans).all())
Exception raised:
    Traceback (most recent call last):
      File "/gnu/store/1qmk0ip6gvjs9i9pwj74n4yddqcl45rg-python-3.11.11/lib/python3.11/doctest.py", line 1355, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest blosc.toplevel.compress_ptr[6]>", line 1, in <module>
        bool((np_array == np_ans).all())
                          ^^^^^^
    NameError: name 'np_ans' is not defined


----------------------------------------------------------------------
Ran 39 tests in 2.839s

FAILED (failures=1)
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/tmp/guix-build-python-blosc-1.11.3.drv-0/blosc-1.11.3/blosc/test.py", line 369, in <module>
    run()
  File "/tmp/guix-build-python-blosc-1.11.3.drv-0/blosc-1.11.3/blosc/test.py", line 364, in run
    assert unittest.TextTestRunner(verbosity=verbosity).\
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
python-blosc version: 1.11.3
Blosc version: 1.21.1 ($Date:: 2021-10-06 #$)
Compressors available: ['blosclz', 'lz4', 'lz4hc', 'zlib', 'zstd']
Compressor library versions:
  BloscLZ: 2.5.1
  LZ4: 1.10.0
  Zlib: 1.3.1
  Zstd: 1.5.6
Python version: 3.11.11 (main, Jan  1 1970, 00:00:01) [GCC 14.3.0]
Platform: Linux-6.16.7-x86_64 (#1 SMP PREEMPT_DYNAMIC 1)
Processor: not recognized
Byte-ordering: little
Detected cores: 16
Number of threads to use by default: 8
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
error: in phase 'check': uncaught exception:

It's ok with NumPy 1.26.4

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