Skip to content

Commit

Permalink
Removed more f-strings for py35 support
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyod committed Sep 20, 2018
1 parent 3f7f774 commit c108c1d
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 39 deletions.
6 changes: 4 additions & 2 deletions docs/source/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def main():
x, y = FFTKDE(kernel='gaussian', bw=100).fit(data)(2**10)
timed = (time.perf_counter() - st)*1000
plt.plot(x, y)
plt.title('One million observations on\n1024 grid' + f' points in {int(round(timed,0))} ms', fontsize=FONTSIZE)
plt.title(('One million observations on\n1024 grid' +
' points in {} ms'.format(int(round(timed,0)))),
fontsize=FONTSIZE)
data = np.random.choice(data, size=100,replace=False)
plt.scatter(data, np.zeros_like(data), marker='|', color='red', label='Data', s=3)
plt.yticks([]); plt.xticks([]);
Expand Down Expand Up @@ -149,7 +151,7 @@ def main():
data = norm(loc=0, scale=1).rvs(2**6)
for bw in [0.1, 'silverman', 1.5]:
x, y = FFTKDE(kernel='triweight', bw=bw).fit(data).evaluate()
plt.plot(x, y, label=f'KDE estimate, bw={bw}')
plt.plot(x, y, label='KDE estimate, bw={}'.format(bw))

##############################
plt.scatter(data, np.zeros_like(data), marker='|', color='red', label='Data')
Expand Down
124 changes: 89 additions & 35 deletions docs/source/introduction.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/source/kde_animations.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def update(i):
y = FFTKDE(bw=bw).fit(data)(x)
line.set_ydata(y)
bw_formatted = str(round(bw, 3)).ljust(5, '0')
ax.set_xlabel(f'Bandwidth $h$: {bw_formatted}', fontsize=14)
ax.set_xlabel('Bandwidth $h$: {}'.format(bw_formatted), fontsize=14)
print(label, bw)
return line, ax

Expand Down
2 changes: 1 addition & 1 deletion docs/source/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def KDE_KDEpyFFTKDE(data, grid_pts, kernel='epa'):
break

plt.semilogy(dims_list, [t[1] for t in agg_times],
zorder=15, label=f'$N = 10^{data_size}$')
zorder=15, label='$N = 10^{}$'.format(data_size))
plt.fill_between(dims_list, [t[0] for t in agg_times],
[t[2] for t in agg_times], alpha=0.5, zorder=-15)

Expand Down

0 comments on commit c108c1d

Please sign in to comment.