So it's not only line 22 that causes the hang; turning things back on gradually to find the 2nd cause
import pandas as pd
import keanu as kn
import numpy as np
+def test_temp_pass():
+ assert True
+def test_temp_fail():
+ assert False
def test_coalmining():
FILE = "data/coal-mining-disaster-data.csv"
@@ -15,12 +19,11 @@ def test_coalmining():
m.late_rate = kn.Exponential(1.0)
m.years = np.array(data.index)
- m.beforeSwitch = False
# m.beforeSwitch = m.switchpoint > m.years
- m.rates = kn.DoubleIf([1, 1], m.beforeSwitch, m.early_rate, m.late_rate)
- m.disasters = kn.Poisson(m.rates)
+ # m.rates = kn.DoubleIf([1, 1], beforeSwitch, m.early_rate, m.late_rate)
+ # m.disasters = kn.Poisson(m.rates)
- m.disasters.observe(data.values)
+ # m.disasters.observe(data.values)
net = kn.BayesNet(m.switchpoint.getConnectedGraph())
posterior_dist_samples = kn.MetropolisHastings().get_posterior_samples(net, net.getLatentVertices(), 50000)
@@ -28,3 +31,4 @@ def test_coalmining():
switch_year = posterior_dist_samples.getIntegerTensorSamples(m.switchpoint.unwrap()).getScalarMode()
assert switch_year == 1890
+
\ No newline at end of file
