latmatcher / backend /db_utils /structure_propriety.py
AndreiVoicuT's picture
Upload 85 files
1c703f0 verified
raw
history blame
1.9 kB
"""
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