graspologic
graspologic copied to clipboard
[REFACTOR]: Consider cleaning up utils.import_edgelist
Any time your return type can be:
def import_edgelist(
path: Union[str, Path, Iterable[str, Path]],
extension: str = "edgelist",
delimiter: Optional[str] = None,
nodetype: Callable[[Any], Any] = int,
return_vertices: bool = False
) -> Union[
np.ndarray,
List[np.ndarray],
Tuple[
Union[np.ndarray, List[np.ndarray]],
np.ndarray
]
]:
you should consider refactoring into more than one method or function. I suggest this one be broken into:
- import_edgelist
- import_edgelist_set
Only in the latter case should you return vertices, and in the latter case you should always return vertices.
This utility should also go into an io package.
Hey @daxpryce , I would like to work on this issue :)