From 1af6cc0d5eb535736bdc7fe012960233dd29bb9f Mon Sep 17 00:00:00 2001 From: Aditya Yadav Date: Mon, 24 Feb 2025 23:27:17 +0000 Subject: [PATCH 1/6] commit --- .gitpod.yml | 10 +++++++ CONTRIBUTING.md | 4 ++- README.md | 63 ++++++++++++++++++++++++++++++++++++++++++ nbs/index.ipynb | 73 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..6fba074 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,10 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) +# and commit this file to your remote git repository to share the goodness with others. + +# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart + +tasks: + - init: pip install . + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b23a5e..988c225 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,9 @@ pip install -e '.[dev]' And install quarto too: ``` -nbdev_install_quarto +sudo apt update +sudo apt install tmux -y + ``` Then, after you make subsequent changes to `nbs/index.ipynb`, run the following from the repo's root directory to (re)build `README.md`: diff --git a/README.md b/README.md index 3c9313e..1064011 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,69 @@ ssage --provider openai --model gpt-4o-mini "explain this error" ssage --history-lines 50 "what commands did I just run?" ``` +```` python +## Development Setup Documentation + +### Required Python Versions and Dependencies + +Ensure you have the following installed: + +- Python 3.9+ +- [pip](https://pip.pypa.io/en/stable/) +- [nbdev](https://nbdev.fast.ai/) (latest version) + +Install dependencies using: + +```sh +pip install nbdev +``` + +### nbdev Workflow Explanation + +1. **Initialize the Project** + ```sh + nbdev_new + ``` +2. **Edit Notebooks** + - Use Jupyter Notebook to write code and documentation. + ```sh + jupyter notebook + ``` +3. **Export Python Modules** + ```sh + nbdev_export + ``` +4. **Run Tests** + ```sh + nbdev_test + ``` +5. **Build Documentation** + ```sh + nbdev_build_docs + ``` +6. **Clean Notebooks** + ```sh + nbdev_clean + ``` + +### Common Development Tasks + +- **Adding New Features**: Modify `.ipynb` files and export them. +- **Testing Code**: Run `nbdev_test` before pushing changes. +- **Updating Documentation**: Modify notebooks and run `nbdev_build_docs`. +- **Publishing Package**: Use `nbdev_pypi` for PyPI releases. + +### Troubleshooting Guide + +- **nbdev_export not working**: Ensure you have installed nbdev and activated the virtual environment. +- **Import Errors**: Run `pip install -e .` to install the package locally. +- **Jupyter Not Recognizing Kernel**: Install `ipykernel` using: + ```sh + pip install ipykernel + python -m ipykernel install --user + ``` +```` + ### Advanced Use Cases #### Git Workflow Enhancement diff --git a/nbs/index.ipynb b/nbs/index.ipynb index 31802d8..6eeb878 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -203,6 +203,79 @@ "```" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "edc29a9e", + "metadata": { + "notebookRunGroups": { + "groupValue": "2" + } + }, + "outputs": [], + "source": [ + "## Development Setup Documentation\n", + "\n", + "### Required Python Versions and Dependencies\n", + "\n", + "Ensure you have the following installed:\n", + "\n", + "- Python 3.9+\n", + "- [pip](https://pip.pypa.io/en/stable/)\n", + "- [nbdev](https://nbdev.fast.ai/) (latest version)\n", + "\n", + "Install dependencies using:\n", + "\n", + "```sh\n", + "pip install nbdev\n", + "```\n", + "\n", + "### nbdev Workflow Explanation\n", + "\n", + "1. **Initialize the Project**\n", + " ```sh\n", + " nbdev_new\n", + " ```\n", + "2. **Edit Notebooks**\n", + " - Use Jupyter Notebook to write code and documentation.\n", + " ```sh\n", + " jupyter notebook\n", + " ```\n", + "3. **Export Python Modules**\n", + " ```sh\n", + " nbdev_export\n", + " ```\n", + "4. **Run Tests**\n", + " ```sh\n", + " nbdev_test\n", + " ```\n", + "5. **Build Documentation**\n", + " ```sh\n", + " nbdev_build_docs\n", + " ```\n", + "6. **Clean Notebooks**\n", + " ```sh\n", + " nbdev_clean\n", + " ```\n", + "\n", + "### Common Development Tasks\n", + "\n", + "- **Adding New Features**: Modify `.ipynb` files and export them.\n", + "- **Testing Code**: Run `nbdev_test` before pushing changes.\n", + "- **Updating Documentation**: Modify notebooks and run `nbdev_build_docs`.\n", + "- **Publishing Package**: Use `nbdev_pypi` for PyPI releases.\n", + "\n", + "### Troubleshooting Guide\n", + "\n", + "- **nbdev_export not working**: Ensure you have installed nbdev and activated the virtual environment.\n", + "- **Import Errors**: Run `pip install -e .` to install the package locally.\n", + "- **Jupyter Not Recognizing Kernel**: Install `ipykernel` using:\n", + " ```sh\n", + " pip install ipykernel\n", + " python -m ipykernel install --user\n", + " ```" + ] + }, { "cell_type": "markdown", "id": "47d6bfb8", From 437a5567ac39865ed4f713299a2c100e9f5a6563 Mon Sep 17 00:00:00 2001 From: Aditya Yadav Date: Mon, 24 Feb 2025 23:51:04 +0000 Subject: [PATCH 2/6] making a development guide for ths user --- README.md | 106 ++++++++++++++++++++++++------------------------ nbs/index.ipynb | 99 ++++++++++++++++++++++---------------------- 2 files changed, 105 insertions(+), 100 deletions(-) diff --git a/README.md b/README.md index 1064011..af9e81e 100644 --- a/README.md +++ b/README.md @@ -181,65 +181,67 @@ ssage --history-lines 50 "what commands did I just run?" ``` ```` python -## Development Setup Documentation +## Developer Setup Instruction -### Required Python Versions and Dependencies - -Ensure you have the following installed: +### Prerequisites - Python 3.9+ -- [pip](https://pip.pypa.io/en/stable/) -- [nbdev](https://nbdev.fast.ai/) (latest version) +- pip +- nbdev (latest version) +- Quarto (for documentation generation) + +### Installation + +1. Install the development dependencies: + +```bash +pip install -e '.[dev]' +nbdev_install_quarto +``` + +2. Set up the tmux environment for development: + +**Ubuntu/Debian** +```bash +sudo apt update +sudo apt install tmux -y +``` + -Install dependencies using: +3. Start tmux: +```bash +tmux +``` + +## nbdev Development Workflow + +### Common Commands + +#### Initialize Project +```bash +nbdev_install_quarto +``` -```sh -pip install nbdev +#### Update README from `index.ipynb` +```bash +nbdev_readme ``` -### nbdev Workflow Explanation - -1. **Initialize the Project** - ```sh - nbdev_new - ``` -2. **Edit Notebooks** - - Use Jupyter Notebook to write code and documentation. - ```sh - jupyter notebook - ``` -3. **Export Python Modules** - ```sh - nbdev_export - ``` -4. **Run Tests** - ```sh - nbdev_test - ``` -5. **Build Documentation** - ```sh - nbdev_build_docs - ``` -6. **Clean Notebooks** - ```sh - nbdev_clean - ``` - -### Common Development Tasks - -- **Adding New Features**: Modify `.ipynb` files and export them. -- **Testing Code**: Run `nbdev_test` before pushing changes. -- **Updating Documentation**: Modify notebooks and run `nbdev_build_docs`. -- **Publishing Package**: Use `nbdev_pypi` for PyPI releases. - -### Troubleshooting Guide - -- **nbdev_export not working**: Ensure you have installed nbdev and activated the virtual environment. -- **Import Errors**: Run `pip install -e .` to install the package locally. -- **Jupyter Not Recognizing Kernel**: Install `ipykernel` using: - ```sh - pip install ipykernel - python -m ipykernel install --user +#### Export Python Modules from Notebooks +```bash +nbdev_export +``` + +### Notebook-Specific Operations + +- **When modifying `index.ipynb`**, generate a new README: + ```bash + nbdev_readme + ``` + +- **To export all notebooks** to Python modules: + ```bash + nbdev_export ``` ```` diff --git a/nbs/index.ipynb b/nbs/index.ipynb index 6eeb878..c51b151 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -214,66 +214,69 @@ }, "outputs": [], "source": [ - "## Development Setup Documentation\n", + "## Developer Setup Instruction\n", "\n", - "### Required Python Versions and Dependencies\n", - "\n", - "Ensure you have the following installed:\n", + "### Prerequisites\n", "\n", "- Python 3.9+\n", - "- [pip](https://pip.pypa.io/en/stable/)\n", - "- [nbdev](https://nbdev.fast.ai/) (latest version)\n", + "- pip\n", + "- nbdev (latest version)\n", + "- Quarto (for documentation generation)\n", "\n", - "Install dependencies using:\n", + "### Installation\n", "\n", - "```sh\n", - "pip install nbdev\n", + "1. Install the development dependencies:\n", + "\n", + "```bash\n", + "pip install -e '.[dev]'\n", + "nbdev_install_quarto\n", "```\n", "\n", - "### nbdev Workflow Explanation\n", + "2. Set up the tmux environment for development:\n", "\n", - "1. **Initialize the Project**\n", - " ```sh\n", - " nbdev_new\n", - " ```\n", - "2. **Edit Notebooks**\n", - " - Use Jupyter Notebook to write code and documentation.\n", - " ```sh\n", - " jupyter notebook\n", - " ```\n", - "3. **Export Python Modules**\n", - " ```sh\n", - " nbdev_export\n", - " ```\n", - "4. **Run Tests**\n", - " ```sh\n", - " nbdev_test\n", - " ```\n", - "5. **Build Documentation**\n", - " ```sh\n", - " nbdev_build_docs\n", - " ```\n", - "6. **Clean Notebooks**\n", - " ```sh\n", - " nbdev_clean\n", - " ```\n", + "**Ubuntu/Debian**\n", + "```bash\n", + "sudo apt update\n", + "sudo apt install tmux -y\n", + "```\n", + "\n", + "\n", + "3. Start tmux:\n", + "```bash\n", + "tmux\n", + "```\n", + "\n", + "## nbdev Development Workflow\n", "\n", - "### Common Development Tasks\n", + "### Common Commands\n", + "\n", + "#### Initialize Project\n", + "```bash\n", + "nbdev_install_quarto\n", + "```\n", + "\n", + "#### Update README from `index.ipynb`\n", + "```bash\n", + "nbdev_readme\n", + "```\n", + "\n", + "#### Export Python Modules from Notebooks\n", + "```bash\n", + "nbdev_export\n", + "```\n", "\n", - "- **Adding New Features**: Modify `.ipynb` files and export them.\n", - "- **Testing Code**: Run `nbdev_test` before pushing changes.\n", - "- **Updating Documentation**: Modify notebooks and run `nbdev_build_docs`.\n", - "- **Publishing Package**: Use `nbdev_pypi` for PyPI releases.\n", + "### Notebook-Specific Operations\n", "\n", - "### Troubleshooting Guide\n", + "- **When modifying `index.ipynb`**, generate a new README:\n", + " ```bash\n", + " nbdev_readme\n", + " ```\n", "\n", - "- **nbdev_export not working**: Ensure you have installed nbdev and activated the virtual environment.\n", - "- **Import Errors**: Run `pip install -e .` to install the package locally.\n", - "- **Jupyter Not Recognizing Kernel**: Install `ipykernel` using:\n", - " ```sh\n", - " pip install ipykernel\n", - " python -m ipykernel install --user\n", - " ```" + "- **To export all notebooks** to Python modules:\n", + " ```bash\n", + " nbdev_export\n", + " ```\n", + "\n" ] }, { From 92a94402b03b76bfd10935e0e5318f2873974485 Mon Sep 17 00:00:00 2001 From: Aditya Yadav Date: Mon, 24 Feb 2025 23:52:47 +0000 Subject: [PATCH 3/6] checking out the readme.md file for the user --- README.md | 16 ++++++++-------- nbs/index.ipynb | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index af9e81e..f18952b 100644 --- a/README.md +++ b/README.md @@ -194,7 +194,7 @@ ssage --history-lines 50 "what commands did I just run?" 1. Install the development dependencies: -```bash +```sh pip install -e '.[dev]' nbdev_install_quarto ``` @@ -202,14 +202,14 @@ nbdev_install_quarto 2. Set up the tmux environment for development: **Ubuntu/Debian** -```bash +```sh sudo apt update sudo apt install tmux -y ``` 3. Start tmux: -```bash +```sh tmux ``` @@ -218,29 +218,29 @@ tmux ### Common Commands #### Initialize Project -```bash +```sh nbdev_install_quarto ``` #### Update README from `index.ipynb` -```bash +```sh nbdev_readme ``` #### Export Python Modules from Notebooks -```bash +```sh nbdev_export ``` ### Notebook-Specific Operations - **When modifying `index.ipynb`**, generate a new README: - ```bash + ```sh nbdev_readme ``` - **To export all notebooks** to Python modules: - ```bash + ```sh nbdev_export ``` ```` diff --git a/nbs/index.ipynb b/nbs/index.ipynb index c51b151..bdfe85b 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -227,7 +227,7 @@ "\n", "1. Install the development dependencies:\n", "\n", - "```bash\n", + "```sh\n", "pip install -e '.[dev]'\n", "nbdev_install_quarto\n", "```\n", @@ -235,14 +235,14 @@ "2. Set up the tmux environment for development:\n", "\n", "**Ubuntu/Debian**\n", - "```bash\n", + "```sh\n", "sudo apt update\n", "sudo apt install tmux -y\n", "```\n", "\n", "\n", "3. Start tmux:\n", - "```bash\n", + "```sh\n", "tmux\n", "```\n", "\n", @@ -251,29 +251,29 @@ "### Common Commands\n", "\n", "#### Initialize Project\n", - "```bash\n", + "```sh\n", "nbdev_install_quarto\n", "```\n", "\n", "#### Update README from `index.ipynb`\n", - "```bash\n", + "```sh\n", "nbdev_readme\n", "```\n", "\n", "#### Export Python Modules from Notebooks\n", - "```bash\n", + "```sh\n", "nbdev_export\n", "```\n", "\n", "### Notebook-Specific Operations\n", "\n", "- **When modifying `index.ipynb`**, generate a new README:\n", - " ```bash\n", + " ```sh\n", " nbdev_readme\n", " ```\n", "\n", "- **To export all notebooks** to Python modules:\n", - " ```bash\n", + " ```sh\n", " nbdev_export\n", " ```\n", "\n" From e76aa2547ff6dbe5974502b0d556f76894cb38e9 Mon Sep 17 00:00:00 2001 From: Aditya Yadav Date: Mon, 24 Feb 2025 23:59:50 +0000 Subject: [PATCH 4/6] again made changes in the index --- README.md | 8 ++++---- nbs/index.ipynb | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f18952b..30f999d 100644 --- a/README.md +++ b/README.md @@ -181,20 +181,21 @@ ssage --history-lines 50 "what commands did I just run?" ``` ```` python -## Developer Setup Instruction +# Developer Setup Guide -### Prerequisites +## Prerequisites - Python 3.9+ - pip - nbdev (latest version) - Quarto (for documentation generation) -### Installation +## Installation 1. Install the development dependencies: ```sh +# installing all dependencies pip install -e '.[dev]' nbdev_install_quarto ``` @@ -207,7 +208,6 @@ sudo apt update sudo apt install tmux -y ``` - 3. Start tmux: ```sh tmux diff --git a/nbs/index.ipynb b/nbs/index.ipynb index bdfe85b..a56adb5 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -214,20 +214,21 @@ }, "outputs": [], "source": [ - "## Developer Setup Instruction\n", + "# Developer Setup Guide\n", "\n", - "### Prerequisites\n", + "## Prerequisites\n", "\n", "- Python 3.9+\n", "- pip\n", "- nbdev (latest version)\n", "- Quarto (for documentation generation)\n", "\n", - "### Installation\n", + "## Installation\n", "\n", "1. Install the development dependencies:\n", "\n", "```sh\n", + "# installing all dependencies\n", "pip install -e '.[dev]'\n", "nbdev_install_quarto\n", "```\n", @@ -240,7 +241,6 @@ "sudo apt install tmux -y\n", "```\n", "\n", - "\n", "3. Start tmux:\n", "```sh\n", "tmux\n", @@ -275,8 +275,7 @@ "- **To export all notebooks** to Python modules:\n", " ```sh\n", " nbdev_export\n", - " ```\n", - "\n" + " ```" ] }, { From c119dc4e6735a710e79f46cb48a778f62a7c1fa6 Mon Sep 17 00:00:00 2001 From: Aditya Yadav Date: Tue, 25 Feb 2025 00:09:05 +0000 Subject: [PATCH 5/6] commit check by this --- README.md | 41 ++++++++++++++++++----------------------- nbs/index.ipynb | 22 +++++++++++----------- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 30f999d..a48f35d 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,6 @@ ssage --provider openai --model gpt-4o-mini "explain this error" ssage --history-lines 50 "what commands did I just run?" ``` -```` python # Developer Setup Guide ## Prerequisites @@ -192,58 +191,54 @@ ssage --history-lines 50 "what commands did I just run?" ## Installation -1. Install the development dependencies: +1. Install the development dependencies: -```sh +``` sh # installing all dependencies pip install -e '.[dev]' nbdev_install_quarto ``` -2. Set up the tmux environment for development: +2. Set up the tmux environment for development: **Ubuntu/Debian** -```sh + +``` sh sudo apt update sudo apt install tmux -y ``` -3. Start tmux: -```sh +3. Start tmux: + +``` sh tmux ``` ## nbdev Development Workflow -### Common Commands +### Initialize Project -#### Initialize Project -```sh +``` sh nbdev_install_quarto ``` -#### Update README from `index.ipynb` -```sh +### Update README from `index.ipynb` + +``` sh nbdev_readme ``` -#### Export Python Modules from Notebooks -```sh +### Export Python Modules from Notebooks + +``` sh nbdev_export ``` ### Notebook-Specific Operations -- **When modifying `index.ipynb`**, generate a new README: - ```sh - nbdev_readme - ``` +When modifying index.ipynb, generate a new README: `sh nbdev_readme` -- **To export all notebooks** to Python modules: - ```sh - nbdev_export - ``` -```` +To export all notebooks to Python modules: `sh nbdev_export` ### Advanced Use Cases diff --git a/nbs/index.ipynb b/nbs/index.ipynb index a56adb5..20c9c30 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -204,15 +204,13 @@ ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "id": "edc29a9e", "metadata": { "notebookRunGroups": { "groupValue": "2" } }, - "outputs": [], "source": [ "# Developer Setup Guide\n", "\n", @@ -248,31 +246,29 @@ "\n", "## nbdev Development Workflow\n", "\n", - "### Common Commands\n", - "\n", - "#### Initialize Project\n", + "### Initialize Project\n", "```sh\n", "nbdev_install_quarto\n", "```\n", "\n", - "#### Update README from `index.ipynb`\n", + "### Update README from `index.ipynb`\n", "```sh\n", "nbdev_readme\n", "```\n", "\n", - "#### Export Python Modules from Notebooks\n", + "### Export Python Modules from Notebooks\n", "```sh\n", "nbdev_export\n", "```\n", "\n", "### Notebook-Specific Operations\n", "\n", - "- **When modifying `index.ipynb`**, generate a new README:\n", + "When modifying index.ipynb, generate a new README:\n", " ```sh\n", " nbdev_readme\n", " ```\n", "\n", - "- **To export all notebooks** to Python modules:\n", + "To export all notebooks to Python modules:\n", " ```sh\n", " nbdev_export\n", " ```" @@ -391,9 +387,13 @@ ], "metadata": { "kernelspec": { - "display_name": "python3", + "display_name": "Python 3", "language": "python", "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.12.9" } }, "nbformat": 4, From 1bce2ea6f0c2ad7fe688b41058b0290b0660b232 Mon Sep 17 00:00:00 2001 From: Aditya Yadav Date: Tue, 25 Feb 2025 00:10:35 +0000 Subject: [PATCH 6/6] commit changed --- README.md | 6 ------ nbs/index.ipynb | 14 +------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/README.md b/README.md index a48f35d..18fe870 100644 --- a/README.md +++ b/README.md @@ -234,12 +234,6 @@ nbdev_readme nbdev_export ``` -### Notebook-Specific Operations - -When modifying index.ipynb, generate a new README: `sh nbdev_readme` - -To export all notebooks to Python modules: `sh nbdev_export` - ### Advanced Use Cases #### Git Workflow Enhancement diff --git a/nbs/index.ipynb b/nbs/index.ipynb index 20c9c30..39bc3a7 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -259,19 +259,7 @@ "### Export Python Modules from Notebooks\n", "```sh\n", "nbdev_export\n", - "```\n", - "\n", - "### Notebook-Specific Operations\n", - "\n", - "When modifying index.ipynb, generate a new README:\n", - " ```sh\n", - " nbdev_readme\n", - " ```\n", - "\n", - "To export all notebooks to Python modules:\n", - " ```sh\n", - " nbdev_export\n", - " ```" + "```\n" ] }, {