diff --git a/.requirements/docs.in b/.requirements/docs.in index ee7743be..e25080ae 100644 --- a/.requirements/docs.in +++ b/.requirements/docs.in @@ -12,3 +12,4 @@ sphinxext-opengraph sphinxcontrib-gtagjs ipython watermark +sphinx_codeautolink diff --git a/docs/source/conf.py b/docs/source/conf.py index 1e563f44..15fc1b58 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -55,6 +55,7 @@ "nbsphinx", "nbsphinx_link", "sphinx.ext.napoleon", + "sphinx_codeautolink", # "sphinx_autorun", ] @@ -63,9 +64,9 @@ nbsphinx_require_js_path = ( "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js" ) -nbsphinx_kernel_name = "graphein-wip" -# nbsphinx_execute = "always" -nbsphinx_execute = "never" +nbsphinx_kernel_name = "graphein" +nbsphinx_execute = "always" +# nbsphinx_execute = "never" ogp_site_url = "https://graphein.ai/" ogp_image = "https://graphein.ai/_static/graphein.png" diff --git a/graphein/protein/utils.py b/graphein/protein/utils.py index 0d8af70d..748b4dd7 100644 --- a/graphein/protein/utils.py +++ b/graphein/protein/utils.py @@ -90,7 +90,7 @@ def read_fasta(file_path: str) -> Dict[str, str]: def download_pdb_multiprocessing( pdb_codes: List[str], - out_dir: Union[str, Path], + out_dir: Union[str, Path], # type: ignore overwrite: bool = False, strict: bool = False, max_workers: int = 16, diff --git a/graphein/protein/visualisation.py b/graphein/protein/visualisation.py index ab2eb741..7918751a 100644 --- a/graphein/protein/visualisation.py +++ b/graphein/protein/visualisation.py @@ -195,7 +195,7 @@ def plotly_protein_structure_graph( figsize: Tuple[int, int] = (620, 650), node_alpha: float = 0.7, node_size_min: float = 20.0, - node_size_multiplier: float = 20.0, + node_size_multiplier: float = 1.0, node_size_feature: str = "degree", label_node_ids: bool = True, node_colour_map=plt.cm.plasma, @@ -217,7 +217,7 @@ def plotly_protein_structure_graph( :param node_size_min: Specifies node minimum size. Defaults to ``20.0``. :type node_size_min: float :param node_size_multiplier: Scales node size by a constant. Node sizes - reflect degree. Defaults to ``20.0``. + reflect degree. Defaults to ``1.0``. :type node_size_multiplier: float :param node_size_feature: Which feature to scale the node size by. Defaults to ``degree``. @@ -378,7 +378,7 @@ def plot_protein_structure_graph( figsize: Tuple[int, int] = (10, 7), node_alpha: float = 0.7, node_size_min: float = 20.0, - node_size_multiplier: float = 20.0, + node_size_multiplier: float = 1.0, label_node_ids: bool = True, node_colour_map=plt.cm.plasma, edge_color_map=plt.cm.plasma, @@ -402,10 +402,10 @@ def plot_protein_structure_graph( :type figsize: Tuple[int, int] :param node_alpha: Controls node transparency, defaults to ``0.7``. :type node_alpha: float - :param node_size_min: Specifies node minimum size, defaults to ``20``. + :param node_size_min: Specifies node minimum size, defaults to ``20.0``. :type node_size_min: float :param node_size_multiplier: Scales node size by a constant. Node sizes - reflect degree. Defaults to ``20``. + reflect degree. Defaults to ``1.0``. :type node_size_multiplier: float :param label_node_ids: bool indicating whether or not to plot ``node_id`` labels. Defaults to ``True``. @@ -629,15 +629,15 @@ def plot_distance_matrix( raise ValueError("Must provide either a graph or a distance matrix.") if dist_mat is None: - dist_mat = g.graph["dist_mat"] + dist_mat = g.graph["dist_mat"] # type: ignore if g is not None: x_range = list(g.nodes) y_range = list(g.nodes) if not title: title = g.graph["name"] + " - Distance Matrix" else: - x_range = list(range(dist_mat.shape[0])) - y_range = list(range(dist_mat.shape[1])) + x_range = list(range(dist_mat.shape[0])) # type: ignore + y_range = list(range(dist_mat.shape[1])) # type: ignore if not title: title = "Distance matrix" @@ -743,7 +743,7 @@ def asteroid_plot( use_plotly: bool = True, show_edges: bool = False, show_legend: bool = True, - node_size_multiplier: float = 10, + node_size_multiplier: float = 10.0, ) -> Union[plotly.graph_objects.Figure, matplotlib.figure.Figure]: # sourcery skip: remove-unnecessary-else, swap-if-else-branches """Plots a k-hop subgraph around a node as concentric shells. @@ -778,12 +778,12 @@ def asteroid_plot( :type use_plotly: bool :param show_edges: Whether to show edges in the plot. Defaults to ``False``. :type show_edges: bool - :param show_legend: Whether to show the legend of the edges. Fefaults to + :param show_legend: Whether to show the legend of the edges. Defaults to `True``. :type show_legend: bool :param node_size_multiplier: Multiplier for the size of the nodes. Defaults - to ``10``. - :type node_size_multiplier: float. + to ``10.0``. + :type node_size_multiplier: float :returns: Plotly figure or matplotlib figure. :rtpye: Union[plotly.graph_objects.Figure, matplotlib.figure.Figure] """ diff --git a/setup.py b/setup.py index 641e5a63..0a893f66 100644 --- a/setup.py +++ b/setup.py @@ -134,13 +134,19 @@ def run(self): setup( name="graphein", - version="1.5.2", + version="1.6.0", description="Protein & Interactomic Graph Construction for Machine Learning", long_description=long_description, long_description_content_type="text/markdown", author="Arian Jamasb", author_email="arian@jamasb.io", url="https://github.com/a-r-j/graphein", + project_urls={ + "homepage": "https://github.com/a-r-j/graphein", + "changelog": "https://github.com/a-r-j/graphein/blob/master/CHANGELOG.md", + "issue": "https://github.com/a-r-j/graphein/issues", + "documentation": "https://graphein.ai/", + }, packages=find_packages(), package_data={ "": ["LICENSE.txt", "README.md", "requirements.txt", "*.csv"]