Skip to content

Commit 4c65d8e

Browse files
authored
[RELEASE] 0.18.2 bump version, added whatsnew (scikit-learn#9167)
* bump version, added whatsnew * pin matplotlib in circle so we don't get 2.0 styles * fix plot_stock_market.py to work on python2.7 and numpy1.6 * let's try unpinning sphinx for a change. * don't try to upgrade sphinx-gallery, just port the fix * clearly not my day * pin sphinx at 1.4 and docutils at 0.12 and light some incense.
1 parent bdfd838 commit 4c65d8e

File tree

5 files changed

+42
-15
lines changed

5 files changed

+42
-15
lines changed

build_tools/circle/build_doc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ popd
4949
# Using sphinx 1.4 for now until sphinx-gallery has a fix for sphinx 1.5
5050
# See https://github.com/sphinx-gallery/sphinx-gallery/pull/178 for more details
5151
conda create -n testenv --yes --quiet python numpy scipy \
52-
cython nose coverage matplotlib sphinx=1.4 pillow
52+
cython nose coverage matplotlib=1.5.3 sphinx=1.4 pillow docutils=0.12
5353
source activate testenv
5454

5555
# Build and install scikit-learn in dev mode

doc/sphinxext/sphinx_gallery/gen_gallery.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ def setup(app):
135135
app.add_config_value('sphinx_gallery_conf', gallery_conf, 'html')
136136
app.add_stylesheet('gallery.css')
137137

138-
if 'sphinx.ext.autodoc' in app._extensions:
138+
extensions_attr = '_extensions' if hasattr(app, '_extensions') else 'extensions'
139+
if 'sphinx.ext.autodoc' in getattr(app, extensions_attr):
139140
app.connect('autodoc-process-docstring', touch_empty_backreferences)
140141

141142
app.connect('builder-inited', generate_gallery_rst)

doc/whats_new.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@
55
Release history
66
===============
77

8+
.. _changes_0_18_2:
9+
10+
Version 0.18.2
11+
==============
12+
13+
**June 20, 2017**
14+
15+
.. topic:: Last release with Python 2.6 support
16+
17+
Scikit-learn 0.18 is the last major release of scikit-learn to support Python 2.6.
18+
Later versions of scikit-learn will require Python 2.7 or above.
19+
20+
21+
Changelog
22+
---------
23+
- Fixes for compatibility with NumPy 1.13.0: :issue:`7946` :issue:`8355` by `Loic Esteve`_.
24+
25+
- Minor compatibility changes in the examples :issue:`9010` :issue:`8040` :issue:`9149`.
26+
27+
28+
Code Contributors
29+
-----------------
30+
Aman Dalmia, Loic Esteve, Nate Guerin, Sergei Lebedev
31+
32+
833
.. _changes_0_18_1:
934

1035
Version 0.18.1

examples/applications/plot_stock_market.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
###############################################################################
7777
# Retrieve the data from Internet
7878

79+
7980
def quotes_historical_google(symbol, date1, date2):
8081
"""Get the historical data from Google finance.
8182
@@ -101,15 +102,15 @@ def quotes_historical_google(symbol, date1, date2):
101102
'output': 'csv'
102103
})
103104
url = 'http://www.google.com/finance/historical?' + params
104-
with urlopen(url) as response:
105-
dtype = {
106-
'names': ['date', 'open', 'high', 'low', 'close', 'volume'],
107-
'formats': ['object', 'f4', 'f4', 'f4', 'f4', 'f4']
108-
}
109-
converters = {0: lambda s: datetime.strptime(s.decode(), '%d-%b-%y')}
110-
return np.genfromtxt(response, delimiter=',', skip_header=1,
111-
dtype=dtype, converters=converters,
112-
missing_values='-', filling_values=-1)
105+
response = urlopen(url)
106+
dtype = {
107+
'names': ['date', 'open', 'high', 'low', 'close', 'volume'],
108+
'formats': ['object', 'f4', 'f4', 'f4', 'f4', 'f4']
109+
}
110+
converters = {0: lambda s: datetime.strptime(s.decode(), '%d-%b-%y')}
111+
return np.genfromtxt(response, delimiter=',', skip_header=1,
112+
dtype=dtype, converters=converters,
113+
missing_values='-', filling_values=-1)
113114

114115

115116
# Choose a time period reasonably calm (not too long ago so that we get
@@ -181,8 +182,8 @@ def quotes_historical_google(symbol, date1, date2):
181182
quotes_historical_google(symbol, d1, d2) for symbol in symbols
182183
]
183184

184-
close_prices = np.stack([q['close'] for q in quotes])
185-
open_prices = np.stack([q['open'] for q in quotes])
185+
close_prices = np.vstack([q['close'] for q in quotes])
186+
open_prices = np.vstack([q['open'] for q in quotes])
186187

187188
# The daily variations of the quotes are what carry most information
188189
variation = close_prices - open_prices
@@ -239,7 +240,7 @@ def quotes_historical_google(symbol, date1, date2):
239240

240241
# Plot the edges
241242
start_idx, end_idx = np.where(non_zero)
242-
#a sequence of (*line0*, *line1*, *line2*), where::
243+
# a sequence of (*line0*, *line1*, *line2*), where::
243244
# linen = (x0, y0), (x1, y1), ... (xm, ym)
244245
segments = [[embedding[:, start], embedding[:, stop]]
245246
for start, stop in zip(start_idx, end_idx)]

sklearn/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
3838
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
3939
#
40-
__version__ = '0.18.1'
40+
__version__ = '0.18.2'
4141

4242

4343
try:

0 commit comments

Comments
 (0)