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

Refactor core interface #41

Merged
merged 20 commits into from
Feb 8, 2022
Merged

Refactor core interface #41

merged 20 commits into from
Feb 8, 2022

Conversation

leotrs
Copy link
Collaborator

@leotrs leotrs commented Feb 4, 2022

This one is pretty big so I suggest reviewing each commit in turn instead of the whole thing at once. This basically implements the behavior discussed here #40. In particular, there is (hopefully, I think), one way of accessing each thing. Among other things:

  • H['attr'] accesses hypergraph attributes.
  • H.nodes() and H.edges() are no longer supported
  • H.nodes[] and H.edges[] now access attributes
  • H.nodes.membership is now the same as H.nodes.members. (I decided to keep members for simplicity and symmetry with H.edges)

There are a few kinks to work out, but I thought this PR was already big enough.

As you review, please let me know if you think of any other test I should add to this PR.

Also: there's a lot of noise in this PR because I decided to change *_attrs to *_attr just to be uniform with the variable names in the main Hypergraph class.

Closes #40

* Created a base class for the Node/Edge Views and Degree/Edge Size Views.
* Removed the NodeDataView and EdgeDataView.
* All unit tests pass
* Removed all old references to `.node[id]` and `.edge[id]`
@nwlandry
Copy link
Collaborator

nwlandry commented Feb 4, 2022

I simplified the view classes and removed the data views.

@maximelucas maximelucas marked this pull request as draft February 7, 2022 10:42
@maximelucas maximelucas marked this pull request as ready for review February 7, 2022 11:40
@nwlandry nwlandry linked an issue Feb 7, 2022 that may be closed by this pull request
@nwlandry nwlandry merged commit 99eb038 into main Feb 8, 2022
@nwlandry nwlandry deleted the refactor_core_interface branch February 8, 2022 15:31
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.

H.name and H['name'] are inconsistent Interface of NodeView
3 participants