Skip to content
    Back to all Bounties

    Earn 20,070 ($200.70)

    Time Remainingdue 2 years ago
    Completed

    Fix/Create A VSCode Extension for navigating to/from Jupyter Notebooks

    hamelsmu
    hamelsmu
    Posted 2 years ago
    This Bounty has been completed!
    @hamelsmu's review of @pjausovec
    5.0
    Average Rating
    Communication 5/5, Quality 5/5, Timeliness 5/5
    Peter is great, he went above and beyond and implemented additional functionality. He even got on zoom with me for an hour to teach me some things. It is clear that Peter loves to program and is doing this for fun, which is the best kind of programmer. When he first messaged me, he sent me a PR fixing the problem. It is an absolute delight to work with him. Well deserved.

    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 3
    def 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 = lewinb
    nbs_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

    1. Video explaining the problem: https://www.loom.com/share/96757265bf8340a0a5e411bc86a7f90c

    2. Repo with the progress I've made on the extension so far: https://github.com/fastai/nbdev-vscode/tree/main

    3. An example nbdev project you can use for testing: https://github.com/hamelsmu/lewinb/tree/main

    4. A more comlex nbdev project you can use to really understand if things are working: https://github.com/fastai/fastcore