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

Support attribute "consider_empty_community" of leidenalg.Optimiser #27

Closed
Gilquin opened this issue Jul 18, 2023 · 1 comment
Closed

Comments

@Gilquin
Copy link

Gilquin commented Jul 18, 2023

Hello,

Could it be possible to add support for the attribute consider_empty_community of leidenalg.Optimiser ?
A potential use case of this attribute is to better control the maximum number of clusters discovered, see the corresponding issue #89.

Digging through the code, I think it only amounts to add the following lines in leiden::find_paritition, after L109:

  if(py_has_attr(self.optimiser, "consider_empty_community")){
    py_set_attr(self.optimiser, "consider_empty_community", r_to_py(as.logical(empty_community)))
  }

and add an empty_community argument to each parent function.

@Gilquin
Copy link
Author

Gilquin commented Jul 18, 2023

EDIT: Please ignore my suggestion, it doesn't work because the optimiser is instantiated internally (at L84) when leidenalg$find_partition is called.
Adding this feature would require a change to the leidenalg.find_partition function.

I'm closing this issue. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant