-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
finance ochl->ohlc #1920
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
finance ochl->ohlc #1920
Conversation
@@ -26,6 +26,7 @@ | |||
from matplotlib.patches import Rectangle | |||
from matplotlib.transforms import Affine2D | |||
|
|||
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation |
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.
it is best to import this from the cbook module.
I will get to the documentation changes later. |
@@ -486,46 +532,48 @@ def candlestick2(ax, opens, closes, highs, lows, width=4, | |||
return value is lineCollection, barCollection | |||
""" | |||
|
|||
# note this code assumes if any value open, close, low, high is | |||
# note this code assumes if any value open, low, high, close is |
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.
Don't you want this comment to use the order open, high, low, close?
Still haven't gotten to the documentation changes. I've been kinda crazy the last month or so. @NelleV It looks like none of the functions in this file are the numpy style, should I do just the functions I touched, or would it be better to make a different PR with all of the documentation fixed? |
@mdboom This is a API change and should probably go in 1.3 if it is going to go in. |
@tacaswell: Thanks. It should get an entry in |
Going over this again last night I noticed some additional subtle api changes that I had missed before. The expected order of elements a nested sequence are also changed from [(d, open, close, high, low, ...), ...] -> [(d, open, high, low, close, ...), ...]. This affects the return values of the yahoo related functions and any of the functions that take What sort of test should this get if not an image comparison? I don't think anything in this file is currently tested in anyway. |
need to merge PR #2077 into this branch (mostly a note to my self so I can find it again later) |
Now that I have touched basically every function in this module, what tests should I add? Should I smash most of these commits down to one? @NelleV How should I deal with the very long URL on line 395? |
It seem to be a string, hence you can split it as you would split a string: or there has been discussion on python-dev on removing the latter, so I would
|
@dmcdougall Now that things have calmed down a bit can this get some attention? |
@@ -26,6 +29,7 @@ | |||
from matplotlib.patches import Rectangle | |||
from matplotlib.transforms import Affine2D | |||
|
|||
from cbook import mplDeprecation |
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.
Nitpick: can you please use explicit imports? from .cbook import mplDeprecation
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.
(Or absolute imports)
I don't want to interfere with all the work that has gone into trying to straighten out this module, but it raises a larger question: should such a specialized module even be part of the mpl core distribution? I think the answer is clearly "no". It should be in an external toolkit, or an example, or a cookbook, but it should not be accessible via "from matplotlib import ...". |
Changes in 1.4.x | ||
================ | ||
|
||
* In :module:`~matplotlib.finance`, almost all functions have beeen depreciated and |
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.
depreciated
-> deprecated
In response to @efiring: I agree, this is highly specialized, and long term should probably be (at least) be moved to @tacaswell: Can you rebase so that the diff is clean again and we can go through for a (hopefully last) round of reviews? |
Currently traveling, I will get to this over the weekend. I have no protest to this getting pulled out. Tom
|
In the financial world, a bar-chart is commonly called an OHLC-chart or "Open-High-Low-Close chart". Also see http://en.wikipedia.org/wiki/Open-high-low-close_chart or simply google around. To my surprise this library uses a sequence of OCHL instead of OHLC. Although it changes the API, I found it important to comply with financial industry standards. This makes it easier to implement this library in existing financial software and thus more likely to be used in the future.
Added deprecation warning to `plot_day_summary2` and returned call signature to what it was. Added alias `plot_day_summary_ochl` with same call signature as `plot_day_summary2`. renamed the modified function to `plot_day_summary_ohlc`. The first two functions simply call the third with the arguments re-ordered.
fixed naming on plot_day_summary2_*
wrapped candlestick
wrapper functions).
tweaked import
I don't understand the errors coming out of travis, two of them look like |
👍 from me. Thanks for all of your hard work on this! |
Fixed bug in `parse_yahoo_historical_ohlc`
The travis failures are unrelated, because this module has no test coverage. |
As near as I can tell, the documentation for this module is not generated by sphinx. I added it to the api list, but this seems at cross purposes to pulling this module out of |
I think as long as it's in matplotlib, it should probably be in the documentation. Maybe just add a module-level docstring (which would also appear in the HTML docs), that says this module is deprecated? |
Deprecated in matplotlib#1920 merged to master in 17216bb
Deprecated in matplotlib#1920 merged to master in 17216bb
Implemented wrapper layer to merge in changes from PR #1783