Skip to content

Commit

Permalink
Expose method to list communities' edges (#18)
Browse files Browse the repository at this point in the history
* Expose method to list communities' edges

* changelog
  • Loading branch information
AleksanderWWW authored Jul 4, 2024
1 parent aae355e commit 7b488ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
### Features
- Added exporting the graph to `scipy.csr_matrix` ([#16](https://github.com/AleksanderWWW/abcd-graph/pull/16))
- Added a function to set the random seed ([#17](https://github.com/AleksanderWWW/abcd-graph/pull/17))
- Expose method to list communities' edges ([#18](https://github.com/AleksanderWWW/abcd-graph/pull/18))
7 changes: 7 additions & 0 deletions src/abcd_graph/abcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,10 @@ def build(self, model: Optional[Model] = None) -> "Graph":
self._graph.rewire_graph()

return self

@property
@require_graph_built
def vertex_partition(self) -> dict[int, list[int]]:
assert self._graph is not None

return {i: community.vertices for i, community in enumerate(self._graph.communities)}

1 comment on commit 7b488ff

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/abcd_graph
   abcd.py1244167%56–60, 85–87, 98–99, 104–105, 120, 128–134, 139–142, 147–155, 161–177, 181–182, 234–236
   logger.py53983%39, 43, 47, 51, 55, 63, 66, 69, 72
   utils.py29776%36, 43–44, 51–54
   version.py330%20–24
src/abcd_graph/core
   build.py89397%132, 149, 161
   models.py155497%53, 93, 149, 169
   utils.py22864%31, 45–55
TOTAL5547586% 

Tests Skipped Failures Errors Time
42 0 💤 0 ❌ 0 🔥 21.825s ⏱️

Please sign in to comment.