/
tables.py
51 lines (47 loc) · 1.51 KB
/
tables.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
"""
Classes defining the shape of pyiron's database tables.
"""
from sqlalchemy import (
Column,
DateTime,
Float,
Integer,
String,
Table,
)
__author__ = "Murat Han Celik, Liam Huber"
__copyright__ = (
"Copyright 2020, Max-Planck-Institut für Eisenforschung GmbH"
" - Computational Materials Design (CM) Department"
)
__version__ = "0.0"
__maintainer__ = "Liam Huber"
__email__ = "huber@mpie.de"
__status__ = "development"
__date__ = "Sep, 2021"
def get_historical_table(table_name, metadata, extend_existing=True):
"""The historical table."""
return Table(
table_name,
metadata,
Column("id", Integer, primary_key=True, autoincrement=True),
Column("parentid", Integer),
Column("masterid", Integer),
Column("projectpath", String(50)),
Column("project", String(255)),
Column("job", String(50)),
Column("subjob", String(255)),
Column("chemicalformula", String(50)),
Column("status", String(20)),
Column("hamilton", String(20)),
Column("hamversion", String(50)),
Column("username", String(20)),
Column("computer", String(100)),
Column("timestart", DateTime),
Column("timestop", DateTime),
Column("totalcputime", Float),
extend_existing=extend_existing,
)