Skip to content

Commit 3a1f139

Browse files
committed
fix params modification
1 parent 5f346c5 commit 3a1f139

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lagrange/decmodel_mp.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
from __future__ import print_function
23
import sys, string, time
34
import scipy
45
import rates
@@ -79,7 +80,9 @@ def __init__(self,
7980
self.dp_range = range(int(max(self.dp_array.flat)))
8081

8182
self.params = [0.01, 0.01]
82-
self.params += [1.0]*max(self.dp_array.flat)
83+
m = int(max(self.dp_array.flat))
84+
if m:
85+
self.params += [1.0]*m
8386
self.setup_D()
8487
self.setup_E()
8588
#t = time.time()
@@ -406,7 +409,7 @@ def test_conditionals(distconds, seglens, model):
406409
"""
407410
distrange = model.distrange
408411
for p, seglen in enumerate(seglens):
409-
print "distconds", distconds
412+
## print "distconds", distconds
410413
P = model.P(p, seglen)
411414
v = scipy.zeros((model.ndists,))
412415
for i in distrange:
@@ -462,11 +465,11 @@ def nondiag_indices(m):
462465
import time
463466
t = time.time()
464467
m1 = DECModel(8)
465-
print time.time() - t, "to create v1"
468+
## print time.time() - t, "to create v1"
466469
from pprint import pprint
467470
t = time.time()
468471
pprint(m1.P(0, 1.33))
469-
print time.time() - t, "to expoentiate"
472+
## print time.time() - t, "to expoentiate"
470473
## import scipy.sparse
471474
## print m.Q[0].shape
472475
## coo = scipy.sparse.coo_matrix(m.Q[0])

0 commit comments

Comments
 (0)