AmpersandTV / pymc3-hmm

Hidden Markov models in PyMC3
Other
94 stars 13 forks source link

Add a Horseshoe prior Gibbs sampler #96

Closed xjing76 closed 2 years ago

xjing76 commented 2 years ago

Adding in Horsehoes gibbs and tests

xjing76 commented 2 years ago

@brandonwillard I just added the test cases for pm.Deterministic But when I am testing for that case it seems like within the step function the point (samples for beta)would be of wrong size. Could you take a look at this. I couldn't figure out why

xjing76 commented 2 years ago

@brandonwillard I just added the test cases for pm.Deterministic But when I am testing for that case it seems like within the step function the point (samples for beta)would be of wrong size. Could you take a look at this. I couldn't figure out why

I think what is happening is that when we compile the function for mu the sample results we are getting is actually (M, M) instead of (M, 1)

xjing76 commented 2 years ago

@brandonwillard Do you mind to take a look at line 554 that wasn't passing the coverage test ? When i put in the breakpoint() right before it I am able to get a break when I testing locally. However, for coverage test is just not passing.

brandonwillard commented 2 years ago

@brandonwillard Do you mind to take a look at line 554 that wasn't passing the coverage test ? When i put in the breakpoint() right before it I am able to get a break when I testing locally. However, for coverage test is just not passing.

There's nothing that stands out from inspection alone. You'll need to look into the testing workflow and/or coverage settings to see if that's where the issue is.

Try adding a commit that outputs a debug print statement and see if it appears in the CI output (and exclusively runs the relevant test). You can remove the debug commit afterward.

xjing76 commented 2 years ago

I think I am able to create a minimal example with foo.py

def foo():
    for i in range(10):
        if i < 10:
            pass
        else :
            continue
    return 5

def foo2():
    for i in range(10):
        if i < 9:
            pass
        else:
            continue
    return 5

test_foo.py

from poj.foo import foo,  foo2
def test_foo():
    assert foo() == 5
    assert foo2() == 5

Both of the continue is reported not covered.

I reported this issue here

jeffreyenos commented 2 years ago

It looks like this coverage issue is documented in nedbat/coveragepy#198 and is fixed with Python 3.10.

brandonwillard commented 2 years ago

It looks like this coverage issue is documented in nedbat/coveragepy#198 and is fixed with Python 3.10.

Then we can just mark it as no cover (or whatever serves that purpose).