Spaces:
Runtime error
Runtime error
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
|