Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dsm-72 committed Nov 9, 2023
1 parent 24acbd6 commit 159df1d
Show file tree
Hide file tree
Showing 11 changed files with 710 additions and 46 deletions.
2 changes: 1 addition & 1 deletion gnr/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.1"
__version__ = "0.0.5"
2 changes: 1 addition & 1 deletion gnr/fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from statsmodels.tsa.stattools import grangercausalitytests

# %% ../nbs/02_fn.ipynb 4
from iza.types import SeriesLike, DataFrame
from atyp import SeriesLike, DataFrame

# %% ../nbs/02_fn.ipynb 5
from gnr.static import (
Expand Down
8 changes: 4 additions & 4 deletions gnr/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from typing import List, Optional, Union

# %% ../nbs/04_mock.ipynb 4
from iza.types import SeriesLike, DataFrame, ndarray
from atyp import SeriesLike, DataFrame, NPArray

# %% ../nbs/04_mock.ipynb 5
from .static import (MOCK_GENES)
Expand Down Expand Up @@ -43,7 +43,7 @@ def make_mock_trajectories(
tbins: int = 100,
cells: int = 50,
genes: int = 10,
) -> ndarray:
) -> NPArray:
df = pd.DataFrame()
for i in range(cells):
df_gxt = make_mock_genes_x_tbins(genes, tbins)
Expand All @@ -52,14 +52,14 @@ def make_mock_trajectories(
return res

# %% ../nbs/04_mock.ipynb 11
def df_trj_to_cells_x_tbins(trajectories:ndarray, agg_fn=np.mean) -> ndarray:
def df_trj_to_cells_x_tbins(trajectories:NPArray, agg_fn=np.mean) -> NPArray:
'''
Transpose and aggregate trajectories matrix (timebinse, cells, gene)
to produce (cells, timebins)
'''
return agg_fn(np.transpose(trajectories, (1, 0, 2)), axis=2)

def df_trj_to_genes_x_tbins(trajectories:ndarray, agg_fn=np.mean) -> ndarray:
def df_trj_to_genes_x_tbins(trajectories:NPArray, agg_fn=np.mean) -> NPArray:
'''
Transpose and aggregate trajectories matrix (timebinse, cells, gene)
to produce (genes, timebins)
Expand Down
3 changes: 1 addition & 2 deletions gnr/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@

import seaborn as sns

from dataclasses import dataclass, field
from typing import Optional, ClassVar

# %% ../nbs/03_op.ipynb 4
from iza.types import SeriesLike, DataFrame
from atyp import SeriesLike, DataFrame

# %% ../nbs/03_op.ipynb 5
from gnr.static import (
Expand Down
3 changes: 1 addition & 2 deletions gnr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

# %% ../nbs/01_utils.ipynb 3
import pandas as pd, numpy as np
import seaborn as sns

from typing import List, Optional, Union

from sklearn.preprocessing import StandardScaler
from statsmodels.tsa.stattools import kpss

# %% ../nbs/01_utils.ipynb 4
from iza.types import SeriesLike, DataFrame, ndarray
from atyp import SeriesLike, DataFrame, NPArray

# %% ../nbs/01_utils.ipynb 5
from gnr.static import (
Expand Down
3 changes: 1 addition & 2 deletions nbs/01_utils.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"source": [
"#| export\n",
"import pandas as pd, numpy as np\n",
"import seaborn as sns\n",
"\n",
"from typing import List, Optional, Union\n",
"\n",
Expand All @@ -52,7 +51,7 @@
"outputs": [],
"source": [
"#| export\n",
"from iza.types import SeriesLike, DataFrame, ndarray"
"from atyp import SeriesLike, DataFrame, NPArray"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion nbs/02_fn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"outputs": [],
"source": [
"#| export\n",
"from iza.types import SeriesLike, DataFrame"
"from atyp import SeriesLike, DataFrame"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions nbs/03_op.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"\n",
"import seaborn as sns\n",
"\n",
"from dataclasses import dataclass, field\n",
"from typing import Optional, ClassVar"
]
},
Expand All @@ -52,7 +51,7 @@
"outputs": [],
"source": [
"#| export\n",
"from iza.types import SeriesLike, DataFrame"
"from atyp import SeriesLike, DataFrame"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions nbs/04_mock.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"outputs": [],
"source": [
"#| export\n",
"from iza.types import SeriesLike, DataFrame, ndarray"
"from atyp import SeriesLike, DataFrame, NPArray"
]
},
{
Expand Down Expand Up @@ -313,7 +313,7 @@
" tbins: int = 100,\n",
" cells: int = 50,\n",
" genes: int = 10,\n",
") -> ndarray:\n",
") -> NPArray:\n",
" df = pd.DataFrame()\n",
" for i in range(cells):\n",
" df_gxt = make_mock_genes_x_tbins(genes, tbins)\n",
Expand Down Expand Up @@ -351,14 +351,14 @@
"outputs": [],
"source": [
"#| export\n",
"def df_trj_to_cells_x_tbins(trajectories:ndarray, agg_fn=np.mean) -> ndarray:\n",
"def df_trj_to_cells_x_tbins(trajectories:NPArray, agg_fn=np.mean) -> NPArray:\n",
" '''\n",
" Transpose and aggregate trajectories matrix (timebinse, cells, gene)\n",
" to produce (cells, timebins)\n",
" ''' \n",
" return agg_fn(np.transpose(trajectories, (1, 0, 2)), axis=2)\n",
"\n",
"def df_trj_to_genes_x_tbins(trajectories:ndarray, agg_fn=np.mean) -> ndarray:\n",
"def df_trj_to_genes_x_tbins(trajectories:NPArray, agg_fn=np.mean) -> NPArray:\n",
" '''\n",
" Transpose and aggregate trajectories matrix (timebinse, cells, gene)\n",
" to produce (genes, timebins)\n",
Expand Down
Loading

0 comments on commit 159df1d

Please sign in to comment.