Skip to content

Commit

Permalink
removed remaining xarrax references
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsebfischer committed Aug 25, 2019
1 parent 72d73fc commit 1d10086
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 26 deletions.
1 change: 0 additions & 1 deletion batchglm/models/base/external.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
import batchglm.pkg_constants as pkg_constants
import batchglm.data as data_utils
from batchglm.xarray_sparse import SparseXArrayDataSet, SparseXArrayDataArray
7 changes: 3 additions & 4 deletions batchglm/models/glm_nb/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import anndata
except ImportError:
anndata = None
import xarray as xr
import numpy as np

from .external import _ModelGLM
Expand All @@ -27,7 +26,7 @@ def inverse_link_scale(self, data):
return np.exp(data)

@property
def eta_loc(self) -> xr.DataArray:
def eta_loc(self) -> np.ndarray:
eta = np.matmul(self.design_loc, self.a)
if self.size_factors is not None:
eta += np.expand_dims(self.size_factors, axis=1)
Expand All @@ -36,9 +35,9 @@ def eta_loc(self) -> xr.DataArray:
# Re-parameterizations:

@property
def mu(self) -> xr.DataArray:
def mu(self) -> np.ndarray:
return self.location

@property
def phi(self) -> xr.DataArray:
def phi(self) -> np.ndarray:
return self.scale
5 changes: 2 additions & 3 deletions batchglm/train/tf/base_glm/estimator_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import numpy as np
import tensorflow as tf
import xarray as xr

try:
import anndata
Expand Down Expand Up @@ -1243,8 +1242,8 @@ def __init__(
num_scale_params: int,
graph: tf.Graph,
batch_size: int,
constraints_loc: xr.DataArray,
constraints_scale: xr.DataArray,
constraints_loc: np.ndarray,
constraints_scale: np.ndarray,
dtype: str
):
"""
Expand Down
11 changes: 4 additions & 7 deletions batchglm/train/tf/base_glm_all/estimator_graph.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
from typing import Union
import logging

import tensorflow as tf
import numpy as np
import xarray as xr
import tensorflow as tf
from typing import Union

from .external import EstimatorGraphGLM, FullDataModelGraphGLM, BatchedDataModelGraphGLM, ModelVarsGLM
from .external import op_utils
from .external import pkg_constants

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -372,8 +369,8 @@ def __init__(
num_design_scale_params,
num_loc_params,
num_scale_params,
constraints_loc: xr.DataArray,
constraints_scale: xr.DataArray,
constraints_loc: np.ndarray,
constraints_scale: np.ndarray,
graph: tf.Graph,
batch_size: int,
init_a,
Expand Down
4 changes: 1 addition & 3 deletions batchglm/train/tf/glm_nb/model.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import logging

import tensorflow as tf

import numpy as np
import tensorflow as tf

from .external import ProcessModelGLM, ModelVarsGLM, BasicModelGraphGLM
from .external import pkg_constants
Expand Down
8 changes: 0 additions & 8 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ Preprocessing
:toctree: .

data.design_matrix
data.design_matrix_from_xarray
data.design_matrix_from_anndata
data.sample_description_from_xarray
data.sample_description_from_anndata
data.load_mtx_to_adata
data.load_mtx_to_xarray
data.load_recursive_mtx
data.xarray_from_data


Fitting models
Expand Down

0 comments on commit 1d10086

Please sign in to comment.