8000 plot_stock_market example may fail in quotes_historical_google · Issue #9172 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

plot_stock_market example may fail in quotes_historical_google #9172

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

Closed
jnothman opened this issue Jun 20, 2017 · 5 comments · Fixed by #9437
Closed

plot_stock_market example may fail in quotes_historical_google #9172

jnothman opened this issue Jun 20, 2017 · 5 comments · Fixed by #9437
Labels
Build / CI Easy Well-defined and straightforward way to resolve Sprint
Milestone

Comments

@jnothman
Copy link
Member

We recently changed plot_stock_market to use Google's API, not Yahoo's. It looks like it can occasionally result in an exception when Google's API gives us an empty response:

/home/ubuntu/miniconda/envs/testenv/bin/sphinx-build:35: UserWarning: genfromtxt: Empty input file: "<http.client.HTTPResponse object at 0x2b95e1c85780>"
/home/ubuntu/scikit-learn/doc/sphinxext/sphinx_gallery/gen_rst.py:491: UserWarning: ________________________________________________________________________________
/home/ubuntu/scikit-learn/examples/applications/plot_stock_market.py failed to execute correctly:Traceback (most recent call last):
  File "/home/ubuntu/scikit-learn/doc/sphinxext/sphinx_gallery/gen_rst.py", line 472, in execute_code_block
    exec(code_block, example_globals)
  File "<string>", line 104, in <module>
  File "<string>", line 104, in <listcomp>
  File "<string>", line 35, in quotes_historical_google
  File "/home/ubuntu/miniconda/envs/testenv/lib/python3.6/site-packages/numpy/lib/npyio.py", line 1775, in genfromtxt
    converters[i].update(conv, locked=True,
IndexError: list index out of range
________________________________________________________________________________

We should retry when there is an empty response. Or at least it should probably not fail the entire build.

@jnothman jnothman added this to the 0.19 milestone Jun 20, 2017
@jnothman jnothman changed the title plot_stock_market example is failing in quotes_historical_google plot_stock_market example may fail in quotes_historical_google Jun 20, 2017
@amueller
Copy link
Member

This seems to be a different error than what I see in #9167, which is

../examples/applications/plot_stock_market.py is not compiling:
Traceback (most recent call last):
  File "/home/ubuntu/scikit-learn/doc/sphinxext/sphinx_gallery/gen_rst.py", line 467, in execute_script
    exec(code_block, example_globals)
  File "<string>", line 104, in <module>
  File "<string>", line 27, in quotes_historical_google
AttributeError: addinfourl instance has no attribute '__exit__'

@amueller
Copy link
Member

FYI this is blocking 0.18.2

@amueller
Copy link
Member

hm so we are not checking examples on python2.7 on master, I guess?

@amueller
Copy link
Member

Also uses numpy.stack with was introduced in numpy 1.10.0: https://docs.scipy.org/doc/numpy/reference/generated/numpy.stack.html

@lesteve
Copy link
Member
lesteve commented Jun 26, 2017

We recently changed plot_stock_market to use Google's API, not Yahoo's. It looks like it can occasionally result in an exception when Google's API gives us an empty response:

Yeah we saw that during the sprint with @vene. I think we should have some simple retry mechanism to avoid this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build / CI Easy Well-defined and straightforward way to resolve Sprint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0