You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation Issues in the test_dataimport.py.
Testing in the test_dataimport.py
mostly just need to figure out how to test against the indexing error
In the dataimport_example
IndexError Traceback (most recent call last)
in
2 directory = '../ramandecompy/tests/test_files/'
3 # open hdf5 file as read/write
----> 4 dataimport.data_import(hdf5_filename,directory)
5 dataprep.view_hdf5(hdf5_filename+'.hdf5')
~\anaconda3\lib\site-packages\ramandecompy-1.0b0-py3.7.egg\ramandecompy\dataimport.py in data_import(hdf5_filename, directory)
45 if filename.startswith('FA_') and filename.endswith('.csv'):
46 locationandfile = directory + filename
---> 47 dataprep.add_experiment(str(hdf5_filename)+'.hdf5', locationandfile)
48 print('Data from {} fit with compound pseudo-Voigt model. Results saved to {}.'.format(filename, hdf5_filename))
49 # printing out to user the status of the import (because it can take a long time if importing a lot of data,
~\anaconda3\lib\site-packages\ramandecompy-1.0b0-py3.7.egg\ramandecompy\dataprep.py in add_experiment(hdf5_filename, exp_filename)
202 specs = specs.split('_')
203 time = specs[-1]
--> 204 temp = specs[-2]
205 # write data to .hdf5
206 exp_file['{}/{}/wavenumber'.format(temp, time)] = data['wavenumber']
IndexError: list index out of range
The text was updated successfully, but these errors were encountered:
kernb2
changed the title
dataimport.py issues
test_dataimport.py and dataimport_example issues
Apr 14, 2020
The issue is a dataprep.addexperiment issue with indexing when the experimental file is formatted wrong like this FA_3.6wt%_400C_12.5s.csv' where the 12.5s with the period is throwing off the index.
Here is the index error
IndexError Traceback (most recent call last)
in
3 oldexphdf5 = h5py.File(hdf5_filename+'.hdf5', 'r+')
4 add_experiment('olddataprep_experiment.hdf5', '../ramandecompy/tests/test_files/FA_3.6wt%_300C_25s.csv')
----> 5 add_experiment('olddataprep_experiment.hdf5', '../ramandecompy/tests/test_files/FA_3.6wt%_400C_12.5s.csv')
6 # dataprep.add_experiment('olddataprep_experiment.hdf5', '../ramandecompy/tests/test_files/FA_3.6wt%_300C_45s.csv')
in add_experiment(hdf5_filename, exp_filename)
118 specs = specs.split('_')
119 time = specs[-1]
--> 120 temp = specs[-2]
121 # write data to .hdf5
122 exp_file['{}/{}/wavenumber'.format(temp, time)] = data['wavenumber']
Documentation Issues in the test_dataimport.py.
Testing in the test_dataimport.py
In the dataimport_example
IndexError Traceback (most recent call last)
in
2 directory = '../ramandecompy/tests/test_files/'
3 # open hdf5 file as read/write
----> 4 dataimport.data_import(hdf5_filename,directory)
5 dataprep.view_hdf5(hdf5_filename+'.hdf5')
~\anaconda3\lib\site-packages\ramandecompy-1.0b0-py3.7.egg\ramandecompy\dataimport.py in data_import(hdf5_filename, directory)
45 if filename.startswith('FA_') and filename.endswith('.csv'):
46 locationandfile = directory + filename
---> 47 dataprep.add_experiment(str(hdf5_filename)+'.hdf5', locationandfile)
48 print('Data from {} fit with compound pseudo-Voigt model. Results saved to {}.'.format(filename, hdf5_filename))
49 # printing out to user the status of the import (because it can take a long time if importing a lot of data,
~\anaconda3\lib\site-packages\ramandecompy-1.0b0-py3.7.egg\ramandecompy\dataprep.py in add_experiment(hdf5_filename, exp_filename)
202 specs = specs.split('_')
203 time = specs[-1]
--> 204 temp = specs[-2]
205 # write data to .hdf5
206 exp_file['{}/{}/wavenumber'.format(temp, time)] = data['wavenumber']
IndexError: list index out of range
The text was updated successfully, but these errors were encountered: