Ver Fonte

実験の作成

ivis-mizuguchi há 2 anos atrás
pai
commit
958342e792

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "experiments/sub2"]
+	path = experiments/sub2
+	url = https://gin.g-node.org/rino/sub2.git

+ 201 - 10
WORKFLOW/SECTIONS/base/02_experimental_phase/launch_an_experiment.ipynb

@@ -40,18 +40,35 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 1,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "sub2\n"
+     ]
+    }
+   ],
    "source": [
     "repository_title = input()"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 2,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "/home/jovyan\n",
+      "https://gin.g-node.org/rino/sub1.git\n"
+     ]
+    }
+   ],
    "source": [
     "%cd ~/\n",
     "tmp = !git remote -v\n",
@@ -64,6 +81,25 @@
     "print(ssh_url)"
    ]
   },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "https://gin.g-node.org/rino/sub2.git\n"
+     ]
+    }
+   ],
+   "source": [
+    "################################\n",
+    "ssh_url = \"https://gin.g-node.org/rino/sub2.git\"\n",
+    "print(ssh_url)"
+   ]
+  },
   {
    "cell_type": "markdown",
    "metadata": {},
@@ -73,9 +109,37 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 4,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "\u001b[33mhint: Using 'master' as the name for the initial branch. This default branch name\u001b[m\n",
+      "\u001b[33mhint: is subject to change. To configure the initial branch name to use in all\u001b[m\n",
+      "\u001b[33mhint: of your new repositories, which will suppress this warning, call:\u001b[m\n",
+      "\u001b[33mhint: \u001b[m\n",
+      "\u001b[33mhint: \tgit config --global init.defaultBranch <name>\u001b[m\n",
+      "\u001b[33mhint: \u001b[m\n",
+      "\u001b[33mhint: Names commonly chosen instead of 'master' are 'main', 'trunk' and\u001b[m\n",
+      "\u001b[33mhint: 'development'. The just-created branch can be renamed via this command:\u001b[m\n",
+      "\u001b[33mhint: \u001b[m\n",
+      "\u001b[33mhint: \tgit branch -m <name>\u001b[m\n",
+      "Initialized empty Git repository in /home/jovyan/.tmp/sub1/.git/\n",
+      "cp: cannot stat '/home/jovyan/WORKFLOW/PACKAGE/.': No such file or directory\n",
+      "/home/jovyan/.tmp/sub1\n",
+      "On branch master\n",
+      "\n",
+      "Initial commit\n",
+      "\n",
+      "nothing to commit (create/copy files and use \"git add\" to track)\n",
+      "error: src refspec master does not match any\n",
+      "\u001b[31merror: failed to push some refs to 'https://gin.g-node.org/rino/sub1.git'\n",
+      "\u001b[m"
+     ]
+    }
+   ],
    "source": [
     "!mkdir ~/.tmp/\n",
     "!git init ~/.tmp/$repository_title\n",
@@ -91,6 +155,119 @@
     "# !datalad push"
    ]
   },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Reinitialized existing Git repository in /home/jovyan/.tmp/sub1/.git/\n",
