Coverage for src/abcd_graph/graph/community.py: 100%

1 class ABCDCommunity:

2 def __init__(

3 self,

4 community_id: int,

5 vertices: list[int],

6 average_degree: float,

7 degree_sequence: dict[int, int],

8 empirical_xi: float,

9 ) -> None:

10 self._community_id = community_id

11 self.vertices = vertices

12 self.average_degree = average_degree

13 self.degree_sequence = degree_sequence

14 self.empirical_xi = empirical_xi

15

16 @property

17 def community_id(self) -> int:

18 return self._community_id

19

20 def __repr__(self) -> str: # pragma: no cover

21 return f"ABCDCommunityObj(id={self._community_id}, vertices={self.vertices[0]}-{self.vertices[-1]})"