-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
De-randomize doc builds #5769
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
De-randomize doc builds #5769
Changes from all commits
1856ca3
800d4ad
093c819
a9a0251
7a57fde
e9c762d
8314b8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
|
||
np.random.seed(0) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
x, y = np.random.randn(2, 100) | ||
fig = plt.figure() | ||
ax1 = fig.add_subplot(211) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1690,7 +1690,7 @@ def param(func): | |
arg_names = [] | ||
elif len(_arg_names) > 1 and (positional_parameter_names is None): | ||
# we got no manual parameter names but more than an 'ax' ... | ||
if len(set(replace_names) - set(_arg_names[1:])) == 0: | ||
if len(replace_names - set(_arg_names[1:])) == 0: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really sure I understand why this is needed and if its safe if replace_names contains duplicates. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok thats fine |
||
# all to be replaced arguments are in the list | ||
arg_names = _arg_names[1:] | ||
else: | ||
|
@@ -1838,7 +1838,7 @@ def inner(ax, *args, **kwargs): | |
_repl = "* All arguments with the following names: '{names}'." | ||
if replace_all_args: | ||
_repl += "\n* All positional arguments." | ||
_repl = _repl.format(names="', '".join(replace_names)) | ||
_repl = _repl.format(names="', '".join(sorted(replace_names))) | ||
inner.__doc__ = (pre_doc + | ||
_DATA_DOC_APPENDIX.format(replaced=_repl)) | ||
if not python_has_wrapped: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1267,8 +1267,7 @@ def aliased_name(self, s): | |
|
||
if s in self.aliasd: | ||
return s + ''.join([' or %s' % x | ||
for x | ||
in six.iterkeys(self.aliasd[s])]) | ||
for x in sorted(self.aliasd[s])]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this affect performance? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure, but there's usually only a few aliases and a whole lot more string manipulation to create the full docstrings so I'd wager not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these are only called building the docs and as a failure mode in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and once at import time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok that seems fine |
||
else: | ||
return s | ||
|
||
|
@@ -1284,8 +1283,7 @@ def aliased_name_rest(self, s, target): | |
|
||
if s in self.aliasd: | ||
aliases = ''.join([' or %s' % x | ||
for x | ||
in six.iterkeys(self.aliasd[s])]) | ||
for x in sorted(self.aliasd[s])]) | ||
else: | ||
aliases = '' | ||
return ':meth:`%s <%s>`%s' % (s, target, aliases) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest adding a comment that the random seeding is only to make the example reproducible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many of these in the examples without any comment; add them as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many issues with the examples so I wouldn't expect to fix all of them but I would like to do this in new examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.