added deepsad base code

This commit is contained in:
Jan Kowalczyk
2024-06-28 07:42:12 +02:00
parent 2eb1bf2e05
commit 914bb020d0
57 changed files with 4974 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import json
class Config(object):
"""Base class for experimental setting/configuration."""
def __init__(self, settings):
self.settings = settings
def load_config(self, import_json):
"""Load settings dict from import_json (path/filename.json) JSON-file."""
with open(import_json, 'r') as fp:
settings = json.load(fp)
for key, value in settings.items():
self.settings[key] = value
def save_config(self, export_json):
"""Save settings dict to export_json (path/filename.json) JSON-file."""
with open(export_json, 'w') as fp:
json.dump(self.settings, fp)