Skip to content

Adding sankey as plotting option#4

Open
harryhaller001 wants to merge 10 commits intomainfrom
sankey
Open

Adding sankey as plotting option#4
harryhaller001 wants to merge 10 commits intomainfrom
sankey

Conversation

@harryhaller001
Copy link
Collaborator

  • Use matplotlib-sankey to add sankey plotting option to clustree function
  • Add example to docs
  • Python 3.11 as minimal supported version, move to uv
  • Fix older pre-commit hooks
  • Version updates to github actions

Copy link
Contributor

@maltekuehl maltekuehl left a comment

Choose a reason for hiding this comment

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

Thanks for contributing this! Some comments raised, but the diff on the main file is quite large, could you perhaps summarize the changes and the motivation?

pyproject.toml Outdated
dependencies = [
"anndata",
"matplotlib",
"matplotlib-sankey>=0.3.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

How flexible is matplotlib-sankey with major versions of the standard scientific Python packages? Just to see whether it should be an optional or a required dependency

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added matplotlib sankey as extra dependency

[tool.flit.sdist]
exclude = [ "docs/*", "test/*" ]
[tool.flit]
sdist.exclude = [ "docs/*", "test/*" ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Perspectively, would be great to eliminate flit dependency and just move to uv as in other repos. Unrelated to this PR, just if you have it set up and would like to copy & past this from some other place. But can merge without it, too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea. I would start a separate PR to migrate to uv build backend

Copy link
Contributor

Choose a reason for hiding this comment

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

python-igraph is deprecated, should now use igraph

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

igraph is a dev dependency. I resolve the deprecation by adding "scanpy[leiden]".

show_fraction: bool = False,
show_cluster_keys: bool = True,
graph_plot_kwargs: dict | None = None,
transition_plot: Literal["network", "sankey"] = "network",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we condense here to sankey_kwargs and point to its docs? Quite a number of keywords for optional behavior

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. Thats a good idea. I added sankey parameters as kwargs

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

Successfully merging this pull request may close these issues.

2 participants