Skip to content

Commit

Permalink
These changes should be the same as the previous signatures provided …
Browse files Browse the repository at this point in the history
…- though the modularity function had inconsistency between the signature and the pyfunction macro specification in previous versions. This inconsistency is now fixed, but I'm unsure if this is a breaking change or not. Functionally it should not behave any differently, but the documented specification will now appear -- correctly -- to be different than the lies it told before.
  • Loading branch information
daxpryce committed Jan 15, 2025
1 parent 0ea1c92 commit 7cd2f0a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/pyo3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "graspologic_native"
version = "1.2.2"
version = "1.2.3"
authors = ["[email protected]"]
edition = "2018"
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions packages/pyo3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl HierarchicalCluster {
/// :raises ParameterRangeError: One of the parameters provided did not meet the requirements in the documentation.
/// :raises UnsafeInducementError: An internal algorithm error. Please report with reproduction steps.
#[pyfunction]
#[pyo3(signature=(edges, /, starting_communities=None, resolution=1.0, randomness=0.001, iterations=1, use_modularity=true, seed=None, trials=1))]
#[pyo3(signature=(/, edges, starting_communities=None, resolution=1.0, randomness=0.001, iterations=1, use_modularity=true, seed=None, trials=1))]
fn leiden(
py: Python,
edges: Vec<Edge>,
Expand Down Expand Up @@ -170,7 +170,7 @@ fn leiden(
/// :raises ParameterRangeError: One of the parameters provided did not meet the requirements in the documentation.
/// :raises UnsafeInducementError: An internal algorithm error. Please report with reproduction steps.
#[pyfunction]
#[pyo3(signature=(edges, /, starting_communities=None, resolution=1.0, randomness=0.001, iterations=1, use_modularity=true, max_cluster_size=1000, seed=None))]
#[pyo3(signature=(/, edges, starting_communities=None, resolution=1.0, randomness=0.001, iterations=1, use_modularity=true, max_cluster_size=1000, seed=None))]
fn hierarchical_leiden(
py: Python,
edges: Vec<Edge>,
Expand Down Expand Up @@ -211,7 +211,7 @@ fn hierarchical_leiden(
/// :return: The modularity of the community partitioning provided for the network.
/// :rtype: float
#[pyfunction]
#[pyo3(signature=(edges, communities, /, resolution=1.0))]
#[pyo3(signature=(/, edges, communities, resolution=1.0))]
fn modularity(
py: Python,
edges: Vec<Edge>,
Expand Down
2 changes: 1 addition & 1 deletion packages/pyo3/tests/test_leiden.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _get_edges(path):
class TestLeiden(unittest.TestCase):
def test_leiden(self):
edges = _get_edges(sbm_graph)
modularity, partitions = gcn.leiden(edges, seed=seed)
modularity, partitions = gcn.leiden(edges=edges, seed=seed)

def test_reiterative_leiden(self):
"""
Expand Down
16 changes: 14 additions & 2 deletions packages/pyo3/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7cd2f0a

Please sign in to comment.