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

Switchs order of output ports #1006

Merged
merged 5 commits into from Mar 16, 2015
Merged

Switchs order of output ports #1006

merged 5 commits into from Mar 16, 2015

Conversation

remram44
Copy link
Member

@remram44 remram44 commented Mar 9, 2015

This draws output ports from left to right, ordering them in descending order of sort_keys when provided. Input port are still sorted by ascending order of sort_keys. This should keep the order of output ports if the package author bothered to provide sort_keys, else it will change the order to match the declaration order. Hence it is surprising.

My test case is this: https://gist.github.com/remram44/f1a459fd3452cbc120d1

Highlighted connections are between port specs, not module ports.

master:

There is something strange going on in the ordering of port specs with the same sort_key. I didn't bother keeping compatibility there.

This PR:

Note that sort keys are backwards for both FixedOrder#_output_ports, and the sort_keys in ports.xml. This is for compatibility reasons.

This means that a PythonSource's output ports are still drawn from right to left, because sort_keys are assigned to them, in ascending order.

Fixes #980

@remram44
Copy link
Member Author

remram44 commented Mar 9, 2015

Other solution is to always sort from left to right in ascending order of sort_keys and lose compatibility.

@remram44 remram44 added the C-gui label Mar 11, 2015
@remram44
Copy link
Member Author

Decision after today's meeting: change sort_keys as well so they everything is in a consistent order, from left to write. Break compatibility, fix packages that need fixing.

@remram44
Copy link
Member Author

Made the change. Also updated the test files.

This orders ports by increasing sort_key then id, and draws both input
and output ports from left to right. Modules on which sort_keys had been
set (backwards) specifically to have the ports in the right order will
need to be updated.
remram44 added a commit that referenced this pull request Mar 16, 2015
Switchs order of output ports
@remram44 remram44 merged commit e6de969 into master Mar 16, 2015
@amueller
Copy link
Contributor

Thanks for the sklearn fixes :)

@remram44 remram44 deleted the port-order branch April 23, 2015 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants