From 0aeeb3f4d30f810a542ed0b5d073136b5d8e7d80 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Oct 2025 17:56:59 +0100 Subject: [PATCH] added owncloud data request notebook reading full "SIGNAL" table for 4 columns might kill the kernel. Maybe use partial requests in pd.read_hdf() with start and stop --- owncloud.ipynb | 137 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 owncloud.ipynb diff --git a/owncloud.ipynb b/owncloud.ipynb new file mode 100644 index 0000000..569ad16 --- /dev/null +++ b/owncloud.ipynb @@ -0,0 +1,137 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "aab6b326-a583-47ad-8bb7-723c2fddcc63", + "metadata": { + "scrolled": true + }, + "outputs": [], + "source": [ + "%pip install pyocclient\n", + "import yaml\n", + "import owncloud\n", + "import pandas as pd\n", + "import time" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4f42846c-27c3-4394-a40a-e22d73c2902e", + "metadata": {}, + "outputs": [], + "source": [ + "start = time.time()\n", + "\n", + "with open(\"login.yaml\") as f:\n", + " cfg = yaml.safe_load(f)\n", + "url, password = cfg[0][\"url\"], cfg[1][\"password\"]\n", + "file = \"adabase-public-0003-v_0_0_2.h5py\"\n", + "oc = owncloud.Client.from_public_link(url, folder_password=password)\n", + "\n", + "\n", + "oc.get_file(file, \"tmp.h5\")\n", + "\n", + "end = time.time()\n", + "print(end - start)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3714dec2-85d0-4f76-af46-ea45ebec2fa3", + "metadata": {}, + "outputs": [], + "source": [ + "start = time.time()\n", + "df_performance = pd.read_hdf(\"tmp.h5\", \"PERFORMANCE\")\n", + "end = time.time()\n", + "print(end - start)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6ae47e52-ad86-4f8d-b929-0080dc99f646", + "metadata": {}, + "outputs": [], + "source": [ + "start = time.time()\n", + "df_4_col = pd.read_hdf(\"tmp.h5\", \"SIGNALS\", mode=\"r\", columns=[\"STUDY\",\"LEVEL\", \"PHASE\", 'RAW_ECG_I'])\n", + "end = time.time()\n", + "print(end - start)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7c139f3a-ede8-4530-957d-d1bb939f6cb5", + "metadata": {}, + "outputs": [], + "source": [ + "df_4_col.head()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a68d58ea-65f2-46c4-a2b2-8c3447c715d7", + "metadata": {}, + "outputs": [], + "source": [ + "df_4_col.shape" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "95aa4523-3784-4ab6-bf92-0227ce60e863", + "metadata": {}, + "outputs": [], + "source": [ + "df_4_col.info()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "defbcaf4-ad1b-453f-9b48-ab0ecfc4b5d5", + "metadata": {}, + "outputs": [], + "source": [ + "df_4_col.isna().sum()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "72313895-c478-44a5-9108-00b0bec01bb8", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}