-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Simplify radar_chart example. #12492
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
Conversation
# rotate theta such that the first axis is at the top | ||
verts = unit_poly_verts(theta + np.pi / 2) | ||
return plt.Polygon(verts, closed=True, edgecolor='k') | ||
return RegularPolygon((0.5, 0.5), num_vars, radius=.5, edgecolor="k") | ||
|
||
def draw_circle_patch(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since draw_poly_patch
and dras_circle_patch
just return simple patches now, you can simplify all the overhead and create the appropriate patch directly in _gen_axes_patch
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, done
Simplifying this example has the potential to invite more users to actually understand it, instead of just copying it for their purposes. This is a good thing, apart from the natural advantage of having less code lines. I don't think it becomes too compact, since the main ingrediences stay the same. Is there any reason for no tests being run on this PR? |
It's run as part of the doc build.
You know, I'm not deleting lines just because I find this fun... |
Sorry, that wasn't clear from my side. I'm not asking for a test for this, nor for the functionality be tested within the tests outside of the circle-ci doc builds (which I think are sufficient). However I would expect to see something like the following: |
Uh, good point. Dunno what's happening. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to figure out why tests didn't run; might just work if you push a new commit.
spine_type='circle', | ||
path=Path.unit_regular_polygon(num_vars)) | ||
# unit_regular_polygon gives a polygon of radius 1 centered at | ||
# (0, 0) but we want a polygon of radius 0.5 centerer at (0.5, 0.5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/centerer/centred/
... by reusing already existing utilities to generate regular polygons.
Repushed, CI seems to be running. |
Test failure is due to travis flakiness. |
... by reusing already existing utilities to generate regular polygons.
PR Summary
PR Checklist