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

make plotting independent of tulip #27

Closed
johnyf opened this issue Aug 29, 2016 · 3 comments
Closed

make plotting independent of tulip #27

johnyf opened this issue Aug 29, 2016 · 3 comments
Assignees
Labels
bug An error, usually in the code.
Projects
Milestone

Comments

@johnyf
Copy link
Member

johnyf commented Aug 29, 2016

polytope.polytope and polytope.plotboth depend ontulip.graphicsfor plotting (remnants from a time whenpolytopewas a subpackage oftulip). For example:

from tulip.graphics import newax

from tulip.graphics import newax

polytope is a dependency of tulip. Therefore, it cannot itself depend on tulip, because this results in a cyclic dependency (hence the labeling as "bug").
The usage is very limited: tulip.graphics.newax and tulip.graphics.dom2vec, both of which are small or eliminable.

The module tulip.graphics originates from my porting to Python part of plotting utilities that I had developed in Matlab. In Python, either some things are not needed at all, or there is a much better and simpler way to do them, or someone - like matplotlib and friends - has already written what is needed. Also, tulip.graphics derives from code that was handling seamless plotting in 2 or 3 dimensions, which in practice is not used in tulip or polytope (and I don't think it would be very practical to plot 3D partitions).

@johnyf johnyf added the bug An error, usually in the code. label Aug 29, 2016
@johnyf johnyf self-assigned this Aug 29, 2016
@johnyf
Copy link
Member Author

johnyf commented Aug 29, 2016

A second flaw in the design (by me) is that polytope.polytope.Polytope.plot returns silently (!) if tulip.graphics.newax fails to import. It should raise ImportError, because requesting a plot and not getting one is an error, and "Errors should never pass silently. Unless explicitly silenced." (PEP 20).

@slivingston
Copy link
Member

Thanks for creating this issue. I noticed the unnecessary dependence on tulip previously but had not taken action.

@johnyf johnyf added this to the 0.1.4 milestone Aug 31, 2016
@johnyf
Copy link
Member Author

johnyf commented Jan 22, 2017

Addressed as of 9d96bc0. Plotting needs to be tested more, but that is a separate issue.

@johnyf johnyf closed this as completed Jan 22, 2017
@johnyf johnyf moved this from TODO to done in release Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error, usually in the code.
Projects
Development

No branches or pull requests

2 participants