From a4619c59d9d7f71dd6679b7e40ed86987d6e491a Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Thu, 6 Aug 2020 12:16:50 +0530 Subject: added chem drawer --- app/forms.py | 5 +++-- app/templates/generate.html | 23 +++++++++++++++++++++-- app/templates/home.html | 1 + app/views.py | 1 + 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/forms.py b/app/forms.py index 3a06f27..44dadfc 100644 --- a/app/forms.py +++ b/app/forms.py @@ -1,6 +1,6 @@ from flask_wtf import FlaskForm from flask_wtf.file import FileField, FileRequired, FileAllowed -from wtforms import StringField, DecimalField, IntegerField +from wtforms import StringField, DecimalField, IntegerField, SelectField from wtforms.validators import DataRequired, Email @@ -35,4 +35,5 @@ class statusForm(FlaskForm): jobID = StringField('Job ID',validators=[DataRequired()]) class generateSMILES(FlaskForm): - n = IntegerField('Number of Molecules to Generate',default=1,validators=[DataRequired()]) \ No newline at end of file + n = IntegerField('Number of Molecules to Generate',default=1,validators=[DataRequired()]) + #modelSelection = SelectField('Model',choices=[("alpha","Alpha"),("beta","Beta")]) \ No newline at end of file diff --git a/app/templates/generate.html b/app/templates/generate.html index f187046..c034bd3 100644 --- a/app/templates/generate.html +++ b/app/templates/generate.html @@ -10,6 +10,10 @@ {{ form.n.label }} {{ form.n(class="form-control")}} +
@@ -17,8 +21,23 @@ {% if result %} - what the frick - {{result}} + Generated Compounds + + + {% for x in range(result|length) %} + +

{{result[x]}}

+ + + {% endfor %} {% endif %} {% endblock %} \ No newline at end of file diff --git a/app/templates/home.html b/app/templates/home.html index efe1a36..541c313 100644 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -6,6 +6,7 @@ diff --git a/app/views.py b/app/views.py index 976bd5e..7c005c7 100644 --- a/app/views.py +++ b/app/views.py @@ -142,6 +142,7 @@ def generate(): if request.method == 'POST' and form.validate_on_submit(): result = gen.sample(form.n.data) + print(tfWorking) if tfWorking == 0: flash("Failed to initialise the model!","danger") else: -- cgit v1.2.3