I want to make my Azure Notebook production ready but I am having issues with the relative path in the folders.
When executing the code to be run in the main, the relative path to files becomes the one from the main as opposed to the file where the code should be run.
How can I make the relative path to a file, relative to the file of the code as opposed to be relative to the main?
Example:
root/main.ipynb
code: %run file01/code01.ipynb
root/file01/code01.ipynb
code: %run ../param/parameters.ipynb
root/param/parameters.ipynb
code: whateverCode
In this example, when running the code directly from code01.ipynb
it works.
When running the code from main.ipynb
it says it can't find the parameters.ipynb
because the path should have been %run param/parameters.ipynb
(relative to the main).
Any ways to deal with this?