""" 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