Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Reverse order of id's in iter_connections #31

Open
gmorenz opened this issue May 26, 2022 · 2 comments
Open

Reverse order of id's in iter_connections #31

gmorenz opened this issue May 26, 2022 · 2 comments

Comments

@gmorenz
Copy link
Contributor

gmorenz commented May 26, 2022

iter_connections current returns an iterator of (InputId, OutputId). I believe it would be more consistent to return (OutputId, InputId), and it matches the direction of connections in the graph.

On the other hand it's a bit of an unnecessary breaking change, but it's caught by the type system, and I think this library is young enough that it's worth it.

This was inspired by @philpax 's comment here. I did this here 32aa8d3, but it will conflict with #30, so waiting on that to make a PR.

Sorry about how inter-connected all my proposed changes are 😆

@setzer22
Copy link
Owner

setzer22 commented May 29, 2022

Indeed, my original idea was to always go Output -> Input, which is the natural order you'd fetch dependencies from, so iter_connections is kind of backwards.

Since InputId and OutputId are typed, this change is breaking but not silently, users will get a clear error and know what to do, so I don't see any issues with it. It's very early for this library so we can afford breaking some APIs for consistency 😄

@setzer22
Copy link
Owner

Feel free to include this as part of #30 if that helps avoid the conflicts

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants