Skip to content

Commit b57229f

Browse files
sped up log fold change computaiton on continuous model and forced dask array evaluation in trajectory computation
1 parent 56a2ea3 commit b57229f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

batchglm/models/base/estimator.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import abc
2+
import dask
23
from enum import Enum
34
import logging
45
import numpy as np
@@ -76,11 +77,17 @@ def x(self) -> np.ndarray:
7677

7778
@property
7879
def a_var(self):
79-
return self.model.a_var
80+
if isinstance(self.model.a_var, dask.array.core.Array):
81+
return self.model.a_var.compute()
82+
else:
83+
return self.model.a_var
8084

8185
@property
8286
def b_var(self) -> np.ndarray:
83-
return self.model.b_var
87+
if isinstance(self.model.b_var, dask.array.core.Array):
88+
return self.model.b_var.compute()
89+
else:
90+
return self.model.b_var
8491

8592
@abc.abstractmethod
8693
def initialize(self, **kwargs):

0 commit comments

Comments
 (0)