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

Fixed bug with abstract seed selectors #44

Merged
merged 2 commits into from
Sep 6, 2023
Merged
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
2 changes: 1 addition & 1 deletion network_diffusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
from network_diffusion.mln.mlnetwork import MultilayerNetwork
from network_diffusion.multi_spreading import MultiSpreading

__version__ = "0.10.0"
__version__ = "0.10.1"
11 changes: 10 additions & 1 deletion network_diffusion/seeding/betweenness_selector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""A definition of the seed selector based on betweenness centrality."""

from typing import List
from typing import Any, List

import networkx as nx

from network_diffusion.mln.actor import MLNetworkActor
from network_diffusion.mln.functions import betweenness
Expand All @@ -19,6 +21,13 @@ def __str__(self) -> str:
f"\tbetweenness centrality choice\n{BOLD_UNDERLINE}\n"
)

@staticmethod
def _calculate_ranking_list(graph: nx.Graph) -> List[Any]:
"""Create nodewise ranking."""
raise NotImplementedError(
"Nodewise ranking list cannot be computed for this class!"
)

def actorwise(self, net: MultilayerNetwork) -> List[MLNetworkActor]:
"""Get ranking for actors using betweenness centrality metric."""
ranking_list: List[MLNetworkActor] = []
Expand Down
11 changes: 10 additions & 1 deletion network_diffusion/seeding/closeness_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

"""A definition of the seed selector based on closeness centrality."""

from typing import List
from typing import Any, List

import networkx as nx

from network_diffusion.mln.actor import MLNetworkActor
from network_diffusion.mln.functions import closeness
Expand All @@ -37,6 +39,13 @@ def __str__(self) -> str:
f"\tcloseness centrality choice\n{BOLD_UNDERLINE}\n"
)

@staticmethod
def _calculate_ranking_list(graph: nx.Graph) -> List[Any]:
"""Create nodewise ranking."""
raise NotImplementedError(
"Nodewise ranking list cannot be computed for this class!"
)

def actorwise(self, net: MultilayerNetwork) -> List[MLNetworkActor]:
"""Get ranking for actors using closeness centrality metric."""
ranking_list: List[MLNetworkActor] = []
Expand Down
11 changes: 10 additions & 1 deletion network_diffusion/seeding/katz_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

"""A definition of the seed selector based on Katz centrality."""

from typing import List
from typing import Any, List

import networkx as nx

from network_diffusion.mln.actor import MLNetworkActor
from network_diffusion.mln.functions import katz
Expand All @@ -37,6 +39,13 @@ def __str__(self) -> str:
f"\tkatz centrality choice\n{BOLD_UNDERLINE}\n"
)

@staticmethod
def _calculate_ranking_list(graph: nx.Graph) -> List[Any]:
"""Create nodewise ranking."""
raise NotImplementedError(
"Nodewise ranking list cannot be computed for this class!"
)

def actorwise(self, net: MultilayerNetwork) -> List[MLNetworkActor]:
"""Get ranking for actors using Katz centrality metric."""
ranking_list: List[MLNetworkActor] = []
Expand Down
2 changes: 1 addition & 1 deletion submodules/template-python