updated tests (working with nose module "nosetests")
Fixed qcutil.weighted_velocities to run 50x faster (was taking 40-50 sec now only takes 1-2 sec).
Updated most of the tests in src/qccodar/test to work with changes made in qccodar3. This basically fulfills Issue #3
#
[x] test_qc.py
[x] test_read.py
[x] test_radialshorts.py
[ ] test_qccodar_values.py is just a frame and will add asserts next
[ ] test_write.py is failing because hfradarpy is not happy? and will investigate.
Fixed qcutil.weighted_velocities to run 50x faster. It was taking 40-50 sec to complete weighted avg because of indexing into a dataframe in a big loop. This also might be the cause of slowness and CPU overheating on CORE and HATY. I reverted the code to use numpy array to do the weighting and then create a dataframe with the numpy array. Indexing a numpy array is much faster. Now it only takes 1 sec! and verified it is correct by using nosetests. I had to add back get_columns and unique_rows to make this work.
(qccodar) vector:qccodar codar$ nosetests -v ./test
qccodar.test.test_qc.test_no_qc ... ok
qccodar.test.test_qc.test_threshold_qc_doa_peak_power ... ok
qccodar.test.test_qc.test_threshold_qc_doa_half_power_width ... ok
qccodar.test.test_qc.test_threshold_qc_monopole_snr ... ok
qccodar.test.test_qc.test_threshold_qc_loop_snr ... ok
qccodar.test.test_qc.test_threshold_qc_all ... ok
qccodar.test.test_qc.test_weighted_average_mp_weight_angres1 ... ok
qccodar.test.test_qc.test_weighted_average_snr_weight_angres1 ... ok
qccodar.test.test_qc.test_weighted_average_no_weight_angres1 ... ok
qccodar.test.test_qccodar_values.test_load_qccodar_values_from_plist ... ok
qccodar.test.test_qccodar_values.test_qccodar_values_for_qc ... ok
qccodar.test.test_qccodar_values.test_qccodar_values_for_radialshorts ... ok
qccodar.test.test_qccodar_values.test_qccodar_values_for_merge ... ok
qccodar.test.test_radialshorts.test_generate_radialshort_array ... ok
qccodar.test.test_radialshorts.test_generate_radialshort_empty_array_when_no_radial_data ... ok
test_load_data -- Read the file as list of lines ... ok
test_read_lluv_file -- Read typical LLUV data that has data as a Radial object ... ok
test_read_lluv_empty_file -- Read LLUV data that has NO radial data as a Radial object ... ok
Write empty LLUV file output, and test by comparing to readback. ... ERROR
Write typical LLUV file output test by comparing to readback. ... FAIL
Two main updates:
Updated most of the tests in src/qccodar/test to work with changes made in qccodar3. This basically fulfills Issue #3
#
Fixed qcutil.weighted_velocities to run 50x faster. It was taking 40-50 sec to complete weighted avg because of indexing into a dataframe in a big loop. This also might be the cause of slowness and CPU overheating on CORE and HATY. I reverted the code to use numpy array to do the weighting and then create a dataframe with the numpy array. Indexing a numpy array is much faster. Now it only takes 1 sec! and verified it is correct by using nosetests. I had to add back get_columns and unique_rows to make this work.
(qccodar) vector:qccodar codar$ nosetests -v ./test qccodar.test.test_qc.test_no_qc ... ok qccodar.test.test_qc.test_threshold_qc_doa_peak_power ... ok qccodar.test.test_qc.test_threshold_qc_doa_half_power_width ... ok qccodar.test.test_qc.test_threshold_qc_monopole_snr ... ok qccodar.test.test_qc.test_threshold_qc_loop_snr ... ok qccodar.test.test_qc.test_threshold_qc_all ... ok qccodar.test.test_qc.test_weighted_average_mp_weight_angres1 ... ok qccodar.test.test_qc.test_weighted_average_snr_weight_angres1 ... ok qccodar.test.test_qc.test_weighted_average_no_weight_angres1 ... ok qccodar.test.test_qccodar_values.test_load_qccodar_values_from_plist ... ok qccodar.test.test_qccodar_values.test_qccodar_values_for_qc ... ok qccodar.test.test_qccodar_values.test_qccodar_values_for_radialshorts ... ok qccodar.test.test_qccodar_values.test_qccodar_values_for_merge ... ok qccodar.test.test_radialshorts.test_generate_radialshort_array ... ok qccodar.test.test_radialshorts.test_generate_radialshort_empty_array_when_no_radial_data ... ok test_load_data -- Read the file as list of lines ... ok test_read_lluv_file -- Read typical LLUV data that has data as a Radial object ... ok test_read_lluv_empty_file -- Read LLUV data that has NO radial data as a Radial object ... ok Write empty LLUV file output, and test by comparing to readback. ... ERROR Write typical LLUV file output test by comparing to readback. ... FAIL