-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Make SubGraph more pythonic #266
Comments
cc: @ceteri @tomaarsen |
Are you aiming to remove |
yes I would like to remove the current interface. If there are breaking changes, maybe the time for applying them is now, before it stabilises. Anyway we could have both for some time if needed. |
Hi @Mec-iS , |
Good points, all around! It's fine to have a breaking change, especially now as we're going through major refactoring and will need to bump to a major release update afterwards. I really like the more pythonic approach! In terms of breaking changes, we have use cases for this in the tutorial notebooks, which might be reused for unit tests? Longer-term perspectives (beyond this refactoring):
My main points about these long-term perspectives is to plan on having the indexing process become "pluggable", possibly with some outside framework to handle transform/inverse-transform lookups, and also the construction of some variants of the |
I'm submitting a
Current Behaviour:
SubGraph
usestransform
andinverse_transform
to provide Node-to-index and index-to-Node. This is quite non-standard as "trasformations" are usually functions applied to data structures, plus Python has its fluent interface to define this kind of behaviourExpected Behaviour:
The
__getitem__
/__setitem__
protocol should be implemented forSubGraph
so that will be possible to do:to return a node at
i
position. And:to return the index of a given node.
This will allow to use
Subgraph
as an iterator with minor additions.This requires:
inverse_transform
to__getitem__
transform
to__setitem__
Subgraph.index()
For example:
This implies modifying all the existing examples and tests.
The text was updated successfully, but these errors were encountered: