BIMSBbioinfo / scregseg

Single-cell regulatory landscape segmentation
GNU General Public License v3.0
5 stars 2 forks source link

doctest failure #7

Closed rekado closed 1 year ago

rekado commented 1 year ago

Hi, upon running the tests I get one failure:

src/scregseg/hmm.py::scregseg.hmm.DirMulHMM FAILED                       [ 16%]
tests/test_loglikelihood.py::test_loglikelihood PASSED                   [ 33%]
tests/test_loglikelihood.py::test_loglikelihood2 PASSED                  [ 50%]
tests/test_loglikelihood.py::test_loglikelihood3 PASSED                  [ 66%]
tests/test_loglikelihood.py::test_loglikelihood4 PASSED                  [ 83%]
tests/test_scregseg.py::test_hmm PASSED                                  [100%]

=================================== FAILURES ===================================
_______________________ [doctest] scregseg.hmm.DirMulHMM _______________________
213     transmat\_ : array, shape (n_components, n_components)
214         Matrix of transition probabilities between states.
215     startprob\_ : array, shape (n_components, )
216         Initial state occupation distribution.
217     emissionprob\_ : array, shape (n_components, n_features)
218         Probability of emitting a given symbol when in each state.
219     Examples
220     --------
221     >>> from hmmlearn.hmm import MultinomialHMM
222     >>> DirMulHMM(n_components=2)
Expected:
    DirMulHMM(algorithm='viterbi',...
Got:
    DirMulHMM(n_components=2)

We're using version 0.2.7 of hmmlearn.

rekado commented 1 year ago

Thanks for addressing this so quickly. I'm a little confused about the fix, though, as I'm still getting an error:

=================================== FAILURES ===================================
_______________________ [doctest] scregseg.hmm.DirMulHMM _______________________
219         Monitor object used to check the convergence of EM.
220     transmat\_ : array, shape (n_components, n_components)
221         Matrix of transition probabilities between states.
222     startprob\_ : array, shape (n_components, )
223         Initial state occupation distribution.
224     emissionprob\_ : array, shape (n_components, n_features)
225         Probability of emitting a given symbol when in each state.
226     Examples
227     --------
228     >>> from hmmlearn.hmm import DirMulHMM
UNEXPECTED EXCEPTION: ImportError("cannot import name 'DirMulHMM' from 'hmmlearn.hmm' (/gnu/store/xr4v0fccvv7ynhs9zp9wjhjq3g4gpqqa-python-hmmlearn-0.2.8/lib/python3.9/site-packages/hmmlearn/hmm.py)")
Traceback (most recent call last):
  File "/gnu/store/65i3nhcwmz0p8rqbg48gaavyky4g4hwk-python-3.9.9/lib/python3.9/doctest.py", line 1334, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest scregseg.hmm.DirMulHMM[0]>", line 1, in <module>
ImportError: cannot import name 'DirMulHMM' from 'hmmlearn.hmm' (/gnu/store/xr4v0fccvv7ynhs9zp9wjhjq3g4gpqqa-python-hmmlearn-0.2.8/lib/python3.9/site-packages/hmmlearn/hmm.py)
/tmp/guix-build-scregseg-0.1.2.drv-0/source/src/scregseg/hmm.py:228: UnexpectedException

DirMulHMM is not defined in hmmlearn.hmm --- why import it from there then?

wkopp commented 1 year ago

My bad, the import should have been from scregseg.hmm. I'll fix this.

rekado commented 1 year ago

Perfect, thank you! I updated the scregseg package in GNU Guix.

wkopp commented 1 year ago

Thank you!