**This pull request will need a separate migration pull-request**
I have added an alert box in two places when the user tries to predict with stereo chemistry.
When a user predicts a pathway with stereo chemistry an alert box is shown in that node's hover.
To do this I added two new fields. Pathway now has a "predicted" BooleanField indicating whether it was predicted or not. It is set to True if the pathway mode for prediction is "predict" or "incremental" and False if it is "build". I think it is a flag that could be useful in the future, perhaps for analysing how many predicted pathways are in enviPath?
Node now has a `stereo_removed` BooleanField which is set to True if the Node's parent Pathways has "predicted" as true and the node SMILES has stereochemistry.
<img width="500" alt="{927AC9FF-DBC9-4A19-9E6E-0EDD3B08C7AC}.png" src="attachments/69ea29bc-c2d2-4cd2-8e98-aae5c5737f69">
When a user does a prediction on a model's page it shows at the top of the list. This did not require any new fields as the entered SMILES does not get saved anywhere.
<img width="500" alt="{BED66F12-5F07-419E-AAA6-FE1FE5B4F266}.png" src="attachments/5fcc3a9b-4d1a-4e48-acac-76b7571f6507">
I think the alert box is an alright solution but if you have a great idea for something that looks/fits better please change it or let me know.
Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#250
Co-authored-by: Liam Brydon <lbry121@aucklanduni.ac.nz>
Co-committed-by: Liam Brydon <lbry121@aucklanduni.ac.nz>
enviPy
Local Development Setup
These instructions will guide you through setting up the project for local development.
Prerequisites
- Python 3.11 or later
- uv - Python package manager
- Docker and Docker Compose - Required for running PostgreSQL database
- Git
- Make
Note: This application requires PostgreSQL (uses
ArrayField). Docker is the easiest way to run PostgreSQL locally.
1. Install Dependencies
This project uses uv to manage dependencies and poe-the-poet for task running. First, install uv if you don't have it yet.
Then, sync the project dependencies. This will create a virtual environment in .venv and install all necessary packages, including poe-the-poet.
uv sync --dev
Note on RDkit installation: if you have rdkit installed on your system globally with a different version of python, the installation will try to link against that and subsequent calls fail. Only option remove global rdkit and rerun sync.
The frontend requires pnpm to correctly display in development.
Install it here.
2. Set Up Environment File
Copy the example environment file for local setup:
cp .env.local.example .env
This file contains the necessary environment variables for local development.
3. Quick Setup with Poe
The easiest way to set up the development environment is by using the poe task runner, which is executed via uv run.
uv run poe setup
This single command will:
- Start the PostgreSQL database using Docker Compose.
- Run database migrations.
- Bootstrap initial data (anonymous user, default packages, models).
After setup, start the development server:
uv run poe dev
This will start the css-watcher as well as the django-development server,
The application will be available at http://localhost:8000.
Note: The development server automatically starts a CSS watcher (pnpm run dev) alongside the Django server to rebuild CSS files when changes are detected. This ensures your styles are always up-to-date during development.
Other useful Poe commands
You can list all available commands by running uv run poe --help.
uv run poe db-up # Start PostgreSQL only
uv run poe db-down # Stop PostgreSQL
uv run poe migrate # Run migrations only
uv run poe bootstrap # Bootstrap data only
uv run poe shell # Open the Django shell
uv run poe build # Build frontend assets and collect static files
uv run poe clean # Remove database volumes (WARNING: destroys all data)
Troubleshooting
-
Docker Connection Error: If you see an error like
open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified(on Windows), it likely means your Docker Desktop application is not running. Please start Docker Desktop and try the command again. -
SSH Keys for Git Dependencies: Some dependencies are installed from private git repositories and require SSH authentication. Ensure your SSH keys are configured correctly for Git.
-
For a general guide, see GitHub's official documentation.
-
Windows Users: If
uv synchangs while fetching git dependencies, you may need to explicitly configure Git to use the Windows OpenSSH client and use thessh-agentto manage your key's passphrase.- Point Git to the correct SSH executable:
git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe" - Enable and use the SSH agent:
# Run these commands in an administrator PowerShell Get-Service ssh-agent | Set-Service -StartupType Automatic -PassThru | Start-Service # Add your key to the agent. It will prompt for the passphrase once. ssh-add
- Point Git to the correct SSH executable:
-