Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1d89de2

Browse filesBrowse files
committed
Merge pull request #5769 from QuLogic/non-random-docs
De-randomize doc builds
2 parents 4c83537 + 8314b8b commit 1d89de2
Copy full SHA for 1d89de2

File tree

Expand file treeCollapse file tree

11 files changed

+38
-27
lines changed
Filter options
Expand file treeCollapse file tree

11 files changed

+38
-27
lines changed

‎doc/pyplots/whats_new_98_4_fancy.py

Copy file name to clipboardExpand all lines: doc/pyplots/whats_new_98_4_fancy.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def make_boxstyles(ax):
99
styles = mpatch.BoxStyle.get_styles()
1010

11-
for i, (stylename, styleclass) in enumerate(styles.items()):
11+
for i, (stylename, styleclass) in enumerate(sorted(styles.items())):
1212
ax.text(0.5, (float(len(styles)) - 0.5 - i)/len(styles), stylename,
1313
ha="center",
1414
size=fontsize,

‎examples/api/filled_step.py

Copy file name to clipboardExpand all lines: examples/api/filled_step.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import itertools
2+
from collections import OrderedDict
23
from functools import partial
34

45
import numpy as np
@@ -174,9 +175,9 @@ def stack_hist(ax, stacked_data, sty_cycle, bottoms=None,
174175
hatch_cycle = cycler('hatch', ['/', '*', '+', '|'])
175176

176177
# make some synthetic data
178+
np.random.seed(0)
177179
stack_data = np.random.randn(4, 12250)
178-
dict_data = {lab: d for lab, d in zip(list(c['label'] for c in label_cycle),
179-
stack_data)}
180+
dict_data = OrderedDict(zip((c['label'] for c in label_cycle), stack_data))
180181

181182
# work with plain arrays
182183
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 4.5), tight_layout=True)

‎examples/color/named_colors.py

Copy file name to clipboardExpand all lines: examples/color/named_colors.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@
3333
sat = [color[1] for color in hsv]
3434
val = [color[2] for color in hsv]
3535

36-
# Sort by hue, saturation and value.
37-
ind = np.lexsort((val, sat, hue))
36+
# Get the color names by themselves.
37+
names = [color[0] for color in colors_]
38+
39+
# Sort by hue, saturation, value and name.
40+
ind = np.lexsort((names, val, sat, hue))
3841
sorted_colors = [colors_[i] for i in ind]
3942

4043
n = len(sorted_colors)

‎examples/pylab_examples/arrow_demo.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/arrow_demo.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def draw_arrow(pair, alpha=alpha, ec=ec, labelcolor=labelcolor):
214214
plt.text(x, y, label, size=label_text_size, ha='center', va='center',
215215
color=labelcolor or fc)
216216

217-
for p in positions.keys():
217+
for p in sorted(positions):
218218
draw_arrow(p)
219219

220220
# test data

‎examples/pylab_examples/boxplot_demo2.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/boxplot_demo2.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
randomDists = ['Normal(1,1)', ' Lognormal(1,1)', 'Exp(1)', 'Gumbel(6,4)',
1717
'Triangular(2,9,11)']
1818
N = 500
19+
np.random.seed(0)
1920
norm = np.random.normal(1, 1, N)
2021
logn = np.random.lognormal(1, 1, N)
2122
expo = np.random.exponential(1, N)

‎examples/pylab_examples/demo_tight_layout.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/demo_tight_layout.py
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11

22
import matplotlib.pyplot as plt
3+
import itertools
34
import warnings
45

5-
import random
6-
fontsizes = [8, 16, 24, 32]
6+
7+
fontsizes = itertools.cycle([8, 16, 24, 32])
78

89

910
def example_plot(ax):
1011
ax.plot([1, 2])
11-
ax.set_xlabel('x-label', fontsize=random.choice(fontsizes))
12-
ax.set_ylabel('y-label', fontsize=random.choice(fontsizes))
13-
ax.set_title('Title', fontsize=random.choice(fontsizes))
12+
ax.set_xlabel('x-label', fontsize=next(fontsizes))
13+
ax.set_ylabel('y-label', fontsize=next(fontsizes))
14+
ax.set_title('Title', fontsize=next(fontsizes))
15+
1416

1517
fig, ax = plt.subplots()
1618
example_plot(ax)

‎examples/pylab_examples/spectrum_demo.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/spectrum_demo.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import matplotlib.pyplot as plt
22
import numpy as np
33

