diff --git a/fairnb/executor.py b/fairnb/executor.py index 9c859b00aadfa99fd35145ca0ac08a14f26d0359..8206ba8f4ec50418c5ce5013d3eccc1388a46dfd 100644 --- a/fairnb/executor.py +++ b/fairnb/executor.py @@ -1,5 +1,4 @@ import papermill -from nbconvert.preprocessors import ExecutePreprocessor from fairnb.entity.entity import Entity from fairnb.nb_config import NbConfig diff --git a/notebooks/main.ipynb b/notebooks/main.ipynb index b2c5a5a39e0348d22cccd264900ee4950e162421..9d3ffe49f153e8b54ea24640f3e1bcdebb969e43 100644 --- a/notebooks/main.ipynb +++ b/notebooks/main.ipynb @@ -2,25 +2,25 @@ "cells": [ { "cell_type": "markdown", + "metadata": { + "collapsed": false + }, "source": [ "# Main Notebook\n", "Executes all research notebooks one by one and initializes needed connectors and nbconfig.\n", "\n", "The entities created by one notebook are passed to the next notebook as dependencies, while moving the entites location. This way the output entities are separated from the input entities." - ], - "metadata": { - "collapsed": false - } + ] }, { "cell_type": "code", "execution_count": 1, "metadata": { - "collapsed": true, "ExecuteTime": { "end_time": "2023-10-12T15:14:46.207331868Z", "start_time": "2023-10-12T15:14:46.207003875Z" - } + }, + "collapsed": true }, "outputs": [], "source": [ @@ -32,11 +32,11 @@ "cell_type": "code", "execution_count": 2, "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2023-10-12T15:14:47.334123101Z", "start_time": "2023-10-12T15:14:46.420606786Z" - } + }, + "collapsed": false }, "outputs": [], "source": [ @@ -56,12 +56,12 @@ "cell_type": "code", "execution_count": 3, "metadata": { - "collapsed": false, - "lines_to_next_cell": 2, "ExecuteTime": { "end_time": "2023-10-12T15:14:47.527905861Z", "start_time": "2023-10-12T15:14:47.329609217Z" - } + }, + "collapsed": false, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -96,11 +96,11 @@ "cell_type": "code", "execution_count": 4, "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2023-10-12T15:05:43.638046061Z", "start_time": "2023-10-12T15:02:43.738618700Z" - } + }, + "collapsed": false }, "outputs": [ { @@ -113,12 +113,14 @@ }, { "data": { - "text/plain": "Executing: 0%| | 0/7 [00:00<?, ?cell/s]", "application/vnd.jupyter.widget-view+json": { + "model_id": "c97f76be78b84199b70336a49adcecaa", "version_major": 2, - "version_minor": 0, - "model_id": "c97f76be78b84199b70336a49adcecaa" - } + "version_minor": 0 + }, + "text/plain": [ + "Executing: 0%| | 0/7 [00:00<?, ?cell/s]" + ] }, "metadata": {}, "output_type": "display_data" @@ -140,24 +142,24 @@ "evalue": "'id'", "output_type": "error", "traceback": [ - "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", - "\u001B[0;31mKeyError\u001B[0m Traceback (most recent call last)", - "File \u001B[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/.venv/lib/python3.10/site-packages/pandas/core/indexes/base.py:3802\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[0;34m(self, key, method, tolerance)\u001B[0m\n\u001B[1;32m 3801\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[0;32m-> 3802\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_engine\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_loc\u001B[49m\u001B[43m(\u001B[49m\u001B[43mcasted_key\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 3803\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m err:\n", - "File \u001B[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/.venv/lib/python3.10/site-packages/pandas/_libs/index.pyx:138\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[0;34m()\u001B[0m\n", - "File \u001B[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/.venv/lib/python3.10/site-packages/pandas/_libs/index.pyx:165\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[0;34m()\u001B[0m\n", - "File \u001B[0;32mpandas/_libs/hashtable_class_helper.pxi:5745\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[0;34m()\u001B[0m\n", - "File \u001B[0;32mpandas/_libs/hashtable_class_helper.pxi:5753\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[0;34m()\u001B[0m\n", - "\u001B[0;31mKeyError\u001B[0m: 'id'", + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/.venv/lib/python3.10/site-packages/pandas/core/indexes/base.py:3802\u001b[0m, in \u001b[0;36mIndex.get_loc\u001b[0;34m(self, key, method, tolerance)\u001b[0m\n\u001b[1;32m 3801\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 3802\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_engine\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_loc\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcasted_key\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3803\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n", + "File \u001b[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/.venv/lib/python3.10/site-packages/pandas/_libs/index.pyx:138\u001b[0m, in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[0;34m()\u001b[0m\n", + "File \u001b[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/.venv/lib/python3.10/site-packages/pandas/_libs/index.pyx:165\u001b[0m, in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[0;34m()\u001b[0m\n", + "File \u001b[0;32mpandas/_libs/hashtable_class_helper.pxi:5745\u001b[0m, in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[0;34m()\u001b[0m\n", + "File \u001b[0;32mpandas/_libs/hashtable_class_helper.pxi:5753\u001b[0m, in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[0;34m()\u001b[0m\n", + "\u001b[0;31mKeyError\u001b[0m: 'id'", "\nThe above exception was the direct cause of the following exception:\n", - "\u001B[0;31mKeyError\u001B[0m Traceback (most recent call last)", - "Cell \u001B[0;32mIn[4], line 21\u001B[0m\n\u001B[1;32m 3\u001B[0m metadata \u001B[38;5;241m=\u001B[39m yaml\u001B[38;5;241m.\u001B[39msafe_load(\u001B[38;5;28mopen\u001B[39m(RESOURCE_PATH \u001B[38;5;241m/\u001B[39m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124m1_audio_files\u001B[39m\u001B[38;5;124m\"\u001B[39m \u001B[38;5;241m/\u001B[39m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mrecord_metadata.yml\u001B[39m\u001B[38;5;124m\"\u001B[39m, \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mr\u001B[39m\u001B[38;5;124m\"\u001B[39m))\n\u001B[1;32m 5\u001B[0m nb_config_audio_files \u001B[38;5;241m=\u001B[39m NbConfig(\n\u001B[1;32m 6\u001B[0m nb_location\u001B[38;5;241m=\u001B[39mNOTEBOOK_PATH \u001B[38;5;241m/\u001B[39m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124m1_audio_files.ipynb\u001B[39m\u001B[38;5;124m\"\u001B[39m,\n\u001B[1;32m 7\u001B[0m entities\u001B[38;5;241m=\u001B[39m[\n\u001B[0;32m (...)\u001B[0m\n\u001B[1;32m 18\u001B[0m dependencies\u001B[38;5;241m=\u001B[39m[]\n\u001B[1;32m 19\u001B[0m )\n\u001B[0;32m---> 21\u001B[0m \u001B[43mexecutor\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mexecute\u001B[49m\u001B[43m(\u001B[49m\u001B[43mnb_config_audio_files\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43monly_local\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mONLY_LOCAL\u001B[49m\u001B[43m)\u001B[49m\n", - "File \u001B[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/fairnb/executor.py:31\u001B[0m, in \u001B[0;36mExecutor.execute\u001B[0;34m(cls, nb_config, require_download, only_local, **kwargs)\u001B[0m\n\u001B[1;32m 28\u001B[0m \u001B[38;5;28mcls\u001B[39m\u001B[38;5;241m.\u001B[39mexecute_notebook(nb_config)\n\u001B[1;32m 30\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m only_local:\n\u001B[0;32m---> 31\u001B[0m \u001B[38;5;28;43mcls\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mupload_entities\u001B[49m\u001B[43m(\u001B[49m\u001B[43mnb_config\u001B[49m\u001B[43m)\u001B[49m\n", - "File \u001B[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/fairnb/executor.py:52\u001B[0m, in \u001B[0;36mExecutor.upload_entities\u001B[0;34m(nb_config)\u001B[0m\n\u001B[1;32m 47\u001B[0m \u001B[38;5;129m@staticmethod\u001B[39m\n\u001B[1;32m 48\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mupload_entities\u001B[39m(nb_config: NbConfig):\n\u001B[1;32m 49\u001B[0m \u001B[38;5;66;03m# load generated entity and upload it\u001B[39;00m\n\u001B[1;32m 50\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m entity \u001B[38;5;129;01min\u001B[39;00m nb_config\u001B[38;5;241m.\u001B[39mentities:\n\u001B[1;32m 51\u001B[0m \u001B[38;5;66;03m# use inspect to get path of caller\u001B[39;00m\n\u001B[0;32m---> 52\u001B[0m \u001B[43mentity\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mupload\u001B[49m\u001B[43m(\u001B[49m\u001B[43mnb_config\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mnb_location\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mnb_config\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mdependencies\u001B[49m\u001B[43m)\u001B[49m\n", - "File \u001B[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/fairnb/entity/invenio_entity.py:97\u001B[0m, in \u001B[0;36mInvenioEntity.upload\u001B[0;34m(self, executed_file, dependencies)\u001B[0m\n\u001B[1;32m 86\u001B[0m uri \u001B[38;5;241m=\u001B[39m create_response[\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mlinks\u001B[39m\u001B[38;5;124m\"\u001B[39m][\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mrecord\u001B[39m\u001B[38;5;124m\"\u001B[39m] \u001B[38;5;66;03m# Invalid until published\u001B[39;00m\n\u001B[1;32m 88\u001B[0m metadata \u001B[38;5;241m=\u001B[39m EntityProvenance\u001B[38;5;241m.\u001B[39mnew(\n\u001B[1;32m 89\u001B[0m name\u001B[38;5;241m=\u001B[39m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mname,\n\u001B[1;32m 90\u001B[0m description\u001B[38;5;241m=\u001B[39m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mdescription,\n\u001B[0;32m (...)\u001B[0m\n\u001B[1;32m 94\u001B[0m platform\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124minvenio\u001B[39m\u001B[38;5;124m\"\u001B[39m,\n\u001B[1;32m 95\u001B[0m )\n\u001B[0;32m---> 97\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mupload_provenance\u001B[49m\u001B[43m(\u001B[49m\u001B[43mmetadata\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 98\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mupload_dependencies(dependencies)\n", - "File \u001B[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/fairnb/entity/entity.py:126\u001B[0m, in \u001B[0;36mEntity.upload_provenance\u001B[0;34m(self, provenance)\u001B[0m\n\u001B[1;32m 123\u001B[0m df \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mdbrepo_connector\u001B[38;5;241m.\u001B[39mdownload_table_as_df(\u001B[38;5;28mstr\u001B[39m(\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mmetadata_table_id))\n\u001B[1;32m 125\u001B[0m \u001B[38;5;66;03m# FIXME: create robust version of id retrieval, if possible\u001B[39;00m\n\u001B[0;32m--> 126\u001B[0m row \u001B[38;5;241m=\u001B[39m df\u001B[38;5;241m.\u001B[39miloc[\u001B[43mdf\u001B[49m\u001B[43m[\u001B[49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;124;43mid\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[43m]\u001B[49m\u001B[38;5;241m.\u001B[39midxmax()] \u001B[38;5;66;03m# get the newest row, as it should contain the correct data\u001B[39;00m\n\u001B[1;32m 127\u001B[0m meta \u001B[38;5;241m=\u001B[39m EntityProvenance\u001B[38;5;241m.\u001B[39mfrom_series(row)\n\u001B[1;32m 128\u001B[0m \u001B[38;5;28;01massert\u001B[39;00m meta\u001B[38;5;241m.\u001B[39mcreation_time \u001B[38;5;241m==\u001B[39m provenance\u001B[38;5;241m.\u001B[39mcreation_time \u001B[38;5;129;01mand\u001B[39;00m meta\u001B[38;5;241m.\u001B[39mname \u001B[38;5;241m==\u001B[39m provenance\u001B[38;5;241m.\u001B[39mname\n", - "File \u001B[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/.venv/lib/python3.10/site-packages/pandas/core/frame.py:3807\u001B[0m, in \u001B[0;36mDataFrame.__getitem__\u001B[0;34m(self, key)\u001B[0m\n\u001B[1;32m 3805\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcolumns\u001B[38;5;241m.\u001B[39mnlevels \u001B[38;5;241m>\u001B[39m \u001B[38;5;241m1\u001B[39m:\n\u001B[1;32m 3806\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_getitem_multilevel(key)\n\u001B[0;32m-> 3807\u001B[0m indexer \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcolumns\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_loc\u001B[49m\u001B[43m(\u001B[49m\u001B[43mkey\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 3808\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m is_integer(indexer):\n\u001B[1;32m 3809\u001B[0m indexer \u001B[38;5;241m=\u001B[39m [indexer]\n", - "File \u001B[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/.venv/lib/python3.10/site-packages/pandas/core/indexes/base.py:3804\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[0;34m(self, key, method, tolerance)\u001B[0m\n\u001B[1;32m 3802\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_engine\u001B[38;5;241m.\u001B[39mget_loc(casted_key)\n\u001B[1;32m 3803\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m err:\n\u001B[0;32m-> 3804\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m(key) \u001B[38;5;28;01mfrom\u001B[39;00m \u001B[38;5;21;01merr\u001B[39;00m\n\u001B[1;32m 3805\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mTypeError\u001B[39;00m:\n\u001B[1;32m 3806\u001B[0m \u001B[38;5;66;03m# If we have a listlike key, _check_indexing_error will raise\u001B[39;00m\n\u001B[1;32m 3807\u001B[0m \u001B[38;5;66;03m# InvalidIndexError. Otherwise we fall through and re-raise\u001B[39;00m\n\u001B[1;32m 3808\u001B[0m \u001B[38;5;66;03m# the TypeError.\u001B[39;00m\n\u001B[1;32m 3809\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_check_indexing_error(key)\n", - "\u001B[0;31mKeyError\u001B[0m: 'id'" + "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[4], line 21\u001b[0m\n\u001b[1;32m 3\u001b[0m metadata \u001b[38;5;241m=\u001b[39m yaml\u001b[38;5;241m.\u001b[39msafe_load(\u001b[38;5;28mopen\u001b[39m(RESOURCE_PATH \u001b[38;5;241m/\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m1_audio_files\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m/\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrecord_metadata.yml\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124m\"\u001b[39m))\n\u001b[1;32m 5\u001b[0m nb_config_audio_files \u001b[38;5;241m=\u001b[39m NbConfig(\n\u001b[1;32m 6\u001b[0m nb_location\u001b[38;5;241m=\u001b[39mNOTEBOOK_PATH \u001b[38;5;241m/\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m1_audio_files.ipynb\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 7\u001b[0m entities\u001b[38;5;241m=\u001b[39m[\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 18\u001b[0m dependencies\u001b[38;5;241m=\u001b[39m[]\n\u001b[1;32m 19\u001b[0m )\n\u001b[0;32m---> 21\u001b[0m \u001b[43mexecutor\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnb_config_audio_files\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43monly_local\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mONLY_LOCAL\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/fairnb/executor.py:31\u001b[0m, in \u001b[0;36mExecutor.execute\u001b[0;34m(cls, nb_config, require_download, only_local, **kwargs)\u001b[0m\n\u001b[1;32m 28\u001b[0m \u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m.\u001b[39mexecute_notebook(nb_config)\n\u001b[1;32m 30\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m only_local:\n\u001b[0;32m---> 31\u001b[0m \u001b[38;5;28;43mcls\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mupload_entities\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnb_config\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/fairnb/executor.py:52\u001b[0m, in \u001b[0;36mExecutor.upload_entities\u001b[0;34m(nb_config)\u001b[0m\n\u001b[1;32m 47\u001b[0m \u001b[38;5;129m@staticmethod\u001b[39m\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mupload_entities\u001b[39m(nb_config: NbConfig):\n\u001b[1;32m 49\u001b[0m \u001b[38;5;66;03m# load generated entity and upload it\u001b[39;00m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m entity \u001b[38;5;129;01min\u001b[39;00m nb_config\u001b[38;5;241m.\u001b[39mentities:\n\u001b[1;32m 51\u001b[0m \u001b[38;5;66;03m# use inspect to get path of caller\u001b[39;00m\n\u001b[0;32m---> 52\u001b[0m \u001b[43mentity\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mupload\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnb_config\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mnb_location\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mnb_config\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdependencies\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/fairnb/entity/invenio_entity.py:97\u001b[0m, in \u001b[0;36mInvenioEntity.upload\u001b[0;34m(self, executed_file, dependencies)\u001b[0m\n\u001b[1;32m 86\u001b[0m uri \u001b[38;5;241m=\u001b[39m create_response[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlinks\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrecord\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;66;03m# Invalid until published\u001b[39;00m\n\u001b[1;32m 88\u001b[0m metadata \u001b[38;5;241m=\u001b[39m EntityProvenance\u001b[38;5;241m.\u001b[39mnew(\n\u001b[1;32m 89\u001b[0m name\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mname,\n\u001b[1;32m 90\u001b[0m description\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdescription,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 94\u001b[0m platform\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124minvenio\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 95\u001b[0m )\n\u001b[0;32m---> 97\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mupload_provenance\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmetadata\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 98\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mupload_dependencies(dependencies)\n", + "File \u001b[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/fairnb/entity/entity.py:126\u001b[0m, in \u001b[0;36mEntity.upload_provenance\u001b[0;34m(self, provenance)\u001b[0m\n\u001b[1;32m 123\u001b[0m df \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdbrepo_connector\u001b[38;5;241m.\u001b[39mdownload_table_as_df(\u001b[38;5;28mstr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmetadata_table_id))\n\u001b[1;32m 125\u001b[0m \u001b[38;5;66;03m# FIXME: create robust version of id retrieval, if possible\u001b[39;00m\n\u001b[0;32m--> 126\u001b[0m row \u001b[38;5;241m=\u001b[39m df\u001b[38;5;241m.\u001b[39miloc[\u001b[43mdf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mid\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241m.\u001b[39midxmax()] \u001b[38;5;66;03m# get the newest row, as it should contain the correct data\u001b[39;00m\n\u001b[1;32m 127\u001b[0m meta \u001b[38;5;241m=\u001b[39m EntityProvenance\u001b[38;5;241m.\u001b[39mfrom_series(row)\n\u001b[1;32m 128\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m meta\u001b[38;5;241m.\u001b[39mcreation_time \u001b[38;5;241m==\u001b[39m provenance\u001b[38;5;241m.\u001b[39mcreation_time \u001b[38;5;129;01mand\u001b[39;00m meta\u001b[38;5;241m.\u001b[39mname \u001b[38;5;241m==\u001b[39m provenance\u001b[38;5;241m.\u001b[39mname\n", + "File \u001b[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/.venv/lib/python3.10/site-packages/pandas/core/frame.py:3807\u001b[0m, in \u001b[0;36mDataFrame.__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 3805\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcolumns\u001b[38;5;241m.\u001b[39mnlevels \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[1;32m 3806\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_getitem_multilevel(key)\n\u001b[0;32m-> 3807\u001b[0m indexer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumns\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_loc\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3808\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m is_integer(indexer):\n\u001b[1;32m 3809\u001b[0m indexer \u001b[38;5;241m=\u001b[39m [indexer]\n", + "File \u001b[0;32m~/Programming/uni/bachelorarbeit/dbrepo-ismir/.venv/lib/python3.10/site-packages/pandas/core/indexes/base.py:3804\u001b[0m, in \u001b[0;36mIndex.get_loc\u001b[0;34m(self, key, method, tolerance)\u001b[0m\n\u001b[1;32m 3802\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_engine\u001b[38;5;241m.\u001b[39mget_loc(casted_key)\n\u001b[1;32m 3803\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m-> 3804\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m(key) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n\u001b[1;32m 3805\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m:\n\u001b[1;32m 3806\u001b[0m \u001b[38;5;66;03m# If we have a listlike key, _check_indexing_error will raise\u001b[39;00m\n\u001b[1;32m 3807\u001b[0m \u001b[38;5;66;03m# InvalidIndexError. Otherwise we fall through and re-raise\u001b[39;00m\n\u001b[1;32m 3808\u001b[0m \u001b[38;5;66;03m# the TypeError.\u001b[39;00m\n\u001b[1;32m 3809\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_check_indexing_error(key)\n", + "\u001b[0;31mKeyError\u001b[0m: 'id'" ] } ], @@ -189,10 +191,10 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": false, "ExecuteTime": { "start_time": "2023-10-12T15:05:43.645571236Z" - } + }, + "collapsed": false }, "outputs": [], "source": [ @@ -215,17 +217,17 @@ " ]\n", ")\n", "\n", - "executor.execute(nb_config_generate_features, only_local=ONLY_LOCAL)\n" + "executor.execute(nb_config_generate_features, only_local=ONLY_LOCAL)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": false, "ExecuteTime": { "start_time": "2023-10-12T15:05:43.647919709Z" - } + }, + "collapsed": false }, "outputs": [], "source": [ @@ -266,11 +268,11 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": false, - "is_executing": true, "ExecuteTime": { "start_time": "2023-10-12T15:14:54.285396178Z" - } + }, + "collapsed": false, + "is_executing": true }, "outputs": [ { @@ -319,12 +321,14 @@ }, { "data": { - "text/plain": "Executing: 0%| | 0/8 [00:00<?, ?cell/s]", "application/vnd.jupyter.widget-view+json": { + "model_id": "79111c7324b440b7bc4b73c650b2dd35", "version_major": 2, - "version_minor": 0, - "model_id": "79111c7324b440b7bc4b73c650b2dd35" - } + "version_minor": 0 + }, + "text/plain": [ + "Executing: 0%| | 0/8 [00:00<?, ?cell/s]" + ] }, "metadata": {}, "output_type": "display_data" @@ -503,10 +507,10 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": false, "ExecuteTime": { "start_time": "2023-10-12T15:05:43.672101780Z" - } + }, + "collapsed": false }, "outputs": [], "source": [