Skip to content

Commit db83227

Browse files
committed
cleanup imports
1 parent 9300b9e commit db83227

File tree

8 files changed

+2
-49
lines changed

8 files changed

+2
-49
lines changed

batchglm/models/base_glm/model.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
import dask.array
66
import numpy as np
7-
8-
try:
9-
import anndata
10-
except ImportError:
11-
anndata = None
12-
137
import scipy
148

159
from ...utils.input import InputDataGLM

batchglm/models/base_glm/utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010

1111
from .external import groupwise_solve_lm
1212

13-
try:
14-
import anndata
15-
except ImportError:
16-
anndata = None
17-
1813
logger = logging.getLogger("batchglm")
1914

2015

batchglm/models/glm_beta/model.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
from typing import Any, Callable, Dict, Optional, Tuple, Union
33

44
import dask
5-
6-
try:
7-
import anndata
8-
except ImportError:
9-
anndata = None
105
import numpy as np
116

127
from .external import _ModelGLM

batchglm/models/glm_nb/model.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
import abc
2-
3-
try:
4-
import anndata
5-
except ImportError:
6-
anndata = None
72
from typing import Any, Callable, Dict, Optional, Tuple, Union
83

94
import dask.array

batchglm/models/glm_norm/model.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
from typing import Any, Callable, Dict, Optional, Tuple, Union
33

44
import dask
5-
6-
try:
7-
import anndata
8-
except ImportError:
9-
anndata = None
105
import numpy as np
116

127
from .external import _ModelGLM

batchglm/train/numpy/glm_nb/estimator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def __init__(
2626
# batch_size: Optional[Union[Tuple[int, int], int]] = None,
2727
quick_scale: bool = False,
2828
dtype: str = "float64",
29-
**kwargs
3029
):
3130
"""
3231
Performs initialisation and creates a new estimator.

batchglm/utils/data.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@
66
import pandas as pd
77
import patsy
88

9-
try:
10-
import anndata
11-
12-
try:
13-
from anndata.base import Raw
14-
except ImportError:
15-
from anndata import Raw
16-
except ImportError:
17-
anndata = None
18-
Raw = None
19-
209
logger = logging.getLogger("batchglm")
2110

2211

batchglm/utils/input.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
try:
2-
import anndata
3-
4-
try:
5-
from anndata.base import Raw
6-
except ImportError:
7-
from anndata import Raw
8-
except ImportError:
9-
anndata = None
10-
Raw = None
111
import logging
122
from operator import indexOf
133
from typing import List, Optional, Union
144

5+
import anndata
156
import dask.array
167
import numpy as np
178
import pandas as pd
@@ -132,7 +123,7 @@ def __init__(
132123
or isinstance(data, dask.array.core.Array)
133124
):
134125
self.x = data
135-
elif isinstance(data, anndata.AnnData) or isinstance(data, Raw):
126+
elif isinstance(data, anndata.AnnData) or isinstance(data, anndata.Raw):
136127
self.x = data.X
137128
else:
138129
raise ValueError("type of data %s not recognized" % type(data))

0 commit comments

Comments
 (0)