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

Convert from simplex dict to SC #397

Merged
merged 8 commits into from
Jun 13, 2023

Conversation

thomasrobiglio
Copy link
Collaborator

This should resolve #330 (the ability for the SC constructor to handle a HG was already implemented, this PR is about #330 (comment)).

I added a new function from_simplex_dict that takes a dict in the form: {edge_id: members, ...} and returns a SC. If the subfaces of existing simplices are not given in the dict then the function adds them with integer IDs.

Screenshot 2023-06-12 alle 19 48 15

@codecov
Copy link

codecov bot commented Jun 12, 2023

Codecov Report

Patch coverage: 85.71% and project coverage change: -0.02 ⚠️

Comparison is base (d7e59cc) 90.95% compared to head (9d49f0d) 90.94%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #397      +/-   ##
==========================================
- Coverage   90.95%   90.94%   -0.02%     
==========================================
  Files          47       47              
  Lines        3882     3888       +6     
==========================================
+ Hits         3531     3536       +5     
- Misses        351      352       +1     
Impacted Files Coverage Δ
xgi/classes/hypergraph.py 85.37% <ø> (ø)
xgi/classes/simplicialcomplex.py 82.92% <ø> (ø)
xgi/convert.py 94.61% <85.71%> (-0.27%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@nwlandry nwlandry left a comment

Choose a reason for hiding this comment

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

Great work, @thomasrobiglio! I just tried it out and it works well! Good to squash and merge!

@thomasrobiglio thomasrobiglio merged commit 96cb3c5 into xgi-org:main Jun 13, 2023
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.

Add the ability for the SimplicialComplex class constructor to handle hypergraphs
3 participants