absolute_import
absolute_import (name, fname, level)
Unwarps a relative import in name
according to fname
The library is primarily developed in notebooks so any big changes should be made there. But sometimes, it’s easier to fix small bugs or typos in the modules directly. nbprocess_update_lib
is the function that will propagate those changes back to the corresponding notebooks. Note that you can’t create new cells or reorder cells with that functionality, so your corrections should remain limited.
absolute_import (name, fname, level)
Unwarps a relative import in name
according to fname
test_eq(absolute_import('xyz', 'nbprocess', 0), 'xyz')
test_eq(absolute_import('', 'nbprocess', 1), 'nbprocess')
test_eq(absolute_import('core', 'nbprocess', 1), 'nbprocess.core')
test_eq(absolute_import('core', 'nbprocess/vision', 2), 'nbprocess.core')
test_eq(absolute_import('transform', 'nbprocess/vision', 1), 'nbprocess.vision.transform')
test_eq(absolute_import('notebook.core', 'nbprocess/data', 2), 'nbprocess.notebook.core')
nbprocess_update (fname:str)
Propagates any change in the modules matching fname
to the notebooks that created them
Type | Details | |
---|---|---|
fname | str | A python file name to convert |