diff --git a/dev/oasis_assessment.ipynb b/dev/oasis_assessment.ipynb new file mode 100644 index 0000000..087d3e7 --- /dev/null +++ b/dev/oasis_assessment.ipynb @@ -0,0 +1,502 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 59, + "id": "747db03a-4bec-4ead-9dd0-3e017a8f4310", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/home/jovyan\n" + ] + } + ], + "source": [ + "import os, glob\n", + "import numpy as np\n", + "from pathlib import Path\n", + "import json\n", + "import matplotlib.pyplot as plt\n", + "print(os.getcwd())\n", + "# ! ls" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "id": "1c638e5c-ae13-476f-8a35-1f94d8fab460", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "def byte_to_mibibyte(n_bytes):\n", + " return f\"{np.around(n_bytes / (1024**3), decimals=3)} GiB\"" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "id": "62d338fa-4be5-4382-9ce3-35a0f7e4e4cc", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "def get_file_size(file_name):\n", + " return os.path.getsize(file_name)" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "id": "62530097-0fd4-40b9-bb77-3babc9411d09", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "def get_dir_size(path):\n", + " total = 0\n", + " with os.scandir(path) as it:\n", + " for entry in it:\n", + " if entry.is_file():\n", + " total += entry.stat().st_size\n", + " elif entry.is_dir():\n", + " total += get_dir_size(entry.path)\n", + " return total" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "id": "c2d0784e-f954-4413-83be-fc21d4ab0278", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "453 projects\n" + ] + } + ], + "source": [ + "projects = {}\n", + "for fpath in glob.glob('work/**/*.nsproj', recursive=True):\n", + " token = fpath[0:fpath.rfind(\".\")]\n", + " if Path(f\"{token} Data\").is_dir():\n", + " if token not in projects:\n", + " projects[token] = {\"nsproj\": fpath,\n", + " \"dir_name\": f\"{token} Data\",\n", + " \"dir_size\": get_dir_size(f\"{token} Data\")}\n", + " else:\n", + " raise KeyError(f\"{token} exists already!\")\n", + "with open('projects.json', 'w') as fp:\n", + " json.dump(projects, fp)" + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "id": "7d68d36f-89d0-4fef-a8d0-8930ab907155", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "452 nsproj projects\n", + "11826.383 GiB total\n", + "677.182 GiB largest\n", + "4.193 GiB median\n", + "0.001 GiB smallest\n" + ] + } + ], + "source": [ + "total = 0\n", + "sizes = []\n", + "for key, dct in projects.items():\n", + " if dct[\"dir_size\"] > 0.:\n", + " total += dct[\"dir_size\"]\n", + " sizes.append(dct[\"dir_size\"])\n", + " # print(dct[\"dir_size\"])\n", + "print(f\"{len(sizes)} nsproj projects\")\n", + "print(f\"{byte_to_mibibyte(total)} total\")\n", + "print(f\"{byte_to_mibibyte(np.max(np.asarray(sizes)))} largest\")\n", + "print(f\"{byte_to_mibibyte(np.quantile(np.asarray(sizes), 0.5))} median\")\n", + "print(f\"{byte_to_mibibyte(np.min(np.asarray(sizes)))} smallest\")" + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "id": "3997a8eb-e76e-4723-9d9b-a6171159c2c0", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "# plt.plot(np.cumsum(np.sort(sizes)), np.linspace(1, len(sizes), num=len(sizes), endpoint=True)/len(sizes))\n", + "# plt.semilogx()\n", + "#plt.semilogy()" + ] + }, + { + "cell_type": "code", + "execution_count": 118, + "id": "30d54d7a-d5d3-4c50-8010-0cd0bdd23457", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "# ! git clone https://www.github.com/FAIRmat-NFDI/pynxtools-em.git --branch main --recursive pynxtools_em\n", + "# ! cd pynxtools_em/ && git checkout nion_directory\n", + "# ! pip install --upgrade pip\n", + "# ! cd pynxtools_em && git fetch && git pull\n", + "# ! cd pynxtools_em && pip install -e \".[dev,docs]\"" + ] + }, + { + "cell_type": "code", + "execution_count": 119, + "id": "41209100-90a3-4cf1-b910-c5bb995dfcde", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "work/data/AEljarrat/2020\\ AgNWs+AuNSs/Nion\\ Swift\\ Project\\ 20200825.nsproj\n", + "work/data/AEljarrat/2020\\ AgNWs/20200619.nsproj\n", + "work/data/AEljarrat/2020\\ AgNWs/20200630\\ Data.nsproj\n", + "work/data/AEljarrat/2020\\ AgNWs/Nion\\ Swift\\ Project\\ 20200729.nsproj\n", + "work/data/AEljarrat/2020\\ CIGSe\\ PVComB/CIGSe_PVcomB.nsproj\n", + "work/data/AEljarrat/2020\\ MoS2\\ HIOS/20201102_MoS2_HIOS#2_EBL_KGreben\\ .nsproj\n", + "work/data/AEljarrat/2020\\ MoS2\\ HIOS/20201209\\ MoS2\\ TEM1.nsproj\n", + "work/data/AEljarrat/2020\\ MoS2\\ HIOS/20210225\\ MoS2\\ on\\ Au\\ face_down.nsproj\n", + "work/data/AEljarrat/2020\\ MoS2\\ HIOS/MoS2\\ #1\\ no\\ EBL.nsproj\n", + "work/data/AEljarrat/2020\\ MoS2\\ HIOS/MoS2_20201106/2nd_Biatch.nsproj\n", + "work/data/AEljarrat/2020\\ VNAND\\ 2/20201009\\ VNAND\\ good.nsproj\n", + "work/data/AEljarrat/2020\\ VNAND\\ 2/20201023\\ VNAND\\ more\\ good\\ Data/Nion\\ Swift\\ Project\\ 20201023.nsproj\n", + "work/data/AEljarrat/2020\\ c-Si/20200907\\ c-Si\\ 211.nsproj\n", + "work/data/AEljarrat/2020\\ c-Si/20200928\\ c-Si\\ 60kV.nsproj\n", + "work/data/AEljarrat/2020\\ c-Si/20210224\\ c-Si\\ 211.nsproj\n", + "work/data/AEljarrat/2020\\ c-Si/20210303\\ c-Si\\ 211\\ after\\ 12min\\ plasma\\ clean.nsproj\n", + "work/data/AEljarrat/2020\\ c-Si/20210304\\ c-Si\\ 211\\ after\\ 12\\ min\\ plasma\\ clean.nsproj\n", + "work/data/AEljarrat/2021_Au-NRs_Yuhang/20210812\\ Au-NRs\\ and\\ Pd.nsproj\n", + "work/data/AEljarrat/2021_Au-NRs_Yuhang/20210812\\ Au-NRs\\ bare.nsproj\n", + "work/data/AEljarrat/2021_Au-NRs_Yuhang/20210813\\ Au-NRs\\ and\\ Pd\\ and\\ PDA.nsproj\n", + "work/data/AEljarrat/2021_Au-NRs_Yuhang/20210826\\ EEGS\\ Pd-Au\\ NR.nsproj\n", + "work/data/AEljarrat/2021_CVN_Zdravko/20210430\\ CVN\\ Onion.nsproj\n", + "work/data/AEljarrat/2021_CVN_Zdravko/20211112\\ CVN\\ onions.nsproj\n", + "work/data/AEljarrat/2021_PTI_Burmeister/20210910\\ PTI42\\ LiBr.nsproj\n", + "work/data/AEljarrat/2021_PTI_Burmeister/20210917\\ PTI\\ 17.nsproj\n", + "work/data/AEljarrat/2021_PTI_Burmeister/20210923\\ p-type\\ c-Si.nsproj\n", + "work/data/AEljarrat/2021_PTI_Burmeister/20210927\\ PTI\\ LiBr\\ cold.nsproj\n", + "work/data/AEljarrat/2021_PTI_Burmeister/20210928\\ PTI\\ NI\\ cold.nsproj\n", + "work/data/AEljarrat/2021_PTI_Burmeister/20211022\\ PTI\\ LiBr\\ 60kV\\ RT.nsproj\n", + "work/data/AEljarrat/2021_PTI_Burmeister/20211101\\ PTI\\ IF\\ aloof\\ RT.nsproj\n", + "work/data/AEljarrat/2021_PTI_Burmeister/20220208\\ PTI-LiBr\\ 60kV.nsproj\n", + "work/data/AEljarrat/2021_PTI_Burmeister/20220223\\ PTI\\ IF\\ 60kV\\ RT.nsproj\n", + "work/data/AEljarrat/2021_PlasmonicStars_Radwan/20211021\\ sample\\ 01\\ 60kV.nsproj\n", + "work/data/AEljarrat/2021_STO_Amari/20201109_AB_STO_86_Amari_1.nsproj\n", + "work/data/AEljarrat/2021_STO_Amari/20211026\\ STO\\ session\\ 2.nsproj\n", + "work/data/AEljarrat/2021_TiO2_PBD/20211011\\ TiO2\\ 01\\ session\\ 01.nsproj\n", + "work/data/AEljarrat/2021_TiO2_PBD/20211020\\ TiO2\\ 01\\ session\\ 02\\ 60kV.nsproj\n", + "work/data/AEljarrat/2021_nanocones_Tuebingen/20210526\\ A3\\ 200nm.nsproj\n", + "work/data/AEljarrat/2021_nanocones_Tuebingen/20210526\\ A4\\ 150nm.nsproj\n", + "work/data/AEljarrat/2021_nanocones_Tuebingen/20210526\\ A5\\ 100nm\\ Data.nsproj\n", + "work/data/AEljarrat/2021_nanocones_Tuebingen/20210526\\ A6\\ Al\\ 150nm\\ Data.nsproj\n", + "work/data/AEljarrat/2022\\ FeO\\ Lavorato/20220503\\ Cu23\\ OA.nsproj\n", + "work/data/AEljarrat/2022\\ FeO\\ Lavorato/20220503\\ Cu23\\ OA\\ aC-clean.nsproj\n", + "work/data/AEljarrat/2022\\ UB\\ visit/20220628\\ S036\\ FIB\\ .nsproj\n", + "work/data/AEljarrat/2022\\ UB\\ visit/20220629\\ SO35\\ dry.nsproj\n", + "work/data/AEljarrat/2022_BTO_cooling/20220317\\ BTO\\ pillars\\ cooling\\ holder.nsproj\n", + "work/data/AEljarrat/ACQW\\ Capellini/20210126\\ sample\\ 2224_1.nsproj\n", + "work/data/AEljarrat/ACQW\\ Capellini/20210312\\ ACQW\\ 2217.nsproj\n", + "work/data/AEljarrat/ACQW\\ Capellini/20210316\\ ACQW\\ 2217.nsproj\n", + "work/data/AEljarrat/Au-NRs\\ TDBC/20201202\\ batch\\ 01\\ mixed\\ sizes.nsproj\n", + "work/data/AEljarrat/Au-NRs\\ TDBC/20201203\\ batch\\ 01\\ mixed\\ sizes.nsproj\n", + "work/data/AEljarrat/Au-NRs\\ TDBC/20210204\\ A1.nsproj\n", + "work/data/AEljarrat/Au-NRs\\ TDBC/20210212\\ Mixed\\ TDBC\\ cool\\ holder.nsproj\n", + "work/data/AEljarrat/Au-NRs\\ TDBC/20210325\\ 2nd\\ batch\\ C1.nsproj\n", + "work/data/AEljarrat/Au-NRs\\ TDBC/20210401\\ 2nd\\ batch\\ B1\\ Data.nsproj\n", + "work/data/AEljarrat/Au-NRs\\ TDBC/20210423\\ Bare\\ AuNRs\\ Mixed\\ RT.nsproj\n", + "work/data/AEljarrat/AuPd\\ Zdravko/20210202\\ AuPd.nsproj\n", + "work/data/AEljarrat/AuPd\\ Zdravko/20210202\\ AuPdTi.nsproj\n", + "work/data/AEljarrat/BaSnO3\\ IKZ/20201208\\ PV01.nsproj\n", + "work/data/AEljarrat/BaSnO3\\ IKZ/20210127\\ PV01\\ -\\ after\\ plasma\\ clean.nsproj\n", + "work/data/AEljarrat/BaSnO3\\ IKZ/20210506\\ BSO\\ PV.nsproj\n", + "work/data/AEljarrat/BaSnO3\\ IKZ/20211202\\ BSO-PV-2\\ RT.nsproj\n", + "work/data/AEljarrat/Fe3N_C/20201120_LaceyC_01.nsproj\n", + "work/data/AEljarrat/Fe3N_C/20201126_LaceyC_01_2nd_Observation.nsproj\n", + "work/data/AEljarrat/Hongguang/New\\ folder/20220615\\ HZO\\ 3nm\\ 01.nsproj\n", + "work/data/AEljarrat/LLZO\\ Yaolin/20211203\\ LLZO\\ undoped.nsproj\n", + "work/data/Bruker/2023-09-28_Apo_5_micromol_cryo_60kV/2023-09-28_Apo_5_micromol_cryo_60kV.nsproj\n", + "^C\n", + "work/data/Bruker/2023-11-09_Bruker_hemocyanine_undiluted/2023-11-09_Bruker_hemocyanine_undiluted.nsproj\n", + "^C\n", + "work/data/Bruker/2023-11-09_Bruker_hemocyanine_undiluted/2023-11-10_Bruker_hemocyanine_undiluted\\ Data/2023-11-10_Bruker_hemocyanine_undiluted\\ Data.nsproj\n" + ] + }, + { + "ename": "UnboundLocalError", + "evalue": "local variable 'child' referenced before assignment", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/IPython/utils/_process_posix.py:148\u001b[0m, in \u001b[0;36mProcessHandler.system\u001b[0;34m(self, cmd)\u001b[0m\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 148\u001b[0m child \u001b[38;5;241m=\u001b[39m \u001b[43mpexpect\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mspawn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msh\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43margs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m-c\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcmd\u001b[49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;66;03m# Vanilla Pexpect\u001b[39;00m\n\u001b[1;32m 149\u001b[0m flush \u001b[38;5;241m=\u001b[39m sys\u001b[38;5;241m.\u001b[39mstdout\u001b[38;5;241m.\u001b[39mflush\n", + "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pexpect/pty_spawn.py:205\u001b[0m, in \u001b[0;36mspawn.__init__\u001b[0;34m(self, command, args, timeout, maxread, searchwindowsize, logfile, cwd, env, ignore_sighup, echo, preexec_fn, encoding, codec_errors, dimensions, use_poll)\u001b[0m\n\u001b[1;32m 204\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 205\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_spawn\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcommand\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpreexec_fn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdimensions\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 206\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39muse_poll \u001b[38;5;241m=\u001b[39m use_poll\n", + "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pexpect/pty_spawn.py:303\u001b[0m, in \u001b[0;36mspawn._spawn\u001b[0;34m(self, command, args, preexec_fn, dimensions)\u001b[0m\n\u001b[1;32m 300\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39margs \u001b[38;5;241m=\u001b[39m [a \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(a, \u001b[38;5;28mbytes\u001b[39m) \u001b[38;5;28;01melse\u001b[39;00m a\u001b[38;5;241m.\u001b[39mencode(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mencoding)\n\u001b[1;32m 301\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m a \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39margs]\n\u001b[0;32m--> 303\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mptyproc \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_spawnpty\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43menv\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43menv\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 304\u001b[0m \u001b[43m \u001b[49m\u001b[43mcwd\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcwd\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 306\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpid \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mptyproc\u001b[38;5;241m.\u001b[39mpid\n", + "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pexpect/pty_spawn.py:315\u001b[0m, in \u001b[0;36mspawn._spawnpty\u001b[0;34m(self, args, **kwargs)\u001b[0m\n\u001b[1;32m 314\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m'''Spawn a pty and return an instance of PtyProcess.'''\u001b[39;00m\n\u001b[0;32m--> 315\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mptyprocess\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mPtyProcess\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mspawn\u001b[49m\u001b[43m(\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/ptyprocess/ptyprocess.py:315\u001b[0m, in \u001b[0;36mPtyProcess.spawn\u001b[0;34m(cls, argv, cwd, env, echo, preexec_fn, dimensions, pass_fds)\u001b[0m\n\u001b[1;32m 314\u001b[0m os\u001b[38;5;241m.\u001b[39mclose(exec_err_pipe_write)\n\u001b[0;32m--> 315\u001b[0m exec_err_data \u001b[38;5;241m=\u001b[39m \u001b[43mos\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43mexec_err_pipe_read\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m4096\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 316\u001b[0m os\u001b[38;5;241m.\u001b[39mclose(exec_err_pipe_read)\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: ", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[0;31mUnboundLocalError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[119], line 11\u001b[0m\n\u001b[1;32m 9\u001b[0m STDOUT \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpynx/\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mnsproj\u001b[38;5;241m.\u001b[39mreplace(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m'\u001b[39m,\u001b[38;5;250m \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m'\u001b[39m)\u001b[38;5;241m.\u001b[39mreplace(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m \u001b[39m\u001b[38;5;124m'\u001b[39m,\u001b[38;5;250m \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m'\u001b[39m)\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.stdout.log\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 10\u001b[0m STDERR \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpynx/\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mnsproj\u001b[38;5;241m.\u001b[39mreplace(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m'\u001b[39m,\u001b[38;5;250m \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m'\u001b[39m)\u001b[38;5;241m.\u001b[39mreplace(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m \u001b[39m\u001b[38;5;124m'\u001b[39m,\u001b[38;5;250m \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m'\u001b[39m)\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.stderr.log\u001b[39m\u001b[38;5;124m\"\u001b[39m \n\u001b[0;32m---> 11\u001b[0m \u001b[43mget_ipython\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msystem\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m dataconverter convert $INPUT --reader em --nxdl NXem --output=empty.nxs 1>$STDOUT 2>$STDERR\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/ipykernel/zmqshell.py:649\u001b[0m, in \u001b[0;36mZMQInteractiveShell.system_piped\u001b[0;34m(self, cmd)\u001b[0m\n\u001b[1;32m 647\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39muser_ns[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_exit_code\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m system(cmd)\n\u001b[1;32m 648\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 649\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39muser_ns[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_exit_code\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[43msystem\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mvar_expand\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcmd\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdepth\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/IPython/utils/_process_posix.py:164\u001b[0m, in \u001b[0;36mProcessHandler.system\u001b[0;34m(self, cmd)\u001b[0m\n\u001b[1;32m 159\u001b[0m out_size \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlen\u001b[39m(child\u001b[38;5;241m.\u001b[39mbefore)\n\u001b[1;32m 160\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyboardInterrupt\u001b[39;00m:\n\u001b[1;32m 161\u001b[0m \u001b[38;5;66;03m# We need to send ^C to the process. The ascii code for '^C' is 3\u001b[39;00m\n\u001b[1;32m 162\u001b[0m \u001b[38;5;66;03m# (the character is known as ETX for 'End of Text', see\u001b[39;00m\n\u001b[1;32m 163\u001b[0m \u001b[38;5;66;03m# curses.ascii.ETX).\u001b[39;00m\n\u001b[0;32m--> 164\u001b[0m \u001b[43mchild\u001b[49m\u001b[38;5;241m.\u001b[39msendline(\u001b[38;5;28mchr\u001b[39m(\u001b[38;5;241m3\u001b[39m))\n\u001b[1;32m 165\u001b[0m \u001b[38;5;66;03m# Read and print any more output the program might produce on its\u001b[39;00m\n\u001b[1;32m 166\u001b[0m \u001b[38;5;66;03m# way out.\u001b[39;00m\n\u001b[1;32m 167\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n", + "\u001b[0;31mUnboundLocalError\u001b[0m: local variable 'child' referenced before assignment" + ] + } + ], + "source": [ + "# execute from within top-level directory!\n", + "keys = []\n", + "for key in projects:\n", + " keys.append(key)\n", + "for key in sorted(keys):\n", + " nsproj = projects[key][\"nsproj\"]\n", + " INPUT = f\"{nsproj}\".replace(\" \", \"\\ \")\n", + " print(INPUT)\n", + " STDOUT = f\"pynx/{nsproj.replace('/', '_').replace(' ', '_')}.stdout.log\"\n", + " STDERR = f\"pynx/{nsproj.replace('/', '_').replace(' ', '_')}.stderr.log\" \n", + " ! dataconverter convert $INPUT --reader em --nxdl NXem --output=empty.nxs 1>$STDOUT 2>$STDERR" + ] + }, + { + "cell_type": "code", + "execution_count": 120, + "id": "1e22cca9-e38f-4576-94b2-fcec0c909014", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pynx/\n", + "pynx/work_data_AEljarrat_2020_AgNWs_Nion_Swift_Project_20200729.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20210923_p-type_c-Si.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_MoS2_HIOS_20201209_MoS2_TEM1.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20220208_PTI-LiBr_60kV.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20210927_PTI_LiBr_cold.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_ACQW_Capellini_20210126_sample_2224_1.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20210927_PTI_LiBr_cold.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20201203_batch_01_mixed_sizes.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_c-Si_20210304_c-Si_211_after_12_min_plasma_clean.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20210910_PTI42_LiBr.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_c-Si_20210303_c-Si_211_after_12min_plasma_clean.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_nanocones_Tuebingen_20210526_A3_200nm.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_MoS2_HIOS_MoS2_#1_no_EBL.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2022_UB_visit_20220628_S036_FIB_.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_MoS2_HIOS_20210225_MoS2_on_Au_face_down.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_AgNWs_Nion_Swift_Project_20200729.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_Au-NRs_Yuhang_20210812_Au-NRs_bare.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20211101_PTI_IF_aloof_RT.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_c-Si_20210224_c-Si_211.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_AuPd_Zdravko_20210202_AuPdTi.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_nanocones_Tuebingen_20210526_A6_Al_150nm_Data.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_STO_Amari_20211026_STO_session_2.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_ACQW_Capellini_20210126_sample_2224_1.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_TiO2_PBD_20211020_TiO2_01_session_02_60kV.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_TiO2_PBD_20211011_TiO2_01_session_01.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_CVN_Zdravko_20211112_CVN_onions.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_nanocones_Tuebingen_20210526_A5_100nm_Data.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20210423_Bare_AuNRs_Mixed_RT.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20210204_A1.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PlasmonicStars_Radwan_20211021_sample_01_60kV.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_ACQW_Capellini_20210316_ACQW_2217.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_c-Si_20200907_c-Si_211.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_LLZO_Yaolin_20211203_LLZO_undoped.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20210325_2nd_batch_C1.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_Au-NRs_Yuhang_20210813_Au-NRs_and_Pd_and_PDA.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20201203_batch_01_mixed_sizes.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_PlasmonicStars_Radwan_20211021_sample_01_60kV.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_Fe3N_C_20201126_LaceyC_01_2nd_Observation.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_c-Si_20200928_c-Si_60kV.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20220223_PTI_IF_60kV_RT.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_Fe3N_C_20201120_LaceyC_01.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_Au-NRs_Yuhang_20210812_Au-NRs_bare.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20210917_PTI_17.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20210910_PTI42_LiBr.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_CIGSe_PVComB_CIGSe_PVcomB.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2022_FeO_Lavorato_20220503_Cu23_OA_aC-clean.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_CIGSe_PVComB_CIGSe_PVcomB.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20210401_2nd_batch_B1_Data.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_MoS2_HIOS_20201102_MoS2_HIOS#2_EBL_KGreben_.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_AgNWs+AuNSs_Nion_Swift_Project_20200825.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_Au-NRs_Yuhang_20210826_EEGS_Pd-Au_NR.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20210212_Mixed_TDBC_cool_holder.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20220208_PTI-LiBr_60kV.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_Fe3N_C_20201126_LaceyC_01_2nd_Observation.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20201202_batch_01_mixed_sizes.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_Au-NRs_Yuhang_20210813_Au-NRs_and_Pd_and_PDA.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_BaSnO3_IKZ_20210506_BSO_PV.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_Fe3N_C_20201120_LaceyC_01.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_MoS2_HIOS_MoS2_20201106_2nd_Biatch.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_VNAND_2_20201023_VNAND_more_good_Data_Nion_Swift_Project_20201023.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_MoS2_HIOS_MoS2_#1_no_EBL.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2022_UB_visit_20220629_SO35_dry.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_TiO2_PBD_20211020_TiO2_01_session_02_60kV.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_c-Si_20210224_c-Si_211.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_STO_Amari_20201109_AB_STO_86_Amari_1.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20210204_A1.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_CVN_Zdravko_20211112_CVN_onions.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_AuPd_Zdravko_20210202_AuPd.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_BaSnO3_IKZ_20201208_PV01.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_STO_Amari_20211026_STO_session_2.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20210928_PTI_NI_cold.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_VNAND_2_20201023_VNAND_more_good_Data_Nion_Swift_Project_20201023.nsproj.stderr.log\n", + "pynx/.ipynb_checkpoints/\n", + "pynx/.ipynb_checkpoints/work_data_AEljarrat_2020_AgNWs_20200619.nsproj.stderr-checkpoint.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20210923_p-type_c-Si.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_AgNWs_20200630_Data.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_ACQW_Capellini_20210316_ACQW_2217.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_Au-NRs_Yuhang_20210826_EEGS_Pd-Au_NR.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20211022_PTI_LiBr_60kV_RT.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_BaSnO3_IKZ_20211202_BSO-PV-2_RT.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_nanocones_Tuebingen_20210526_A6_Al_150nm_Data.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20210917_PTI_17.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_AgNWs_20200619.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_Au-NRs_Yuhang_20210812_Au-NRs_and_Pd.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_BaSnO3_IKZ_20211202_BSO-PV-2_RT.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20220223_PTI_IF_60kV_RT.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_Au-NRs_Yuhang_20210812_Au-NRs_and_Pd.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_TiO2_PBD_20211011_TiO2_01_session_01.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_BaSnO3_IKZ_20201208_PV01.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2022_FeO_Lavorato_20220503_Cu23_OA_aC-clean.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2022_BTO_cooling_20220317_BTO_pillars_cooling_holder.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_Hongguang_New_folder_20220615_HZO_3nm_01.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20210325_2nd_batch_C1.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_ACQW_Capellini_20210312_ACQW_2217.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_nanocones_Tuebingen_20210526_A4_150nm.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_VNAND_2_20201009_VNAND_good.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_MoS2_HIOS_20201209_MoS2_TEM1.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_nanocones_Tuebingen_20210526_A5_100nm_Data.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_STO_Amari_20201109_AB_STO_86_Amari_1.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20211022_PTI_LiBr_60kV_RT.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_BaSnO3_IKZ_20210127_PV01_-_after_plasma_clean.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_c-Si_20210304_c-Si_211_after_12_min_plasma_clean.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_c-Si_20210303_c-Si_211_after_12min_plasma_clean.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2022_BTO_cooling_20220317_BTO_pillars_cooling_holder.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_CVN_Zdravko_20210430_CVN_Onion.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_CVN_Zdravko_20210430_CVN_Onion.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2022_UB_visit_20220628_S036_FIB_.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20201202_batch_01_mixed_sizes.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20210401_2nd_batch_B1_Data.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_AgNWs_20200619.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_AgNWs+AuNSs_Nion_Swift_Project_20200825.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_MoS2_HIOS_20210225_MoS2_on_Au_face_down.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_ACQW_Capellini_20210312_ACQW_2217.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_VNAND_2_20201009_VNAND_good.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20211101_PTI_IF_aloof_RT.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20210212_Mixed_TDBC_cool_holder.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2022_UB_visit_20220629_SO35_dry.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_AuPd_Zdravko_20210202_AuPd.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_BaSnO3_IKZ_20210506_BSO_PV.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2022_FeO_Lavorato_20220503_Cu23_OA.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_AgNWs_20200630_Data.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_Hongguang_New_folder_20220615_HZO_3nm_01.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_nanocones_Tuebingen_20210526_A3_200nm.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_MoS2_HIOS_MoS2_20201106_2nd_Biatch.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2020_MoS2_HIOS_20201102_MoS2_HIOS#2_EBL_KGreben_.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2022_FeO_Lavorato_20220503_Cu23_OA.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2021_nanocones_Tuebingen_20210526_A4_150nm.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_LLZO_Yaolin_20211203_LLZO_undoped.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_AuPd_Zdravko_20210202_AuPdTi.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_BaSnO3_IKZ_20210127_PV01_-_after_plasma_clean.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_Au-NRs_TDBC_20210423_Bare_AuNRs_Mixed_RT.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_c-Si_20200928_c-Si_60kV.nsproj.stderr.log\n", + "pynx/work_data_AEljarrat_2020_c-Si_20200907_c-Si_211.nsproj.stdout.log\n", + "pynx/work_data_AEljarrat_2021_PTI_Burmeister_20210928_PTI_NI_cold.nsproj.stderr.log\n" + ] + } + ], + "source": [ + "! tar -zcvf AEljarrrat.tar.gz pynx/" + ] + }, + { + "cell_type": "code", + "execution_count": 122, + "id": "78782b8a-a443-41b4-8a61-696979559d1e", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.06412422381863848\n" + ] + } + ], + "source": [ + "part = 0\n", + "total = 0\n", + "for key, dct in projects.items():\n", + " total += dct[\"dir_size\"]\n", + " if key.startswith(\"work/data/AEljarrat\"):\n", + " part += dct[\"dir_size\"] \n", + "print(part / total)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "deb70f7c-04b0-475f-828d-1bd5ac47bfc8", + "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.10.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}