Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit Tests Fail #126

Open
CA4GitHub opened this issue Jul 26, 2021 · 2 comments
Open

Unit Tests Fail #126

CA4GitHub opened this issue Jul 26, 2021 · 2 comments

Comments

@CA4GitHub
Copy link

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:

image

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.

@tboggs
Copy link
Member

tboggs commented Jul 27, 2021

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:

  1. Did the directory C:\spectral_test_files exist after you ran the unit tests and, if so, were there any files in it?
  2. Does the following work for you from the python command line?
import builtins
builtins.open('C:\\spectral_test_files\memmap_test_bil.img', 'wb', 1000)

@tboggs
Copy link
Member

tboggs commented Jul 27, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants