Skip to content

Commit

Permalink
changes for 1.6.0 (#279)
Browse files Browse the repository at this point in the history
* changes for 1.6.0

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
a-r-j and pre-commit-ci[bot] authored Mar 18, 2023
1 parent 1e2764b commit 82d3ba3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
1 change: 1 addition & 0 deletions .requirements/docs.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ sphinxext-opengraph
sphinxcontrib-gtagjs
ipython
watermark
sphinx_codeautolink
7 changes: 4 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"nbsphinx",
"nbsphinx_link",
"sphinx.ext.napoleon",
"sphinx_codeautolink",
# "sphinx_autorun",
]

Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion graphein/protein/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
24 changes: 12 additions & 12 deletions graphein/protein/visualisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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``.
Expand Down Expand Up @@ -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,
Expand All @@ -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``.
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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]
"""
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 82d3ba3

Please sign in to comment.