Skip to content
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

DOC: add option for skipping execution of code blocks #39360

Closed
wants to merge 1 commit into from

Conversation

afeld
Copy link
Member

@afeld afeld commented Jan 23, 2021

Came up as an idea at the documentation meeting (#39183). This should make documentation builds faster for people who aren't working on the code samples.

$ time python make.py --single getting_started/comparison/comparison_with_spreadsheets.rst
…
real    0m22.119s
user    0m13.745s
sys     0m1.700s
$ time python make.py --no-ipython --single getting_started/comparison/comparison_with_spreadsheets.rst
…
real    0m17.481s
user    0m11.750s
sys     0m1.521s

Very open to alternatives names to --no-ipython.

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

@afeld afeld added the Docs label Jan 23, 2021
This should make documentation builds faster for people who aren't
working on the code samples.
@afeld
Copy link
Member Author

afeld commented Jan 23, 2021

Speeds up full build by 36% in wall clock time.

$ python make.py clean && time python make.py html --num-jobs 4
…
real    7m51.219s
user    17m35.420s
sys     1m10.225s
$ python make.py clean && time python make.py html --no-ipython --num-jobs 4
…
real    5m1.531s
user    13m12.087s
sys     0m45.678s

Ran these in GitHub Codespaces.

@@ -302,6 +306,12 @@ def main():
argparser.add_argument(
"--no-api", default=False, help="omit api and autosummary", action="store_true"
)
argparser.add_argument(
"--no-ipython",
default=False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is default needed with action="store_true"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure; I just copied from --no-api above.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcoGorelli MarcoGorelli self-requested a review January 25, 2021 14:41
@@ -595,6 +595,9 @@ reducing the turn-around time for checking your changes.
python make.py clean
python make.py --no-api

# skip executing the code blocks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting why someone might do this - slight performance improvements :)

@alimcmaster1 alimcmaster1 added this to the 1.3 milestone Jan 27, 2021
@jreback
Copy link
Contributor

jreback commented Feb 11, 2021

status here?

@afeld
Copy link
Member Author

afeld commented Feb 11, 2021

On second thought, not sure it's worth the added complexity for the narrow use case. If someone disagrees, happy to reopen and fix. Thanks for the reviews!

@afeld afeld closed this Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants