spectral icon indicating copy to clipboard operation
spectral copied to clipboard

Test failure

Open adamjstewart opened this issue 2 months ago • 9 comments

When running the unit tests, I get stuck at:

------------------------------------------------------------------------
Running SpyFile read tests on BSQ complex128 little-endian file without memmap...
------------------------------------------------------------------------
Testing getitem_i_j......................................... OK
Testing getitem_i_j_k....................................... OK
Testing getitem_i_j_kslice.................................. OK
Testing getitem_islice_jslice............................... OK
Testing load................................................ OK
Testing read_band........................................... OK
Testing read_bands.......................................... OK
Testing read_bands_duplicates............................... OK
Testing read_bands_nonascending............................. OK
Testing read_datum.......................................... OK
Testing read_pixel.......................................... OK
Testing read_subimage....................................... OK
Testing read_subregion...................................... OK
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/Adam/Downloads/spectral/spectral/tests/run.py", line 47, in <module>
    test.run()
    ~~~~~~~~^^
  File "/Users/Adam/Downloads/spectral/spectral/tests/spyfile.py", line 348, in run
    tests = create_complex_test_files(dtypes)
  File "/Users/Adam/Downloads/spectral/spectral/tests/spyfile.py", line 319, in create_complex_test_files
    spy.envi.save_image(fname, X)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/Adam/Downloads/spectral/spectral/io/envi.py", line 470, in save_image
    _write_image(hdr_file, data, metadata, **kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Adam/Downloads/spectral/spectral/io/envi.py", line 688, in _write_image
    (hdr_file, img_file) = check_new_filename(hdr_file, img_ext, force)
                           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Adam/Downloads/spectral/spectral/io/envi.py", line 390, in check_new_filename
    raise EnviException('Header file %s already exists. Use `force` '
                        'keyword to force overwrite.' % hdr_file)
spectral.io.envi.EnviException: Header file /Users/Adam/Downloads/spectral/spectral_test_files/test_complex64.hdr already exists. Use `force` keyword to force overwrite.

Adding force=True helps, but I'm not sure if this is a test cleanup problem.

Next bug:

------------------------------------------------------------------------
Running continuum tests.
------------------------------------------------------------------------
Testing 2d_array............................................ OK
Testing 3d_array............................................ OK
Testing few_simple_cases.................................... OK
Testing out_parameter....................................... OK
Testing simple_segmented.................................... OK
Testing points_of_real_spectrum............................. OK
Testing points_of_real_spectrum_segmented................... OK
Testing in_and_out_same..................................... FAILED
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/Adam/Downloads/spectral/spectral/tests/run.py", line 47, in <module>
    test.run()
    ~~~~~~~~^^
  File "/Users/Adam/Downloads/spectral/spectral/tests/continuum.py", line 243, in run
    T().run()
    ~~~~~~~^^
  File "/Users/Adam/Downloads/spectral/spectral/tests/spytest.py", line 57, in run
    method()
    ~~~~~~^^
  File "/Users/Adam/Downloads/spectral/spectral/tests/continuum.py", line 234, in test_in_and_out_same
    assert (res[1, 1, 200] == 0.8372113957762342)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Not sure what's wrong here.

adamjstewart avatar Sep 29 '25 14:09 adamjstewart