+      "/home/jovyan/.tmp/sub1\n",
+      "[master (root-commit) 8ebcdb3] 1st commit\n",
+      " 12 files changed, 587 insertions(+)\n",
+      " create mode 100644 .gitconfig\n",
+      " create mode 100644 .gitignore\n",
+      " create mode 100644 SECTIONS/enter_metadata.ipynb\n",
+      " create mode 100644 SECTIONS/finish.ipynb\n",
+      " create mode 100644 SECTIONS/save.ipynb\n",
+      " create mode 100644 SECTIONS/util/datalad_save_push.ipynb\n",
+      " create mode 100644 SECTIONS/util/prepare_for_workflow_every_time.ipynb\n",
+      " create mode 100644 experiment.ipynb\n",
+      " create mode 100644 input_data/.gitkeep\n",
+      " create mode 100644 meta_data.json\n",
+      " create mode 100644 output_data/.gitkeep\n",
+      " create mode 100644 source/main.ipynb\n",
+      "error: remote sub1 already exists.\n",
+      "Enumerating objects: 18, done.\n",
+      "Counting objects: 100% (18/18), done.\n",
+      "Delta compression using up to 72 threads\n",
+      "Compressing objects: 100% (13/13), done.\n",
+      "Writing objects: 100% (18/18), 4.33 KiB | 2.17 MiB/s, done.\n",
+      "Total 18 (delta 5), reused 0 (delta 0), pack-reused 0\n",
+      "To https://gin.g-node.org/rino/sub1.git\n",
+      " * [new branch]      master -> master\n"
+     ]
+    }
+   ],
+   "source": [
+    "\n",
+    "!git init ~/.tmp/sub1\n",
+    "\n",
+    "!cp -r ~/PACKAGE/. ~/.tmp/sub1/\n",
+    "\n",
+    "%cd ~/.tmp/sub1\n",
+    "!git add ~/.tmp/sub1\n",
+    "!git commit -m '1st commit'\n",
+    "!git remote add sub1 $ssh_url\n",
+    "!git push sub1 master\n",
+    "# !datalad save --to-git -m \"1st commit\"\n",
+    "# !datalad push"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "\u001b[33mhint: Using 'master' as the name for the initial branch. This default branch name\u001b[m\n",
+      "\u001b[33mhint: is subject to change. To configure the initial branch name to use in all\u001b[m\n",
+      "\u001b[33mhint: of your new repositories, which will suppress this warning, call:\u001b[m\n",
+      "\u001b[33mhint: \u001b[m\n",
+      "\u001b[33mhint: \tgit config --global init.defaultBranch <name>\u001b[m\n",
+      "\u001b[33mhint: \u001b[m\n",
+      "\u001b[33mhint: Names commonly chosen instead of 'master' are 'main', 'trunk' and\u001b[m\n",
+      "\u001b[33mhint: 'development'. The just-created branch can be renamed via this command:\u001b[m\n",
+      "\u001b[33mhint: \u001b[m\n",
+      "\u001b[33mhint: \tgit branch -m <name>\u001b[m\n",
+      "Initialized empty Git repository in /home/jovyan/.tmp/sub2/.git/\n",
+      "/home/jovyan/.tmp/sub2\n",
+      "[master (root-commit) 2186659] 1st commit\n",
+      " 12 files changed, 587 insertions(+)\n",
+      " create mode 100644 .gitconfig\n",
+      " create mode 100644 .gitignore\n",
+      " create mode 100644 SECTIONS/enter_metadata.ipynb\n",
+      " create mode 100644 SECTIONS/finish.ipynb\n",
+      " create mode 100644 SECTIONS/save.ipynb\n",
+      " create mode 100644 SECTIONS/util/datalad_save_push.ipynb\n",
+      " create mode 100644 SECTIONS/util/prepare_for_workflow_every_time.ipynb\n",
+      " create mode 100644 experiment.ipynb\n",
+      " create mode 100644 input_data/.gitkeep\n",
+      " create mode 100644 meta_data.json\n",
+      " create mode 100644 output_data/.gitkeep\n",
+      " create mode 100644 source/main.ipynb\n",
+      "Enumerating objects: 18, done.\n",
+      "Counting objects: 100% (18/18), done.\n",
+      "Delta compression using up to 72 threads\n",
+      "Compressing objects: 100% (13/13), done.\n",
+      "Writing objects: 100% (18/18), 4.33 KiB | 2.17 MiB/s, done.\n",
+      "Total 18 (delta 5), reused 0 (delta 0), pack-reused 0\n",
+      "To https://gin.g-node.org/rino/sub2.git\n",
+      " * [new branch]      master -> master\n"
+     ]
+    }
+   ],
+   "source": [
+    "\n",
+    "!git init ~/.tmp/$repository_title\n",
+    "# !datalad create ~/.tmp/$repository_title\n",
+    "!cp -r ~/PACKAGE/. ~/.tmp/$repository_title/\n",
+    "\n",
+    "%cd ~/.tmp/$repository_title\n",
+    "!git add ~/.tmp/$repository_title\n",
+    "!git commit -m '1st commit'\n",
+    "!git remote add $repository_title $ssh_url\n",
+    "!git push $repository_title master\n",
+    "# !datalad save --to-git -m \"1st commit\"\n",
+    "# !datalad push"
+   ]
+  },
   {
    "cell_type": "markdown",
    "metadata": {},
@@ -100,9 +277,23 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 4,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "/home/jovyan\n",
+      "Cloning into '/home/jovyan/experiments/sub2'...\n",
+      "remote: Enumerating objects: 18, done.\u001b[K                                               \u001b[K\n",
+      "remote: Counting objects: 100% (18/18), done.\u001b[K                                        \u001b[K\n",
+      "remote: Compressing objects: 100% (13/13), done.\u001b[K                                     \u001b[K\n",
+      "remote: Total 18 (delta 5), reused 0 (delta 0)\u001b[K\n",
+      "Unpacking objects: 100% (18/18), 4.31 KiB | 55.00 KiB/s, done.\n"
+     ]
+    }
+   ],
    "source": [
     "%cd ~/\n",
     "!git submodule add $ssh_url ./experiments/$repository_title"
@@ -117,7 +308,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 5,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -192,7 +383,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.8.12"
+   "version": "3.7.8"
   }
  },
  "nbformat": 4,

+ 3 - 1
experiments/pipeline.json

@@ -1 +1,3 @@
-[]
+[
+    "sub2"
+]

+ 1 - 0
experiments/sub2

@@ -0,0 +1 @@
+Subproject commit 218665994452dd09b1473910d54d939bee300c7b