nx-guides icon indicating copy to clipboard operation
nx-guides copied to clipboard

Notebook on Lowest Common Ancestor

Open dtekinoglu opened this issue 3 years ago • 10 comments
trafficstars

dtekinoglu avatar Apr 19 '22 21:04 dtekinoglu

Hello @MridulS , I am continuously getting the following error:

make: *** [Makefile:20: html] Error 1

Do you have any idea about what could be the reason?

dtekinoglu avatar Apr 22 '22 20:04 dtekinoglu

@dtekinoglu You need to include the content in nx-guides/content/algorithms/index.md

inomag avatar Apr 25 '22 03:04 inomag

Thank you! @inomag

dtekinoglu avatar Apr 25 '22 12:04 dtekinoglu

Hi @dtekinoglu, I am not sure what is wrong here but I think you can make the following changes -

  • Instead of using images in base64 form, you can directly save the static images in a images folder in the same location and use them (Not the ones generated by code)
  • You have written !pip install pydot in the code, which might cause some problems. Include the necessary dependencies in requirements.txt

inomag avatar Apr 25 '22 17:04 inomag

@dtekinoglu Hmm there are some weird markdown cells here. Can you try running this on your notebook?

$ jupytext notebook.ipynb --to myst

and then push it here?

Thanks!

MridulS avatar Apr 25 '22 18:04 MridulS

Thank you @MridulS it passes the checks now 😄 I initally included a quiz cell which requires user input, but I thought that it is not supported. Thus, I removed that part. Am I correct? Do you suggest me to add it back?

dtekinoglu avatar Apr 25 '22 18:04 dtekinoglu

I initally included a quiz cell which requires user input, but I thought that it is not supported. Thus, I removed that part. Am I correct?

Yeah we are not that fancy just yet! For now let's just keep narrative notebooks for our users :)

MridulS avatar Apr 25 '22 18:04 MridulS

You can check the doc build here https://output.circle-artifacts.com/output/job/427d7bcf-0a12-412e-af58-618e4985f1e2/artifacts/0/site/_build/html/content/algorithms/lca/LCA.html

Please do checkout the suggestions by @inomag, they should help with cleaning up the output :)

MridulS avatar Apr 25 '22 18:04 MridulS

@MridulS how can I apply lint pre-commit changes for the notebooks?

dtekinoglu avatar Jul 18 '22 21:07 dtekinoglu

@dtekinoglu I pushed the changes required to make the linters happy. It needs to run the pre-commit linters on the jupyter notebook (.ipynb) before converting it to myst.

# The following commands finds ALL the .md files in the repository
$ find content/ -name "*.md" -exec jupytext --to notebook {} \;
# Run pre-commit on all files
$ pre-commit run --all-files --show-diff-on-failure --color always
# Convert all the new "cleaned" ipynb files to myst
$ find content/ -name "*.ipynb" -exec jupytext --to md:myst {} \;
# Remove the .ipynb files
$ find content/ -name "*.ipynb" -exec rm {} \;

After this you should see the changes the linters made inside the markdown myst files. I know this isn't an ideal workflow but currently nbqa doesn't natively support myst format.

MridulS avatar Jul 21 '22 12:07 MridulS

@dtekinoglu well finally did the review :) I'll go ahead and merge this. Thanks for your contributions :)

MridulS avatar Mar 31 '23 09:03 MridulS