joyceerhl / vscode-pyolite

Run Python code in Jupyter notebooks on github.dev and vscode.dev/github
https://marketplace.visualstudio.com/items?itemName=joyceerhl.vscode-pyodide
77 stars 16 forks source link

Paths are relative to the root of the repository - any way to change this? #5

Open koldLight opened 3 years ago

koldLight commented 3 years ago

Hi, I've just discovered this cool extension thanks to @dynamicwebpaige tweet https://twitter.com/DynamicWebPaige/status/1425502379777019909

I have a public python course developed with jupyter notebooks. I was interested in make it working via github.dev and tried it with the pyolite extension.

It works amazingly well, except for the paths.

E.g. in https://github.dev/koldLight/curso-python-analisis-datos/blob/master/notebooks/02_pandas.ipynb if I try to run the first cell:

import pandas as pd

alquiler = pd.read_csv('dat/alquiler-madrid-distritos.csv', index_col=False)
alquiler.head()

It fails. It seems it's taking as base path the root of the git repository (although in a jupyter notebook, the base path is its location). If I change the path to notebooks/dat/alquiler-madrid-distritos.csv it starts working.

So, my question is... is there any way to set the base path for the extension to run? Or to be always relative to the opened notebook?

Thanks!