فهرست منبع

'maDMP.ipynb' を追加

rino mizuguchi 2 سال پیش
والد
کامیت
64e293fba1
1فایلهای تغییر یافته به همراه89 افزوده شده و 0 حذف شده
  1. 89 0
      maDMP.ipynb

+ 89 - 0
maDMP.ipynb

@@ -0,0 +1,89 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# ようこそ\n",
+    "\n",
+    "maDMPへようこそ。ここでは、DMPに入力いただいた研究分野等情報に基づき、ワークフローを最適化します。  \n",
+    "以下のセルを実行することで、ワークフローを生成します。"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "scrolled": true
+   },
+   "outputs": [],
+   "source": [
+    "# DMP情報\n",
+    "field = 'basic'"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "scrolled": true
+   },
+   "outputs": [],
+   "source": [
+    "%sh\n",
+    "# ワークフローテンプレート取得\n",
+    "# 検証のため、参照先をivis-mizuguchi/workflow-templateの\n",
+    "# develop/workflow-templateブランチに変更中\n",
+    "# git clone https://github.com/ivis-kuwata/workflow-template.git /home/jovyan/WORKFLOW\n",
+    "git clone -b develop/workflow-template https://github.com/ivis-mizuguchi/workflow-template.git /home/jovyan/WORKFLOW\n",
+    "rm -rf /home/jovyan/WORKFLOW/.git"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "scrolled": true
+   },
+   "outputs": [],
+   "source": [
+    "# dmp.jsonに\"fields\"プロパティがある想定\n",
+    "import os\n",
+    "import glob\n",
+    "import shutil\n",
+    "\n",
+    "path_flows = os.path.join('WORKFLOW', 'FLOW')\n",
+    "\n",
+    "templates = glob.glob(os.path.join(path_flows, '**'), recursive=True)\n",
+    "\n",
+    "# 選択外の分野のセクション群を削除\n",
+    "for tmpl in templates:\n",
+    "    file = os.path.basename(tmpl)\n",
+    "    if not os.path.isdir(tmpl) and os.path.splitext(file)[1] == '.ipynb':\n",
+    "        if 'base_' not in file and field not in file:\n",
+    "            os.remove(tmpl)"
+   ]
+  }
+ ],
+ "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.7.10"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}