{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 実験メタデータを入力する\n", "\n", "これは、実験日や実験者などのメタデータを入力するためのノートブックです。" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. メタデータを入力する" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1. 以下のセルを実行して、実験日を入力してください。" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "experiment_date = input()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "2. 以下のセルを実行して、実験者を入力してください。" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "experimenter = input()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. meta_data.jsonに書き込む" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import json\n", "from collections import OrderedDict\n", "\n", "meta_data = {\n", " \"experiment_date\": experiment_date,\n", " \"experimenter\": experimenter\n", "}\n", "with open('../meta_data.json', 'w') as jf:\n", " json.dump(meta_data, jf, ensure_ascii=False, indent=2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. 変更内容を書き戻す" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%cd ~/\n", "!git add ~/\n", "!git commit -m 'メタデータ入力'\n", "\n", "# import papermill as pm\n", "# \n", "# pm.execute_notebook(\n", "# './util/datalad_save_push.ipynb',\n", "# '-',\n", "# parameters = dict(SAVE_MESSAGE = 'メタデータ入力', PATH = '/home/jovyan/meta_data.json')\n", "# )" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.8.12" } }, "nbformat": 4, "nbformat_minor": 4 }