Skip to content

Commit cc73de4

Browse files
intermediate commit towards xarray depreceation
1 parent 06cd1da commit cc73de4

19 files changed

+402
-511
lines changed

diffxpy/api/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from diffxpy.testing.utils import constraint_matrix_from_string, constraint_matrix_from_dict, \
22
constraint_system_from_star
3-
from diffxpy.testing.utils import design_matrix, design_matrix_from_xarray, design_matrix_from_anndata
3+
from diffxpy.testing.utils import design_matrix
44
from diffxpy.testing.utils import view_coef_names, preview_coef_names

diffxpy/models/batch_bfgs/optim.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
class Estim_BFGS_Model():
1717

1818
def __init__(self, Estim_BFGS, nproc):
19-
self._num_observations = Estim_BFGS.X.shape[0]
20-
self._num_features = Estim_BFGS.X.shape[1]
19+
self._num_observations = Estim_BFGS.x.shape[0]
20+
self._num_features = Estim_BFGS.x.shape[1]
2121
self._features = Estim_BFGS.feature_names
22-
self._observations = Estim_BFGS.X.shape[0]
22+
self._observations = Estim_BFGS.x.shape[0]
2323
self._design_loc = Estim_BFGS.design_loc
2424
self._design_scale = Estim_BFGS.design_scale
2525
self._loss = xr.DataArray(Estim_BFGS.full_loss(nproc))
2626
self._log_probs = -self._loss
2727
self._probs = np.exp(self._log_probs)
2828
self._mles = xr.DataArray(np.transpose(Estim_BFGS.mles()))
29-
self._gradient = xr.DataArray(np.zeros([Estim_BFGS.X.shape[1]]))
29+
self._gradient = xr.DataArray(np.zeros([Estim_BFGS.x.shape[1]]))
3030
self._fisher_inv = xr.DataArray(Estim_BFGS.fisher_inv)
3131
self._idx_loc = np.arange(0, Estim_BFGS.design_loc.shape[1])
3232
self._idx_scale = np.arange(Estim_BFGS.design_loc.shape[1],

diffxpy/stats/stats.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import numpy as np
44
import numpy.linalg
55
import scipy.stats
6-
import xarray as xr
76

87

98
def likelihood_ratio_test(
@@ -264,8 +263,6 @@ def wald_test_chisq(
264263

265264
theta_diff = theta_mle - theta0
266265
# Convert to nd.array to avoid gufunc error.
267-
if isinstance(theta_diff, xr.DataArray):
268-
theta_diff = theta_diff.values
269266
wald_statistic = np.array([
270267
np.matmul(
271268
np.matmul(

0 commit comments

Comments
 (0)