pain-painter/
├── src/ # Main source code
├── notebooks/ # Jupyter notebooks
├── doc/ # Documentation
├── scripts/ # Utility scripts
└── preprocess/ # Data preprocessing code
To enable importing from the src directory anywhere in the project:
pip install -e .
After installation, you can import modules from src directly in any file, for example:
from src.data import data
from src.model import your_model
To enable imports in Jupyter notebooks, add this code at the start of your notebook:
import sys
import os
# Add project root to Python path
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if project_root not in sys.path:
sys.path.append(project_root)
A config file with this code has been added at notebooks/jupyter_notebook_config.py. You can either:
import jupyter_notebook_config
Alternatively, you can use the .env file approach which sets PYTHONPATH. The .env file is already configured, just make sure to load it in your environment.
3 commits
Jupyter Notebook
87.3%
Python
12.7%
pain-painter/
├── src/ # Main source code
├── notebooks/ # Jupyter notebooks
├── doc/ # Documentation
├── scripts/ # Utility scripts
└── preprocess/ # Data preprocessing code
To enable importing from the src directory anywhere in the project:
pip install -e .
After installation, you can import modules from src directly in any file, for example:
from src.data import data
from src.model import your_model
To enable imports in Jupyter notebooks, add this code at the start of your notebook:
import sys
import os
# Add project root to Python path
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if project_root not in sys.path:
sys.path.append(project_root)
A config file with this code has been added at notebooks/jupyter_notebook_config.py. You can either:
import jupyter_notebook_config
Alternatively, you can use the .env file approach which sets PYTHONPATH. The .env file is already configured, just make sure to load it in your environment.
3 commits
Jupyter Notebook
87.3%
Python
12.7%