I typically have several Juypterlab launchers each with different starting directories (local, networkshare 1,2,3…) as I store RAW data and associated post-processing in relevant directory structures.
I typically keep a processingLib in this root directory and it usually contains specific parsing functions, as a group of tests may have a different acquisition setup (scope channels, power analyser…), while larger re-use calls are added as a git submodule.
> <root> ProcessingLib └─HelperLib └─TestSuite_1 └─ some_file.ipynb └─TestSuite_2 └─ another_file.ipynb └─ another_file_PRESENTATION.ipynb └─TestSuite_3 └─ looksee_file.ipynb └─TestSuite_3_1 └─ additional_file.ipynb
For the above example structure I would group suites of tests in their own directories and have one or many notebooks to process and document the postprocessing. At the start of each notebook, after a heading markdown I would typically add a “houskeeping imports” codeblock
#housekeeping imports import IPython import numpy as np import pandas as pd import sympy as sym import seaborn as sns import scipy.signal as signal from scipy.optimize import curve_fit from IPython.display import display,HTML,Markdown from dataclasses import dataclass import sys sys.path.insert(0,'..') from ProcessingLib import some_module
This obviously works for TestSuite_1,TestSuite_2 and TestSuite_3 but would fail for TestSuite_3_1 directory and I would need to change the sys.path.insert to: sys.path.insert(0,’… /…’) ( note discourse has changed two dots to three in main body text…)
Is there some ENV that juypyterlab sets which is the absolute path of that I can instead use for some import to provide a consistent housekeeping import block and minimize worrying about the depth of the directory structure being used