Skip to content

Commit 8d505f7

Browse files
committed
chore(dev): expand overloaded functions to add more type paths
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
1 parent e512740 commit 8d505f7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

main/como/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,23 +192,23 @@ async def _read_file(path: None, h5ad_as_df: Literal[True] | Literal[False], **k
192192

193193

194194
@overload
195-
async def _read_file(path: None, h5ad_as_df: bool, **kwargs) -> None: ...
195+
async def _read_file(path: pd.DataFrame, h5ad_as_df: Literal[True] | Literal[False], **kwargs) -> pd.DataFrame: ...
196196

197197

198198
@overload
199-
async def _read_file(path: pd.DataFrame, h5ad_as_df: bool, **kwargs) -> pd.DataFrame: ...
199+
async def _read_file(path: sc.AnnData, h5ad_as_df: Literal[False] = False, **kwargs) -> sc.AnnData: ...
200200

201201

202202
@overload
203-
async def _read_file(path: sc.AnnData, h5ad_as_df: bool = False, **kwargs) -> sc.AnnData: ...
203+
async def _read_file(path: sc.AnnData, h5ad_as_df: Literal[True] = True, **kwargs) -> pd.DataFrame: ...
204204

205205

206-
def _num_rows(item: pd.DataFrame | npt.NDArray) -> int:
207-
return item.shape[0]
206+
@overload
207+
async def _read_file(path: Path, h5ad_as_df: Literal[False] = False, **kwargs) -> pd.DataFrame | sc.AnnData: ...
208208

209209

210210
@overload
211-
async def _read_file(path: sc.AnnData, h5ad_as_df: bool = True, **kwargs) -> pd.DataFrame: ...
211+
async def _read_file(path: Path, h5ad_as_df: Literal[True] = True, **kwargs) -> pd.DataFrame: ...
212212

213213

214214
async def _read_file(

0 commit comments

Comments
 (0)