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

unable to run test scripts directly, needed the voyager data. #54

Closed
jeenriquez opened this issue Aug 31, 2018 · 4 comments
Closed

unable to run test scripts directly, needed the voyager data. #54

jeenriquez opened this issue Aug 31, 2018 · 4 comments
Assignees

Comments

@jeenriquez
Copy link
Contributor

This new issue is related to the new tests/data.py. Do we need to add the Voyager_data folder to setup.py somehow?

$ python test_h52fil.py 

Bad key "ckend" on line 1 in
/Users/jeenriquez/.matplotlib/matplotlibrc.
You probably need to get an updated matplotlibrc file from
http://github.com/matplotlib/matplotlib/blob/master/matplotlibrc.template
or from the matplotlib source distribution
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/blimpy-1.3.4-py2.7.egg/tests/Voyager_data/Voyager1.single_coarse.fine_res.h5
Traceback (most recent call last):
  File "test_h52fil.py", line 29, in <module>
    test_h52fil_conversion()
  File "test_h52fil.py", line 16, in test_h52fil_conversion
    bl.h52fil.make_fil_file(voyager_h5, new_filename='test.fil')
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/blimpy-1.3.4-py2.7.egg/blimpy/h52fil.py", line 41, in make_fil_file
    fil_file = Waterfall(filename, max_load = max_load)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/blimpy-1.3.4-py2.7.egg/blimpy/waterfall.py", line 125, in __init__
    load_data=load_data, max_load=max_load)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/blimpy-1.3.4-py2.7.egg/blimpy/file_wrapper.py", line 753, in open_file
    raise IOError("No such file or directory: " + filename)
IOError: No such file or directory: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/blimpy-1.3.4-py2.7.egg/tests/Voyager_data/Voyager1.single_coarse.fine_res.h5
@gijzelaerr
Copy link
Member

after modifying some imports (removing relative (from . import bla) I'm able to run the test file directly:

λ  HDF5_PLUGIN_PATH=../.lib PYTHONPATH=.. ../.venv3/bin/python test_h52fil.py
blimpy.waterfall INFO     Conversion time: 0.11sec
blimpy.file_wrapper WARNING  Selection size of 0.06 GB, exceeding our size limit 0.00 GB. Instance created, header loaded, but data not loaded, please try another (t,v) selection.
blimpy.waterfall INFO     Detecting high frequency resolution data.
blimpy.waterfall INFO     Using 1 n_blobs to write the data.
blimpy.waterfall INFO     Reading 1 of 1
blimpy.waterfall INFO     Conversion time: 0.19sec
blimpy.waterfall INFO     Conversion time: 0.12sec

It looks like you run the test from the source checkout but it is importing blimpy code from an older instllation?

@gijzelaerr
Copy link
Member

forcing the PYTHONPATH to your blimpy source folder should solve this issue. An alternative is to bundle the test files with the installation, which is probably not what you want since it is quite big.

@gijzelaerr
Copy link
Member

@jeenriquez is this solved by setting the PYTHONPATH properly?

@jeenriquez
Copy link
Contributor Author

that fixed it! Thanks Gijs.

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