This project is developed using nbdev, a way to create delightful software with Jupyter notebooks. The Python library and docs are automatically created from the notebooks in the /nbs
directory.
Note: nbdev works on macOS, Linux, and most Unix-style operating systems. It works on Windows under WSL, but some features will not work under cmd or Powershell.
Follow the install nbdev instructions, specifically:
- Install jupyter notebook
- Install nbdev
- Install quarto
- After cloning the repository, run this command inside it: nbdev_install_hooks
- Run nbdev_export inside the project directory
- Run pip install -e '.[dev]' inside the project directory
Visit https://hugetim.github.io/nbstata/dev_docs_index.html to get oriented.
After making changes to the /nbs
notebooks, you should run nbdev_prepare and make any necessary changes in order to pass all the tests.
(You may also make limited changes directly to the .py
files in the /nbstata
folder, in which case you should sync those changes back to the notebooks with nbdev_update.)
ReviewNB gives us visual diffs for notebooks and enables PR comments specific to a cell: https://app.reviewnb.com/hugetim/nbstata/ (free account needed to login)
- Docs are automatically created from the notebooks in the
/nbs
folder. - You can preview the docs locally by running nbdev_preview. While in preview mode, you can make updates to notebooks and they will be reflected (after a small delay) in your browser.
- The @patch_to decorator is occasionally used to break up class definitions into separate cells.