4+
5+
np.random.seed(0)
6+
47
dt = 0.01
58
Fs = 1/dt
69
t = np.arange(0, 10, dt)

‎examples/pylab_examples/system_monitor.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/system_monitor.py
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
import numpy as np
44

55

6-
def get_memory():
6+
def get_memory(t):
77
"Simulate a function that returns system memory"
8-
return 100*(0.5 + 0.5*np.sin(0.5*np.pi*time.time()))
8+
return 100 * (0.5 + 0.5 * np.sin(0.5 * np.pi * t))
99

1010

11-
def get_cpu():
11+
def get_cpu(t):
1212
"Simulate a function that returns cpu usage"
13-
return 100*(0.5 + 0.5*np.sin(0.2*np.pi*(time.time() - 0.25)))
13+
return 100 * (0.5 + 0.5 * np.sin(0.2 * np.pi * (t - 0.25)))
1414

1515

16-
def get_net():
16+
def get_net(t):
1717
"Simulate a function that returns network bandwidth"
18-
return 100*(0.5 + 0.5*np.sin(0.7*np.pi*(time.time() - 0.1)))
18+
return 100 * (0.5 + 0.5 * np.sin(0.7 * np.pi * (t - 0.1)))
1919

2020

21-
def get_stats():
22-
return get_memory(), get_cpu(), get_net()
21+
def get_stats(t):
22+
return get_memory(t), get_cpu(t), get_net(t)
2323

2424
fig, ax = plt.subplots()
2525
ind = np.arange(1, 4)
@@ -28,7 +28,7 @@ def get_stats():
2828
plt.show(block=False)
2929

3030

31-
pm, pc, pn = plt.bar(ind, get_stats())
31+
pm, pc, pn = plt.bar(ind, get_stats(0))
3232
centers = ind + 0.5*pm.get_width()
3333
pm.set_facecolor('r')
3434
pc.set_facecolor('g')
@@ -42,7 +42,7 @@ def get_stats():
4242

4343
start = time.time()
4444
for i in range(200): # run for a little while
45-
m, c, n = get_stats()
45+
m, c, n = get_stats(i / 10.0)
4646

4747
# update the animated artists
4848
pm.set_height(m)

‎examples/pylab_examples/xcorr_demo.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/xcorr_demo.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import matplotlib.pyplot as plt
22
import numpy as np
33

4+
5+
np.random.seed(0)
6+
47
x, y = np.random.randn(2, 100)
58
fig = plt.figure()
69
ax1 = fig.add_subplot(211)

‎lib/matplotlib/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ def param(func):
16901690
arg_names = []
16911691
elif len(_arg_names) > 1 and (positional_parameter_names is None):
16921692
# we got no manual parameter names but more than an 'ax' ...
1693-
if len(set(replace_names) - set(_arg_names[1:])) == 0:
1693+
if len(replace_names - set(_arg_names[1:])) == 0:
16941694
# all to be replaced arguments are in the list
16951695
arg_names = _arg_names[1:]
16961696
else:
@@ -1838,7 +1838,7 @@ def inner(ax, *args, **kwargs):
18381838
_repl = "* All arguments with the following names: '{names}'."
18391839
if replace_all_args:
18401840
_repl += "\n* All positional arguments."
1841-
_repl = _repl.format(names="', '".join(replace_names))
1841+
_repl = _repl.format(names="', '".join(sorted(replace_names)))
18421842
inner.__doc__ = (pre_doc +
18431843
_DATA_DOC_APPENDIX.format(replaced=_repl))
18441844
if not python_has_wrapped:

‎lib/matplotlib/artist.py

Copy file name to clipboardExpand all lines: lib/matplotlib/artist.py
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,8 +1267,7 @@ def aliased_name(self, s):
12671267

12681268
if s in self.aliasd:
12691269
return s + ''.join([' or %s' % x
1270-
for x
1271-
in six.iterkeys(self.aliasd[s])])
1270+
for x in sorted(self.aliasd[s])])
12721271
else:
12731272
return s
12741273

@@ -1284,8 +1283,7 @@ def aliased_name_rest(self, s, target):
12841283

12851284
if s in self.aliasd:
12861285
aliases = ''.join([' or %s' % x
1287-
for x
1288-
in six.iterkeys(self.aliasd[s])])
1286+
for x in sorted(self.aliasd[s])])
12891287
else:
12901288
aliases = ''
12911289
return ':meth:`%s <%s>`%s' % (s, target, aliases)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.