Browse Source

Make notebook backward compatible with cfg files without microphones

miguel_bengala 1 year ago
parent
commit
8c1f6111ab
1 changed files with 2 additions and 1 deletions
  1. 2 1
      SIT.ipynb

+ 2 - 1
SIT.ipynb

@@ -80,7 +80,8 @@
     "    cfg_local = json.load(json_file)\n",
     "\n",
     "for key in cfg.keys():\n",
-    "    cfg[key].update(cfg_local[key])\n",
+    "    if key in cfg_local: # only update if the key exists in the local config, otherwise keep default (important for backward compatibility with cfg files before microphones)\n",
+    "        cfg[key].update(cfg_local[key])\n",
     "cfg['experiment']['experiment_date'] = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')\n",
     "\n",
     "# print loaded settings\n",