-
Notifications
You must be signed in to change notification settings - Fork 1
Description
In Jupyter notebooks, for example in this notebook, replace the import from a path with a Python package installed via pip for better maintainability and development.
Steps to Implement:
- Create a Python package
red-sea-monitoring(already created). - Install the Python package via pip.
- Replace the import from path with the Python package import in the code.
For example
In the repository directory, install the package in editable mode with dependencies:
pip install -e .and, in the notebook,
from red_sea_monitoring.utils import *When you install a package, it manages dependencies for you. This ensures that the required dependencies are correctly installed and compatible with the package you are installing. Installing a package makes your code more portable. You can share your code with others, and they can easily install the required packages using a package manager. For end-users or colleagues who are not familiar with the project, installing a package is simpler than manually managing paths.
The package can be installed/distributed in a standard way:
pip install git+https://github.com/datapartnership/red-sea-monitoring.git>>> import red_sea_monitoring
>>> red_sea_monitoring.__version__
'0.1.dev56+gba2d2ff'