Open CA4GitHub opened 2 years ago
Thanks for the error report and additional info. I don't currently have access to a Windows system with python 3.9. Perhaps you could check a few additional things:
C:\spectral_test_files
exist after you ran the unit tests and, if so, were there any files in it?import builtins
builtins.open('C:\\spectral_test_files\memmap_test_bil.img', 'wb', 1000)
I've added python 3.9 to the build matrix for unit testing and it passes (on ubuntu):
https://github.com/spectralpython/spectral/actions/runs/1072623339
With spectral 0.22.2 (installed via pip), numpy 1.21.1, and python 3.9.5, the spectral unit tests (e.g. python -m spectral.tests.run) fail. Note I do have the sample data files installed in a dir specified by the environment variable SPECTRAL_DATA.
The tests fail the "Running memep tests" portion as shown in the pic with the error:
I tried manually running memmap tests in memmap.py. It seemed to me that the issue is around the spy.envi.save_image call in create_test_image_file method of SpyFileMemmapTest class. From there it seems like the error is triggered by the builtins.open call in the _write_image method of the envi.py file.