Skip to content

Commit

Permalink
Merge pull request #489 from Ukyeon/fano
Browse files Browse the repository at this point in the history
Remove warning msg form nxviz
  • Loading branch information
Xiaojieqiu authored May 5, 2023
2 parents 2ec448e + 5e1d4d6 commit 51e2e34
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions dynamo/plot/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import networkx as nx
import numpy as np
import nxviz as nv
import nxviz.annotate
import pandas as pd
from anndata import AnnData
from matplotlib.axes import Axes
Expand All @@ -31,7 +29,7 @@ def nxvizPlot(
save_show_or_return: Literal["save", "show", "return"] = "show",
save_kwargs: Dict[str, Any] = {},
**kwargs,
) -> Union[nv.ArcPlot, nv.CircosPlot, None]:
) -> Optional[Any]:
"""Arc or circos plot of gene regulatory network for a particular cell cluster.
Args:
Expand Down Expand Up @@ -219,7 +217,7 @@ def arcPlot(
save_show_or_return: Literal["save", "show", "return"] = "show",
save_kwargs: Dict[str, Any] = {},
**kwargs,
) -> Optional[nv.ArcPlot]:
) -> Optional[Any]:
"""Arc plot of gene regulatory network for a particular cell cluster.
Args:
Expand Down Expand Up @@ -367,6 +365,11 @@ def circosPlot(
Returns:
the Matplotlib Axes on which the Circos plot is drawn.
"""
try:
import nxviz as nv
except ImportError:
raise ImportError("install nxviz via `pip install nxviz`.")

ax = nv.circos(
network,
group_by=node_label_key,
Expand Down Expand Up @@ -402,7 +405,7 @@ def circosPlotDeprecated(
save_show_or_return: Literal["save", "show", "return"] = "show",
save_kwargs: Dict[str, Any] = {},
**kwargs,
) -> nv.CircosPlot:
) -> Optional[Any]:

"""Deprecated.
Expand Down

0 comments on commit 51e2e34

Please sign in to comment.