{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 研究用のフォルダ構成を初期化する\n", "\n", "これはDMP情報に基づき、研究用のフォルダ構成を初期化するためのノートブックです" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. DMP情報からプロジェクト名を取得する" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - ## データガバナンス機能にDMP情報がある場合は以下を実行して2. に進む" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The Project\n" ] } ], "source": [ "import sys\n", "import os\n", "\n", "sys.path.append(os.path.abspath(\"../util\"))\n", "\n", "import load\n", "\n", "dmp = load.get_dmp()\n", "project_name = dmp['project']['title']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- ## システム外にDMP情報がある場合は以下を実行して2. に進む" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "DMP_PATHにjson形式のDMPファイルのパスを入力する" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "DMP_PATH = \"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import sys\n", "import os\n", "\n", "sys.path.append(os.path.abspath(\"../util\"))\n", "\n", "import load\n", "\n", "dmp = load.get_dmp_from_outsystem(DMP_PATH)\n", "project_name = dmp['project']['title']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. 取得したプロジェクト名で研究用のフォルダ構成を初期化する" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "experiment_folder_pass = \"/home/jovyan/\" + project_name\n", "os.makedirs(experiment_folder_pass)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. 変更内容を書き戻す" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%sh\n", "papermill ../util/datalad_save_push.ipynb - -f ../../params.yaml -p SAVE_MESSAGE = '研究用のフォルダ構成を初期化'" ] } ], "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.7.8" } }, "nbformat": 4, "nbformat_minor": 4 }