Exemplo n.º 1
0
 def isLoaded(self):
     self.project_id = db_tables.checkProject(self.session, self.project)
     if self.project_id is None:
         return False
     self.dataset_id = db_tables.checkDataset(self.session, self.project_id,
                                              self.dataset)
     if self.dataset_id is None:
         return False
     return True
Exemplo n.º 2
0
 def createProjectDataset(self):
     self.project_id = db_tables.checkProject(self.session, self.project)
     if self.project_id is None:
         self.project_id = db_tables.addProject(self.session, self.project)
     self.dataset_id = db_tables.checkDataset(self.session, self.project_id,
                                              self.dataset)
     if self.dataset_id is None:
         self.dataset_id = db_tables.addDataset(self.session,
                                                self.project_id,
                                                self.dataset)
Exemplo n.º 3
0
def getExperiments(session, project, dataset, exp_kind=None):
    project_id = db_tables.checkProject(session, project)
    dataset_id = db_tables.checkDataset(session, project_id, dataset)
    query = session.query(ExperimentsAlchemy)
    query = query.filter(ExperimentsAlchemy.dataset_id == dataset_id)
    if exp_kind is not None:
        query = query.filter(ExperimentsAlchemy.kind == exp_kind)
    query = query.filter(ExperimentsAlchemy.parent == None)
    experiments = {}
    for exp in query.all():
        if exp.name not in experiments.keys():
            experiments[exp.name] = []
        experiments[exp.name].append(exp.id)
    return experiments
Exemplo n.º 4
0
def getAllExperiments(session, project, dataset, exp_kind=None):
    project_id = db_tables.checkProject(session, project)
    dataset_id = db_tables.checkDataset(session, project_id, dataset)
    all_kinds = getExperimentKinds(session, dataset_id)
    experiments = {}
    for kind in all_kinds:
        experiments[kind] = []
        query = session.query(ExperimentsAlchemy)
        query = query.filter(ExperimentsAlchemy.dataset_id == dataset_id)
        query = query.filter(ExperimentsAlchemy.kind == kind)
        query = query.filter(ExperimentsAlchemy.parent == None)
        for exp in query.all():
            e = {'name': exp.name, 'id': exp.id}
            experiments[kind].append(e)
        if len(experiments[kind]) == 0:
            del experiments[kind]
    return experiments
Exemplo n.º 5
0
 def setDatasetId(self):
     project_id = db_tables.checkProject(self.session, self.project)
     dataset_id = db_tables.checkDataset(self.session, project_id,
                                         self.dataset)
     return dataset_id