示例#1
0
 def data_sets(self) -> List[DataSet]:
     """Get all the datasets of this experiment"""
     runs = get_runs(self.conn, self.exp_id)
     data_sets = []
     for run in runs:
         data_sets.append(load_by_id(run['run_id'], conn=self.conn))
     return data_sets
示例#2
0
def get_runs_from_db(path: str, start: int = 0,
                     stop: Union[None, int] = None,
                     get_structure: bool = False):
    """
    Get a db 'overview' dictionary from the db located in `path`.
    `start` and `stop` refer to indices of the runs in the db that we want
    to have details on; if `stop` is None, we'll use runs until the end.
    if `get_structure` is True, include info on the run data structure
    in the return dict.
    """

    conn = connect(path)
    runs = get_runs(conn)

    if stop is None:
        stop = len(runs)

    runs = runs[start:stop]
    overview = {}

    for run in runs:
        run_id = run['run_id']
        overview[run_id] = get_ds_info(conn, run_id,
                                       get_structure=get_structure)

    return overview
示例#3
0
 def data_sets(self) -> List[DataSetProtocol]:
     """Get all the datasets of this experiment"""
     runs = get_runs(self.conn, self.exp_id)
     return [load_by_id(run['run_id'], conn=self.conn) for run in runs]