-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add Normal mixture example, fixup check_toc script #4294
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
Changes from all commits
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 |
---|---|---|
|
@@ -5,16 +5,16 @@ | |
You can run it manually with `pre-commit run check-toc --all`. | ||
""" | ||
|
||
import json | ||
from pathlib import Path | ||
import argparse | ||
import ast | ||
Comment on lines
-8
to
+10
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. these aren't sorted, but their order will be sorted out with #4239 (which needs to have upstream/master merged anyway) |
||
|
||
if __name__ == "__main__": | ||
toc_examples = (Path("docs") / "source/notebooks/table_of_contents_examples.js").read_text() | ||
toc_tutorials = (Path("docs") / "source/notebooks/table_of_contents_tutorials.js").read_text() | ||
toc_keys = { | ||
**json.loads(toc_examples[toc_examples.find("{") :]), | ||
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. what was wrong with th eold way? 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. if you included a trailing comma then you'd get a mysterious
, while |
||
**json.loads(toc_tutorials[toc_tutorials.find("{") :]), | ||
**ast.literal_eval(toc_examples[toc_examples.find("{") :]), | ||
**ast.literal_eval(toc_tutorials[toc_tutorials.find("{") :]), | ||
}.keys() | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("filenames", nargs="*") | ||
|
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.
My bad here, I erroneously added this in #4262 😳 This script does take file names though (via
argparse
)