-
Notifications
You must be signed in to change notification settings - Fork 510
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
Additional Refactoring of lib.plot [Part 3: other changes] #117
Conversation
|
I'm working on the docs for this, trying to fix the docs showing
However, I'm having trouble building the docs locally so I can't preview the changes to see if they are working. Should I just assume that the changes are OK and then check them after the buildbot releases a snapshot after the merge? Or do you have another option? The issues I'm having:
Am I missing something in my build flow?
|
|
I was looking at the issue with the docs for the deprecated methods a few days ago. It might be due to the commented-out line The ReST docs for The files in |
|
Thanks for the info, it allowed me to get the doc builds running locally so I can play around and try to fix things. Couple of notes for Future Me:
|
I had already changed that file in the master branch, see 128b28c
Yes, and I think so. There is also |
Decorated Functions + SphinxDoesn't look like any decorators will work. I tried switching to function-based decorators and tried using So what I've decided to do is simply add a line to the start of every deprecated function which raises def GetFontSizeTitle(self):
"""
Get Title font size (default is 15 point)
.. deprecated:: Feb 27, 2016
Use the :attr:`~wx.lib.plot.plotcanvas.PlotCanvas.fontSizeTitle`
property instead.
"""
pendingDeprecation('fontSizeTitle')
return self.fontSizeTitledef pendingDeprecation(new_func):
warn_txt = "`{}` is pending deprecation. Please use `{}` instead."
_warn(warn_txt.format(inspect.stack()[1][3], new_func),
PendingDeprecationWarning)The above renders correctly: Properties + SphinxThe other doc question I had was about properties. Right now, properties are rendered by sphinx as: However, I know that properties can be rendered and that the documentation must be on the getter. I'd like to have the full docstring rendered rather than just two "see X, Y" links which point to the very item that they're under. Is this something that we can change? A simple docstring on the property would be: @property
def fontSizeTitle(self):
"""
The current Title font size in points.
Use this property to change the size of the plot title. All units are in pts, and the default size is 15pt.
:getter: Return the size of the plot title.
:setter: Change the size of the plot title.
:type: int or float
"""
return self._fontSizeTitle |
|
Decorated functions: I thought that I had verified Properties: Andrea's implementation for generating docs for Python code doesn't actually use Sphinx's module scanner tool, etc. It does all the introspection and docstring extraction itself, in order to be able to generate things the same for those modules as it does for the extension modules. So the issue here is simply that the |
|
I took another look at it and realized that most of what was needed is already there, so I just pushed a change on master that will output the getter's docstring it is has one. |
|
@dougthor42, just FYI I made some minor changes to |
|
Thanks for the info! Also thanks for making the getter docstring change And sorry for stalling on this PR. Things have picked back up for me so I haven't had much time recently. |
+ added deprecation note to docstring of PolyPoint.setLogScale + Replaced PendingDeprecation decorator with function. + This fixes the documentation having `wrapper(*args, **kwargs)` + Fixed some minor errors due to package conversion + Updated sphinx x-refs to reflect new package structure.
+ Fixed typo in top-side ticks.
+ Changed default ticks to negative (extent out of plot rather an into plot). + Fixed tickLength setter - was setting unused self._tickWitch value + Added tickLengthPrinterScale property + axis values and labels should no longer overlap if tick lengths are negative.
|
When this PR is finished go ahead and remove the wip label and add the needs-review label. Thanks. |
|
@RobinD42 It's been over a year, I'm so sorry! 😭 I don't think I'll be able to get around to finishing this. The without this PR, the How do you want to proceed? Some options are:
|
|
I'll leave it up to you. If the current changes make sense to include we can merge this one, but it would also be nice to not lose track of the remaining todo items in case you or somebody else would like to work on them in the future. Maybe you could create an Issue with those items, links to this series of PRs and maybe a bit of explanation of what you had in mind for the remaining steps if they are not clear. |
|
Great idea. I've gone ahead and made separate issues for each item and updated the original PR message accordingly. The new issues are:
I've removed the WIP from the title and this is ready for review. |
|
Thanks! |
|
Does this update allow a plot to have multiple scales like the one in - https://matplotlib.org/gallery/api/two_scales.html ? |
|
TBH I don't remember, haha. My gut tells me no, but let me investigate a bit. |
|
@aKummur I've confirmed: Sadly the |
|
@dougthor42 Thank you for confirming. |



Update 2017-09-08
I will not be able to finish all the items in the PR 😢
Per @RobinD42's suggestion, I have made issues for all unfinished items so that someone else can complete them.
This PR now only makes the following changes:
wrapper(*args, **kwargs)in built docsAll the other items that I wanted to accomplish have their related Issue listed below.
Original PR message
(This PR replaces #112, as I mucked up the git history too much)
This PR will (hopefully) finish off all the changes that I had planned for lib.plot.
It will also include any feedback from Robin and anyone else.
PolyBarsandPolyHistogram(lib.plot: Use pens/brushes to customize PolyXXX classes #512)[ ] convertPlotGraphics.LogScaletotry..except[ ] rename items inPlotCanvas.EnableDiagonalsto something else. Or perhaps switch to enums?PolyPoints.pointsproperty (lib.plot: Remove the deep copy in PolyPoints.points property #513)ifstatement and math inPlotCanvas._Draw. (lib.plot: Clean up math in plotcanvas.PlotCanvas._Draw #514)PlotCanvas.UpdatePointLabelso that the event is only bound if the item is enabled. This would remove many of the if statements within the event handlers. (lib.plot: Only bind events if an item is enabled #515)PlotCanvas._drawAxesValueshas potential code duplication (with_drawGridand_drawTicks) (lib.plot: Potential code duplication in plotcanvas.PlotCanvas - opportunity for refactoring #516)PlotCanvas._drawAxesValues: update the bounding boxes when adding right and top values (lib.plot: PlotCanvas._drawAxesValues should update the bounding box when adding right and top values #517)PlotCanvas._drawAxesLabels: Fix bug where axes values get too big when "this" is turned off. Not sure what "this" is...wrapper(*args, **kwargs)in built docs [needs confirmation]