Ejemplo n.º 1
0
def main():
    db_client = mongo.connect_to_mongo(db_name='evo_v2',
                                       drop_db=True,
                                       localhost=False)
    try:
        ModelInterface.drop_from_cloud(object_id='5d2183b7eb5d66251fb1896f')
    finally:
        db_client.close()
Ejemplo n.º 2
0
def main():
    db_client = mongo.connect_to_mongo()
    try:
        while True:
            pick_one_experiment_and_fine_tune()
            time.sleep(10)
    finally:
        db_client.close()
Ejemplo n.º 3
0
def main():
    try:
        db_client = mongo.connect_to_mongo()
        while not Path('stop').is_file():
            pick_one_experiment_and_run()
            time.sleep(10)
        os.remove('stop')
        l.info("Found stop file and has stopped processing queue")
    finally:
        db_client.close()
Ejemplo n.º 4
0
def main():
    db_client = mongo.connect_to_mongo(db_name='tests', drop_db=True, localhost=False)
    try:
        opt_conf_id = create_test_optimization_config()
        # conf_id = create_test_configuration()
        exp_id  = create_test_experiment(opt_conf_id)
        pick_one_experiment_and_run()
        model_object_id, model_id = train_test_model(exp_id)
        model = load_test_model_by_object_id(model_object_id)
        model = load_test_model_by_id(model_id)
        # assert False
        delete_test_model(model_object_id)
    finally:
        db_client.close()
Ejemplo n.º 5
0
def connect_to_db():
    print('Open connection')
    g.db_client = mongo.connect_to_mongo(db_name='evo_v2')
Ejemplo n.º 6
0
def before_request():
    print('Open connection')
    g.db_client = mongo.connect_to_mongo()
Ejemplo n.º 7
0
os.chdir('..')
import time
import sys
sys.path.append('.')

from flask import Flask, request, g

from py.inference import InferencePack
from py.logger import l
import py.mongo as mongo
os.chdir('./py')

sec_codes = ['GZ', 'RI', 'SR', 'GD']
time_code = 'U9'

db_client = mongo.connect_to_mongo()
inf_packs = {}
for sec_code in sec_codes:
    inf_packs[sec_code + time_code] = InferencePack(sec_code + time_code)
db_client.close()

app = Flask(__name__)


@app.before_request
def before_request():
    print('Open connection')
    g.db_client = mongo.connect_to_mongo()


@app.teardown_appcontext
Ejemplo n.º 8
0
import os

os.chdir('..')
import time
import sys

sys.path.append('.')
from mongoengine.connection import disconnect
from importlib import reload
import py.classes as classes

reload(classes)
import py.mongo as mongo

reload(mongo)
db = mongo.connect_to_mongo(db_name='evo_v2')
import py.models as models

reload(models)
import py.dataset as dataset

reload(dataset)
import py.inference as inference

reload(inference)

import pprint
import json
import logging