simonsfoundation / inferelator_ng

Inferelator refactor and generalization.
BSD 2-Clause "Simplified" License
7 stars 14 forks source link

test the kvs implementation of bbsr #54

Closed nickdeveaux closed 6 years ago

nickdeveaux commented 6 years ago

There are 2 reasons for working on this: 1) bbsr_python.py has extra code just for testing, which could be simplified if the testing framework used the same utils library as the main codebase. 2) There are some failing tests when using the kvs client that seem to be real failures, and might be due to unforeseen issues in our kvs integration. For example: ====================================================================== FAIL: test_two_genes_nonzero_clr_two_conditions_zero_gene1_positive_influence (inferelator_ng.tests.test_bbsr.TestBBSRrunnerPython)

Traceback (most recent call last): File "/Users/ndeveaux/Dev/inferelator_ng/inferelator_ng/tests/test_bbsr.py", line 178, in test_two_genes_nonzero_clr_two_conditions_zero_gene1_positive_influence pdt.assert_frame_equal(betas, pd.DataFrame([[0, 1],[1, 0]], index = ['gene1', 'gene2'], columns = ['gene1', 'gene2']).astype(float)) File "/usr/local/lib/python2.7/site-packages/pandas/util/testing.py", line 1166, in assert_frame_equal obj='DataFrame.iloc[:, {0}]'.format(i)) File "/usr/local/lib/python2.7/site-packages/pandas/util/testing.py", line 1049, in assert_series_equal check_less_precise, obj='{0}'.format(obj)) File "pandas/src/testing.pyx", line 58, in pandas._testing.assert_almost_equal (pandas/src/testing.c:3887) File "pandas/src/testing.pyx", line 147, in pandas._testing.assert_almost_equal (pandas/src/testing.c:2769) File "/usr/local/lib/python2.7/site-packages/pandas/util/testing.py", line 915, in raise_assert_detail raise AssertionError(msg) AssertionError: DataFrame.iloc[:, 0] are different

DataFrame.iloc[:, 0] values are different (50.0 %) [left]: [0.0, 0.0] [right]: [0.0, 1.0]

codecov-io commented 6 years ago

Codecov Report

Merging #54 into master will decrease coverage by 11.65%. The diff coverage is 61.22%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #54       +/-   ##
===========================================
- Coverage   82.42%   70.76%   -11.66%     
===========================================
  Files          18       18               
  Lines        1451     1471       +20     
===========================================
- Hits         1196     1041      -155     
- Misses        255      430      +175
Impacted Files Coverage Δ
inferelator_ng/bbsr_tfa_workflow.py 0% <0%> (ø) :arrow_up:
inferelator_ng/tests/test_tfa.py 98.87% <100%> (ø) :arrow_up:
inferelator_ng/bbsr_python.py 38.5% <16.66%> (-47.14%) :arrow_down:
inferelator_ng/utils.py 69.38% <50%> (-0.83%) :arrow_down:
inferelator_ng/tests/test_bbsr.py 37.68% <70.27%> (-62.32%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dbb886f...844ce0c. Read the comment docs.

nickdeveaux commented 6 years ago

@dayanne-castro All tests that use KVS have been de-activated on Travis.

To correctly run unittests, set environment variables as in run_inferelator_slurmless.sh, and run tests as:

python $LOCALREPO/kvsstcp.py --execcmd "nosetests -v"

We could possibly put that logic in a script called run_tests.sh

dayanne-castro commented 6 years ago

👍