Module trase.tools.sei_pcs.reload

Auto-reloading of Python code. Hopefully one day we can delete this in favour of IPython's autoreload.

Functions

def construct_module_name_from_filesystem_path(path_within_codebase: str) ‑> str

Example

```python-repl
>>> path = "/path/to/codebase/Brazil/Palm_Oil/model.py"
>>> construct_module_name_from_filesystem_path(path)
"Brazil.Palm_Oil.model"

```

def reload_module_at_path(path_within_codebase: str) ‑> module

Imports the target Python script as a module. The directory constants.CODEBASE_ROOT must be one of the parent directories of the path. Once imported, the module is also reloaded.