forked from enviPath/enviPy
**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>
135 lines
3.5 KiB
YAML
135 lines
3.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- develop
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
if: ${{ !contains(gitea.event.pull_request.title, 'WIP') }}
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16
|
|
env:
|
|
POSTGRES_USER: ${{ vars.POSTGRES_USER }}
|
|
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|
|
POSTGRES_DB: ${{ vars.POSTGRES_DB }}
|
|
ports:
|
|
- ${{ vars.POSTGRES_PORT}}:5432
|
|
options: >-
|
|
--health-cmd="pg_isready -U postgres"
|
|
--health-interval=10s
|
|
--health-timeout=5s
|
|
--health-retries=5
|
|
|
|
#redis:
|
|
# image: redis:7
|
|
# ports:
|
|
# - 6379:6379
|
|
# options: >-
|
|
# --health-cmd "redis-cli ping"
|
|
# --health-interval=10s
|
|
# --health-timeout=5s
|
|
# --health-retries=5
|
|
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
EP_DATA_DIR: /opt/enviPy/
|
|
ALLOWED_HOSTS: 127.0.0.1,localhost
|
|
DEBUG: True
|
|
LOG_LEVEL: INFO
|
|
MODEL_BUILDING_ENABLED: True
|
|
APPLICABILITY_DOMAIN_ENABLED: True
|
|
ENVIFORMER_PRESENT: True
|
|
ENVIFORMER_DEVICE: cpu
|
|
FLAG_CELERY_PRESENT: False
|
|
PLUGINS_ENABLED: True
|
|
SERVER_URL: http://localhost:8000
|
|
ADMIN_APPROVAL_REQUIRED: True
|
|
REGISTRATION_MANDATORY: True
|
|
LOG_DIR: ''
|
|
# DB
|
|
POSTGRES_SERVICE_NAME: postgres
|
|
POSTGRES_DB: ${{ vars.POSTGRES_DB }}
|
|
POSTGRES_USER: ${{ vars.POSTGRES_USER }}
|
|
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|
|
POSTGRES_PORT: 5432
|
|
# SENTRY
|
|
SENTRY_ENABLED: False
|
|
# MS ENTRA
|
|
MS_ENTRA_ENABLED: False
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install system tools via apt
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y postgresql-client redis-tools openjdk-11-jre-headless
|
|
|
|
- name: Setup ssh
|
|
run: |
|
|
echo "${{ secrets.ENVIPY_CI_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
ssh-keyscan git.envipath.com >> ~/.ssh/known_hosts
|
|
eval $(ssh-agent -s)
|
|
ssh-add ~/.ssh/id_ed25519
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: "pnpm"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Setup venv
|
|
run: |
|
|
uv sync --locked --all-extras --dev
|
|
source .venv/bin/activate
|
|
playwright install --with-deps
|
|
|
|
- name: Run PNPM Commands
|
|
run: |
|
|
uv run python scripts/pnpm_wrapper.py install
|
|
cat << 'EOF' > pnpm-workspace.yaml
|
|
onlyBuiltDependencies:
|
|
- '@parcel/watcher'
|
|
- '@tailwindcss/oxide'
|
|
EOF
|
|
uv run python scripts/pnpm_wrapper.py run build
|
|
|
|
- name: Wait for services
|
|
run: |
|
|
until pg_isready -h postgres -U postgres; do sleep 2; done
|
|
# until redis-cli -h redis ping; do sleep 2; done
|
|
|
|
- name: Run Django Migrations
|
|
run: |
|
|
source .venv/bin/activate
|
|
python manage.py migrate --noinput
|
|
|
|
- name: Run frontend tests
|
|
run: |
|
|
source .venv/bin/activate
|
|
python manage.py test --tag frontend
|
|
|
|
- name: Run Django tests
|
|
run: |
|
|
source .venv/bin/activate
|
|
python manage.py test tests --exclude-tag slow --exclude-tag frontend
|