-
Install PyEnv to manage python installations.
- For Mac users:
brew install pyenv - For Linux users:
curl https://pyenv.run | bash
- For Mac users:
-
Add the following lines to your
~/.bash_profileexport PATH="~/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)"
-
Open a new terminal window or
source ~/.bash_profile -
Install the latest version of Python using
pyenv install 3.9.6 -
Check if your system python is the same
python --version -
Install poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python source ~/.poetry/env
-
Set your virtual env to be within your project
poetry config virtualenvs.in-project true
poetry install
poetry run mainRuns are configured using the configs in configs/config.yaml. Every run automatically creates an output/ subdirectory within your experiment directory with a time stamp for all the artefacts (files, logs, configs).
Create a new experiment by creating a new subfolder e.g. exp_ABC in the experiments folder.
└── exp_ABC
├── __init__.py
├── experiment.py
├── notebooks
│ ├── notebook_A.ipynb
│ └── notebook_B.ipynb
└── output
├── 2021-07-23_11-43-53
└── 2021-07-23_11-46-02
You can tell which experiment to run by setting the name in the experiment section of the config.
The application finds the experiment using the name of the subdirectory that matches the experiment name and finds a run() method in it.
All config params can be accessed via the dot notation cfg.param1.subparam2
poetry run pytestwith coverage poetry run pytest --cov.
To launch a Jupyter Notebook from your poetry environment use poetry shell (similar to pipenv shell), then launch jupyter notebook.
poetry shell
jupyter-notebook
To create environment
poetry config virtualenvs.in-project true
poetry installTo add dependencies
poetry add <name-of-dependency>e.g.
poetry add pandasor
poetry update click
poetry add click^7.0
To remove packages
poetry remove pandas