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