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

Add node and hyperedge labels in the plotting functions #234

Merged
merged 8 commits into from
Dec 4, 2022

Conversation

mcontisc
Copy link
Contributor

@mcontisc mcontisc commented Dec 2, 2022

  • Update the old docstrings.
  • Added the functions draw_node_labels and draw_hyperedge_labels.
  • Updated Tutorial 5 - Plotting.ipynb to show the new functionalities. I also added an example to show how to plot a hypergraph with only hyperedges of a certain order.
  • So far the labels can be only dict. Thus, we should implement the .items() function for NodeStat and EdgeStat.
  • So far, the hyperedges labels are only drawn for Hypergraph and not for SimplicialComplex. Could you please give me some feedback whether it would make sense to add this functionality for SimplicialComplex as well?
  • So far, I did not introduce any check for the node_labels and hyperedge_labels because I think the raised errors (from python) are already explicative. Let me know if I should improve them.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@leotrs leotrs left a comment

Choose a reason for hiding this comment

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

Awesome stuff! Just left a couple of comments/questions, nothing major.

.idea/.gitignore Outdated Show resolved Hide resolved
@leotrs
Copy link
Collaborator

leotrs commented Dec 2, 2022

So far the labels can be only dict. Thus, we should implement the .items() function for NodeStat and EdgeStat.

See #233.

So far, the hyperedges labels are only drawn for Hypergraph and not for SimplicialComplex. Could you please give me some feedback whether it would make sense to add this functionality for SimplicialComplex as well?

@maximelucas

So far, I did not introduce any check for the node_labels and hyperedge_labels because I think the raised errors (from python) are already explicative. Let me know if I should improve them.

I think it's good for now!

@maximelucas
Copy link
Collaborator

Great idea, thanks Martina!
Having it for SimplicialComplex too would make sense yes. But there's already an SC case where it works in the notebook is there not?
Just left a comment in the notebook too.

Copy link
Contributor Author

mcontisc commented Dec 2, 2022

In the notebook I only show how to use node_labels and not hyperedge_labels because I don't know if make sense to have a label for the simplices

@maximelucas
Copy link
Collaborator

Okay got it, because of potentially too many labels. I'd say in small SCs it might be useful to see them. In big ones with larger orders not really, but then the user can turn the labels off.

In any case, we're plotting only the maximal simplices, right @iaciac ? And the option to show their labels might helpful to the user.

Copy link
Contributor Author

mcontisc commented Dec 2, 2022

Yes, we are plotting only the maximal order.. okay I will implement it as well then and come back to u

@mcontisc
Copy link
Contributor Author

mcontisc commented Dec 2, 2022

Added! However, it is less intuitive than for hypergraph because now if you pass a dictionary you don't know a priori which one will be the keys kept by the drawing function.. More specifically, with hyperedge_labels=True it works perfectly fine and shows the id labels. If you pass hyperedge_labels=SC.edges.size.asdict() does not work because the keys are different from the keys of H_ used in the plot.

@maximelucas
Copy link
Collaborator

maximelucas commented Dec 2, 2022

Nice! And great point. Maybe add a note about this in the docstring? And then good to go I'd say.
(In the future we might only store maximal simplices or at least have a way to get maximal simplices which will make this better)

I'm already approving, feel free to merge when good for you.

…ain order; update docstrings of draw_xgi_simplices
@mcontisc mcontisc merged commit 57af2b4 into main Dec 4, 2022
@leotrs
Copy link
Collaborator

leotrs commented Dec 4, 2022

Merged! 🎉 Grazie @mcontisc

@leotrs leotrs deleted the add-node-labels branch December 4, 2022 09:26
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.

3 participants