Earn 20,070 ($200.70)
Fix/Create A VSCode Extension for navigating to/from Jupyter Notebooks
Bounty Description
Problem Description
I am working on an open source project called nbdev https://nbdev.fast.ai/ that allows you to create python packages and documentation from a single source of truth - Jupyter Notebooks. You write your code in Jupyter Notebooks, and the notebooks are then compiled to source code. The way you instruct nbdev to export a particular code cell to a python module is as follows:
At the beginning of a notebook, you will have a cell with a special comment that looks like this #| default_exp core
In this case, this means that by default, any code you mark to be exported will go into core.py
Code cells in notebooks are marked to be exported with the special comment #|export
In the corresponding source code, a special comment is placed in the python module that indicates which notebook and cell the code came from, like this:
# %% ../nbs/00_core.ipynb 3def get_id(owner,repo,pull_number):"Get the node id of the PR"api = GhApi(owner, repo)pr = api.pulls.get(pull_number)return pr.node_id
Finally, every nbdev project has a settings.ini
at the root of the project which indicates the directory the notebooks and the python library are located in. The relevant configuration variables are as follows:
### nbdev ###lib_path = lewinbnbs_path = nbs
In this case, this means the python module will be located in ./lewinb
and the notebooks are stored in ./nbs
.
The goal is to create a vscode extension to help you navigate between code in the notebooks and python modules. I have already made significant progress towards this but got stuck.
I explain more in this 5 minute video - please watch this video as it is much easier to understand the problem this way.
Acceptance Criteria
- Have to be able to navigate to the specific cell in a notebook from a python module, not just the notebook
- Implement the ability to go in the reverse direction: notebook -> source file
- Add at least one simple test
Links
-
Video explaining the problem: https://www.loom.com/share/96757265bf8340a0a5e411bc86a7f90c
-
Repo with the progress I've made on the extension so far: https://github.com/fastai/nbdev-vscode/tree/main
-
An example nbdev project you can use for testing: https://github.com/hamelsmu/lewinb/tree/main
-
A more comlex nbdev project you can use to really understand if things are working: https://github.com/fastai/fastcore