BlueBrain / BlueGraph

Python framework for graph analytics and co-occurrence analysis
https://bluegraph.readthedocs.io
Apache License 2.0
31 stars 5 forks source link

Feature/dispatchers #87

Closed eugeniashurko closed 3 years ago

eugeniashurko commented 3 years ago

For example, instead of doing the following:

from bluegraph.backends.networkx import NXMetricProcessor, NXCommunityDetector
from bluegraph.backends.graph_tool import GTPathFinder, GTComminityDetector

processor = NXMetricProcessor(input_pgframe)
finder = GTPathFinder(input_pgframe)
nx_detector =  NXCommunityDetector(input_pgframe)
gt_detector =  GTComminityDetector(input_pgframe)

(which includes a lot of backend-specific imports) user can also do:

from bluegraph.backends import create_analyzer

processor = create_analyzer("metric_processor", "network", input_pgframe)
finder = create_analyzer("path_finder", "graph_tool", input_pgframe)
nx_detector =  create_analyzer("community_detector", "networkx", input_pgframe)
gt_detector =  create_analyzer("community_detector", "graph_tool", input_pgframe)

The same holds for node embedders, for example:

embedded = create_node_embedder("stellargraph", "node2vec", edge_weight="weight", **kwargs)
codecov-commenter commented 3 years ago

Codecov Report

Merging #87 (75535e0) into master (e41b415) will increase coverage by 0.08%. The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   81.16%   81.25%   +0.08%     
==========================================
  Files          41       44       +3     
  Lines        3680     3723      +43     
==========================================
+ Hits         2987     3025      +38     
- Misses        693      698       +5     
Impacted Files Coverage Δ
bluegraph/backends/graph_tool/io.py 84.54% <ø> (-0.07%) :arrow_down:
bluegraph/core/analyse/metrics.py 73.58% <ø> (ø)
bluegraph/downstream/similarity.py 92.20% <ø> (-0.06%) :arrow_down:
bluegraph/downstream/utils.py 88.00% <ø> (ø)
bluegraph/preprocess/encoders.py 79.18% <ø> (ø)
bluegraph/backends/neo4j/analyse/metrics.py 72.09% <50.00%> (ø)
bluegraph/backends/utils.py 71.42% <71.42%> (ø)
bluegraph/backends/configs.py 79.31% <79.31%> (ø)
bluegraph/backends/graph_tool/analyse/paths.py 92.98% <100.00%> (ø)
bluegraph/backends/neo4j/embed/embedders.py 90.82% <100.00%> (-0.17%) :arrow_down:
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e41b415...75535e0. Read the comment docs.