{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import json" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "nbs = !find ../ -mindepth 2 -name \"*.ipynb\" ! -name \"*checkpoint.ipynb\" -type f " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for nb in nbs:\n", " #!jupyter nbconvert --clear-output --inplace {nb}\n", " !jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace {nb} \n", " with open(nb, 'r') as jsonFile:\n", " nbdata=json.load(jsonFile)\n", " nbdata[\"metadata\"][\"kernelspec\"][\"name\"]=\"dkrzcatalog\"\n", " nbdata[\"metadata\"][\"kernelspec\"][\"display_name\"]=\"dkrzcatalog\"\n", " with open(nb, 'w') as jsonFile:\n", " json.dump(nbdata, jsonFile, indent=1, ensure_ascii=False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "dkrzcatalog", "language": "python", "name": "dkrzcatalog" }, "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.7.12" } }, "nbformat": 4, "nbformat_minor": 4 }