choderalab / bayesian-itc

Python tools for the analysis and modeling of isothermal titration calorimetry (ITC) experiments.
GNU General Public License v3.0
5 stars 10 forks source link

Doctest failure? #63

Closed jchodera closed 9 years ago

jchodera commented 9 years ago

I'm noting a doctest failure:

[LSKI1497:~/projects/bayesian-itc/bayesian-itc.choderalab] choderaj% nosetests --with-doctest
F./Users/choderaj/anaconda/lib/python2.7/unittest/case.py:340: RuntimeWarning: TestResult has no addExpectedFailure method, reporting as passes
  RuntimeWarning)
................................
======================================================================
FAIL: Doctest: bitc.models.CompetitiveBindingModel.equilibrium_concentrations
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/choderaj/anaconda/lib/python2.7/doctest.py", line 2226, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for bitc.models.CompetitiveBindingModel.equilibrium_concentrations
  File "/Users/choderaj/projects/bayesian-itc/bayesian-itc.choderalab/bitc/models.py", line 634, in equilibrium_concentrations

----------------------------------------------------------------------
File "/Users/choderaj/projects/bayesian-itc/bayesian-itc.choderalab/bitc/models.py", line 655, in bitc.models.CompetitiveBindingModel.equilibrium_concentrations
Failed example:
    C_PLn = equilibrium_concentrations(Ka_n, x_R, x_Ln, V)
Exception raised:
    Traceback (most recent call last):
      File "/Users/choderaj/anaconda/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest bitc.models.CompetitiveBindingModel.equilibrium_concentrations[4]>", line 1, in <module>
        C_PLn = equilibrium_concentrations(Ka_n, x_R, x_Ln, V)
    NameError: name 'equilibrium_concentrations' is not defined

-------------------- >> begin captured logging << --------------------
bitc.units: DEBUG: Using custom pint definition for molar unit.
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 34 tests in 3.451s

FAILED (failures=1)
bas-rustenburg commented 9 years ago

The issue is probably that equilibrium_concentrations is a method belonging to CompetitiveBindingModel, and not a standalone function that can be called as such.

I think it is a useful function as a standalone, so I might separate it out.

bas-rustenburg commented 9 years ago

Also, just want to mention that the nosetests are mostly dummy tests at this point. I define them as expected failures because they haven't been implemented yet.

The only thing that is already being tested is whether all modules can be imported correctly, to check for syntax errors.

jchodera commented 9 years ago

Addressed by #64.

jchodera commented 9 years ago

We encountered an issue where the doctests were being run by the __main__ methods, so this was causing failures.

What is the recommended way to run bitc on data at this point?

bas-rustenburg commented 9 years ago

See the main README

I'm currently using scripts/bitc_util.py as an interface to the library.

jchodera commented 9 years ago

Thanks!