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

finance ochl->ohlc #1920

Merged
merged 29 commits into from
Aug 17, 2013
Merged

finance ochl->ohlc #1920

merged 29 commits into from
Aug 17, 2013

Conversation

tacaswell
Copy link
Member

Implemented wrapper layer to merge in changes from PR #1783

@@ -26,6 +26,7 @@
from matplotlib.patches import Rectangle
from matplotlib.transforms import Affine2D

from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
Copy link
Member

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.

@tacaswell
Copy link
Member Author

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
Copy link
Member

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?

@tacaswell
Copy link
Member Author

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?

@tacaswell
Copy link
Member Author

@mdboom This is a API change and should probably go in 1.3 if it is going to go in.

@mdboom
Copy link
Member

mdboom commented May 13, 2013

@tacaswell: Thanks. It should get an entry in whats_new and api_changes and a test (probably doesn't need an image comparison test) and then I think it's good to go.

@tacaswell
Copy link
Member Author

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 quotes as an argument. Should all of these functions have *_ochl and *_ohlc versions created as well?

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.

@tacaswell
Copy link
Member Author

need to merge PR #2077 into this branch

(mostly a note to my self so I can find it again later)

@tacaswell
Copy link
Member Author

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?

@NelleV
Copy link
Member

NelleV commented May 30, 2013

@NelleV https://github.com/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:
urlname = ("blah" +
"blah")

or
urlname = ("blah"
"blah")

there has been discussion on python-dev on removing the latter, so I would
go with the splitting with the + sign.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1920#issuecomment-18661681
.

@tacaswell
Copy link
Member Author

@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
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Or absolute imports)

@efiring
Copy link
Member

efiring commented Jul 16, 2013

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depreciated -> deprecated

@mdboom
Copy link
Member

mdboom commented Jul 16, 2013

In response to @efiring: I agree, this is highly specialized, and long term should probably be (at least) be moved to mpl_toolkits, or even better to its own independent project. But there are a lot of other things in matplotlib in that boat and I'd rather devise a plan for outward migration that works well for all such things. I don't think we should let that hold up this pull request which is valuable improvement in any event.

@tacaswell: Can you rebase so that the diff is clean again and we can go through for a (hopefully last) round of reviews?

@tacaswell
Copy link
Member Author

Currently traveling, I will get to this over the weekend.

I have no protest to this getting pulled out.

Tom
On Jul 16, 2013 5:22 PM, "Michael Droettboom" notifications@github.com
wrote:

In response to @efiring https://github.com/efiring: I agree, this is
highly specialized, and long term should probably be (at least) be moved to
mpl_toolkits, or even better to its own independent project. But there
are a lot of other things in matplotlib in that boat and I'd rather devise
a plan for outward migration that works well for all such things. I don't
think we should let that hold up this pull request which is valuable
improvement in any event.

@tacaswell https://github.com/tacaswell: Can you rebase so that the
diff is clean again and we can go through for a (hopefully last) round of
reviews?


Reply to this email directly or view it on GitHubhttps://github.com//pull/1920#issuecomment-21074865
.

kramer650 and others added 5 commits July 21, 2013 16:31
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.
@tacaswell
Copy link
Member Author

I don't understand the errors coming out of travis, two of them look like AttributeErrors coming out of nose and the third is a font issue.

@mdboom
Copy link
Member

mdboom commented Jul 22, 2013

👍 from me. Thanks for all of your hard work on this!

@tacaswell
Copy link
Member Author

The travis failures are unrelated, because this module has no test coverage.

@tacaswell
Copy link
Member Author

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 matplotlib proper.

@mdboom
Copy link
Member

mdboom commented Aug 5, 2013

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?

dmcdougall added a commit that referenced this pull request Aug 17, 2013
@dmcdougall dmcdougall merged commit 17216bb into matplotlib:master Aug 17, 2013
@tacaswell tacaswell deleted the ochl_to_ohlc branch September 11, 2013 15:20
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jan 10, 2015
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jan 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants