Skip to content

Commit

Permalink
Merge pull request #115 from TACC/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
wjallen authored Oct 30, 2024
2 parents f49e924 + f232f97 commit 62c0914
Show file tree
Hide file tree
Showing 105 changed files with 3,787 additions and 94,345 deletions.
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ help: ## Display this help screen
@grep -E '^([a-zA-Z_-]+):.*?## .*$$|^([a-zA-Z_-]+):' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {if ($$2) {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2} else {printf "\033[36m%-30s\033[0m %s\n", $$1, "(no description)"}}'

.PHONY: build
build: ## build dev
docker compose -f docker-compose.yml build

.PHONY: start
start: ## start dev environment where client code changes will be automatically updated on running client
start: ## start
docker compose -f docker-compose.yml up -d --build

.PHONY: stop
stop: ## stop dev
docker compose -f docker-compose.yml stop
stop: ## stop
docker compose -f docker-compose.yml down

.PHONY: start-dev
start-dev: ## start dev environment where frontend components are mounted in container
docker compose -f docker-compose-dev.yml up -d --build

.PHONY: stop-dev
stop-dev: ## stop dev environment
docker compose -f docker-compose-dev.yml down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# PandemicExerciseTool

## Requirements

* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* [Docker](https://www.docker.com/products/docker-desktop/)


## Getting Started

#### Build the production environment

#### Clone the repository

```bash
make build
git clone https://github.com/TACC/PandemicExerciseTool
```

#### Start the production environment
Expand Down
2 changes: 1 addition & 1 deletion backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['*']


# Application definition
Expand Down
Binary file modified backend/db.sqlite3
Binary file not shown.
10 changes: 5 additions & 5 deletions backend/pet/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.0.3 on 2024-08-30 05:51
# Generated by Django 5.0.9 on 2024-10-22 18:41

from django.db import migrations, models

Expand All @@ -15,21 +15,21 @@ class Migration(migrations.Migration):
name='PET',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('disease_name', models.CharField(max_length=100)),
('disease_name', models.TextField()),
('R0', models.FloatField()),
('beta_scale', models.FloatField()),
('tau', models.FloatField()),
('kappa', models.FloatField()),
('gamma', models.FloatField()),
('chi', models.FloatField()),
('rho', models.FloatField()),
('nu', models.CharField(choices=[('high', 'high'), ('low', 'low')], max_length=4)),
('nu', models.TextField()),
('initial_infected', models.TextField(null=True)),
('phas', models.TextField(null=True)),
('npis', models.TextField(null=True)),
('antiviral_effectiveness', models.FloatField(null=True)),
('antiviral_wastage_factor', models.FloatField(null=True)),
('antiviral_stockpile', models.TextField(null=True)),
('vaccine_wastage_factor', models.FloatField(blank=True, default=None, null=True)),
('vaccine_wastage_factor', models.FloatField(null=True)),
('vaccine_pro_rata', models.CharField(choices=[('children', 'children'), ('pro_rata', 'pro_rata')], max_length=8, null=True)),
('vaccine_adherence', models.TextField(null=True)),
('vaccine_effectiveness', models.TextField(null=True)),
Expand Down
18 changes: 0 additions & 18 deletions backend/pet/migrations/0002_alter_pet_vaccine_wastage_factor.py

This file was deleted.

18 changes: 0 additions & 18 deletions backend/pet/migrations/0003_alter_pet_nu.py

This file was deleted.

18 changes: 0 additions & 18 deletions backend/pet/migrations/0004_rename_phas_pet_npis.py

This file was deleted.

133 changes: 1 addition & 132 deletions backend/pet/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class PET(models.Model):

disease_name = models.CharField(max_length=100)
disease_name = models.TextField()
R0 = models.FloatField()
beta_scale = models.FloatField()
tau = models.FloatField()
Expand All @@ -29,134 +29,3 @@ class PET(models.Model):
def __str__(self):
return(f'{self.disease_name}, R0={self.R0}, nu={self.nu}')




#{
# "output": "OUTPUT.json",
# "number_of_realizations": "1",
# "data": {
# "population": "data/texas/county_age_matrix_small.csv",
# "contact": "data/texas/contact_matrix.csv",
# "flow": "data/texas/work_matrix_rel.csv",
# "high_risk_ratios": "data/texas/high_risk_ratios.csv",
# "flow_reduction": "data/texas/flow_reduction.csv",
# "relative_susceptibility": "data/texas/relative_susceptibility.csv",
# "nu_value_matrix": "data/texas/nu_value_matrix.csv"
# },
# "parameters": {
# "R0": "1.2",
# "beta_scale": "10",
# "tau": "1.2",
# "kappa": "1.9",
# "gamma": "4.1",
# "chi": "1.0",
# "rho": "0.39",
# "nu": "high"
# },
# "initial_infected": [
# {
# "county": "453",
# "infected": "100",
# "age_group": "1"
# },
# {
# "county": "113",
# "infected": "100",
# "age_group": "1"
# },
# {
# "county": "201",
# "infected": "100",
# "age_group": "1"
# },
# {
# "county": "141",
# "infected": "100",
# "age_group": "1"
# },
# {
# "county": "375",
# "infected": "100",
# "age_group": "1"
# }
# ],
# "non_pharma_interventions": [
# {
# "day": "50",
# "effectiveness": "0.4",
# "halflife": "10.0"
# },
# {
# "day": "200",
# "effectiveness": "0.6",
# "halflife": "50.0"
# }
# ],
# "antivirals": {
# "antiviral_effectiveness": "1.5",
# "antiviral_wastage_factor": "60",
# "antiviral_stockpile": [
# {
# "day": "103",
# "amount": "17830"
# },
# {
# "day": "110",
# "amount": "65310"
# },
# {
# "day": "117",
# "amount": "33900"
# },
# {
# "day": "124",
# "amount": "92230"
# },
# {
# "day": "131",
# "amount": "48340"
# }
# ]
# },
# "vaccines": {
# "vaccine_wastage_factor": "60",
# "vaccine_pro_rata": "children",
# "vaccine_adherence": [
# "0.4345",
# "0.298",
# "0.388",
# "0.450",
# "0.696"
# ],
# "vaccine_effectiveness": [
# "0.8",
# "0.8",
# "0.8",
# "0.8",
# "0.8"
# ],
# "vaccine_stockpile": [
# {
# "day": "203",
# "amount": "178300"
# },
# {
# "day": "210",
# "amount": "653100"
# },
# {
# "day": "217",
# "amount": "339000"
# },
# {
# "day": "224",
# "amount": "922300"
# },
# {
# "day": "231",
# "amount": "483400"
# }
# ]
# }
#}
3 changes: 0 additions & 3 deletions backend/pet/tests.py

This file was deleted.

11 changes: 11 additions & 0 deletions backend/pet/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
import requests
import pymongo

import logging


logger = logging.getLogger(__name__)

myclient = pymongo.MongoClient("mongodb://mongo-db:27017/")
mydb = myclient["PES"]
mycol = mydb["days"]
Expand All @@ -34,6 +39,12 @@ def delete_job(request, task_id):
def get_output(request, day):
if request.method == 'GET':
mydoc = mycol.find_one({'day': int(day)})
if mydoc is None:
logger.warning(f"Day {day} not calculated")
return JsonResponse(
{"error": f"Day {day} not calculated"},
status=404
)
del mydoc['_id']
return JsonResponse(mydoc, status=200)

Expand Down
4 changes: 2 additions & 2 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
amqp==5.2.0
Django==5.0.3
Django==5.0.9
django-cors-headers==4.3.1
djangorestframework==3.15.1
djangorestframework==3.15.2
requests==2.32.3
celery==5.4.0
pymongo==4.8.0
Loading

0 comments on commit 62c0914

Please sign in to comment.