Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA-173 | rich progress bar #59

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ nx-arangodb
:target: https://github.com/arangodb/nx-arangodb/actions/workflows/analyze.yml
:alt: CodeQL

.. image:: https://github.com/arangodb/nx-arangodb/actions/workflows/docs.yaml/badge.svg
:target: https://github.com/arangodb/nx-arangodb/actions/workflows/docs.yaml
.. image:: https://readthedocs.org/projects/nx-arangodb/badge/?version=latest
:target: https://nx-arangodb.readthedocs.io/en/latest/?badge=latest
:alt: Docs

.. raw:: html
Expand Down
57 changes: 33 additions & 24 deletions nx_arangodb/classes/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
NodeDict,
SrcIndices,
)
from rich.progress import Progress, SpinnerColumn, TextColumn, TimeElapsedColumn

from nx_arangodb.logger import logger

Expand Down Expand Up @@ -148,30 +149,38 @@ def get_arangodb_graph(
assert config.username
assert config.password

(
node_dict,
adj_dict,
src_indices,
dst_indices,
edge_indices,
vertex_ids_to_index,
edge_values,
) = NetworkXLoader.load_into_networkx(
config.db_name,
metagraph=metagraph,
hosts=[config.host],
username=config.username,
password=config.password,
load_adj_dict=load_adj_dict,
load_coo=load_coo,
load_all_vertex_attributes=load_all_vertex_attributes,
load_all_edge_attributes=load_all_edge_attributes,
is_directed=is_directed,
is_multigraph=is_multigraph,
symmetrize_edges_if_directed=symmetrize_edges_if_directed,
parallelism=config.read_parallelism,
batch_size=config.read_batch_size,
)
with Progress(
TextColumn(f"Fetching '{adb_graph.name}'"),
SpinnerColumn(),
TimeElapsedColumn(),
transient=True,
) as progress:
progress.add_task("")

(
node_dict,
adj_dict,
src_indices,
dst_indices,
edge_indices,
vertex_ids_to_index,
edge_values,
) = NetworkXLoader.load_into_networkx(
config.db_name,
metagraph=metagraph,
hosts=[config.host],
username=config.username,
password=config.password,
load_adj_dict=load_adj_dict,
load_coo=load_coo,
load_all_vertex_attributes=load_all_vertex_attributes,
load_all_edge_attributes=load_all_edge_attributes,
is_directed=is_directed,
is_multigraph=is_multigraph,
symmetrize_edges_if_directed=symmetrize_edges_if_directed,
parallelism=config.read_parallelism,
batch_size=config.read_batch_size,
)

return (
node_dict,
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "nx-arangodb"
dynamic = ["version"]
description = "ArangoDB backend for NetworkX"
description = "ArangoDB backend to NetworkX"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
{ name = "ArangoDB" },
Expand All @@ -29,6 +29,7 @@ classifiers = [
]
dependencies = [
"networkx>=3.0,<=3.3",
"rich~=13.8",
"phenolrs",
"python-arango",
"adbnx-adapter"
Expand Down
Loading