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

Update CONTRIBUTING_DOCS.md #2190

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update CONTRIBUTING_DOCS.md #2190

wants to merge 2 commits into from

Conversation

NiWaRe
Copy link
Contributor

@NiWaRe NiWaRe commented Aug 21, 2024

Added some Troubleshooting comments and some more details around the generation of notebook mds.

Added some Troubleshooting comments and some more details around the generation of notebook mds.
@NiWaRe NiWaRe added the documentation Improvements or additions to documentation label Aug 21, 2024
@NiWaRe NiWaRe requested a review from scottire August 21, 2024 17:54
@NiWaRe NiWaRe self-assigned this Aug 21, 2024
@NiWaRe NiWaRe requested a review from a team as a code owner August 21, 2024 17:54
Copy link
Contributor

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@circle-job-mirror
Copy link

circle-job-mirror bot commented Aug 21, 2024

Copy link
Contributor Author

@NiWaRe NiWaRe left a comment

Choose a reason for hiding this comment

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

Hey @scottire, checked out this branch and ran the notebook generation step again. One small typo and one error.

@@ -116,11 +116,10 @@ To improve docs, basically follow FastAPI's instructions to create good Swagger

### Notebook Doc Gen

Run `python scripts/generate_notebook.py` inside of `docs/` to automatically create a markdown version of the notebook. Add all new files to the commit.
From within the `docs` directory, run `python ./scripts/generate_notebook.py`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@scottire the file should be generate_notebooks.py (with an 's')

notebook_exporter.preprocessors = [ClearOutputPreprocessor()]
notebook_content, _ = notebook_exporter.from_filename(notebook_path)
markdown_exporter = MarkdownExporter()
output, _ = markdown_exporter.from_notebook_node(notebook_content)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@scottire there seems to be some error in the notebook_content you're passing to markdown_exporter.from_notebook_node(notebook_content). This is the error I'm getting when I run it:

Traceback (most recent call last):
  File "/Users/niware_wb/Documents/wandb_internal/smle/demos/llms/weave/weave_source/docs/./scripts/generate_notebooks.py", line 67, in <module>
    main()
  File "/Users/niware_wb/Documents/wandb_internal/smle/demos/llms/weave/weave_source/docs/./scripts/generate_notebooks.py", line 60, in main
    export_all_notebooks_in_primary_dir()
  File "/Users/niware_wb/Documents/wandb_internal/smle/demos/llms/weave/weave_source/docs/./scripts/generate_notebooks.py", line 53, in export_all_notebooks_in_primary_dir
    export_notebook(
  File "/Users/niware_wb/Documents/wandb_internal/smle/demos/llms/weave/weave_source/docs/./scripts/generate_notebooks.py", line 31, in export_notebook
    output, _ = markdown_exporter.from_notebook_node(notebook_content)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niware_wb/Documents/wandb_internal/smle/demos/llms/weave/weave_source/venv/lib/python3.11/site-packages/nbconvert/exporters/templateexporter.py", line 408, in from_notebook_node
    nb_copy, resources = super().from_notebook_node(nb, resources, **kw)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niware_wb/Documents/wandb_internal/smle/demos/llms/weave/weave_source/venv/lib/python3.11/site-packages/nbconvert/exporters/exporter.py", line 150, in from_notebook_node
    if "language" in nb["metadata"]:
                     ~~^^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants