File size: 1,898 Bytes
1c703f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
54
55
"""
Structure of our main database:

DB
β”œβ”€β”€ unique_id.json :(dictionary)...
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚
β”œβ”€β”€ prop_dictionary
β”‚   β”œβ”€β”€ name :(str) energy
β”‚   β”œβ”€β”€ value: (int float list )
β”‚   β”œβ”€β”€ source:  (dictionary)
β”‚       β”œβ”€β”€ tipe: (DB/computation/author_enforce)
β”‚       β”œβ”€β”€ author_id : (str)
β”‚       └── description: (dictionary)
β”‚               β”œβ”€β”€ author_id : (str)
β”‚               └── method_name : (str)
β”‚                        β”œβ”€β”€ hyperparameters :(dictionary)
β”‚                        └── inputs :(dictionary)
β”‚
└─────────────────────────────────────────────────────────────────────────────────
"""


class DBPropriety():
    def __init__(self, name, value, source):
        self.name = name
        self.value = value
        self.source = source

    def json_descript(self):
        data_instance = {
            "name": self.name,
            "value": self.value,
            "source": self.source.json_description()
        }
        return data_instance


class Source():

    def __init__(self, tipe, author_id, description, cite=None):
        self.tipe = tipe
        self.author_id = author_id
        self.description = description
        self.cite=cite

    def json_description(self):
        data_instance = {
            "tipe": self.tipe,
            "author_id": self.author_id,
            "description": self.description,
            "cite": self.cite
        }
        return data_instance