From e4d2b16c69141d01ed092b474ef0c9179b806a4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C2=A9?=
Date: Fri, 1 Sep 2023 16:38:36 +0100
Subject: [PATCH 1/9] replace how to cite
---
notebook.ipynb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/notebook.ipynb b/notebook.ipynb
index fbd9ca8..21cde47 100644
--- a/notebook.ipynb
+++ b/notebook.ipynb
@@ -598,7 +598,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "Alejandro Coca-Castro, and Matt Allen. \"Tree crown detection using DeepForest (Jupyter Notebook) published in the Environmental Data Science book.\" ROHub. Feb 20 ,2022. https://doi.org/10.24424/td9g-0533."
+ "Please see [CITATION.cff](https://github.com/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/blob/main/CITATION.cff) for the full citation information. The citation file can be exported to APA or BibTex formats (learn more [here](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files))."
]
},
{
From 4924402b746a9cb2bb1eb6971d96eb01e4a41067 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C2=A9?=
Date: Fri, 1 Sep 2023 16:39:30 +0100
Subject: [PATCH 2/9] remove GESIS binder
---
README.md | 3 ---
notebook.ipynb | 3 ---
2 files changed, 6 deletions(-)
diff --git a/README.md b/README.md
index 9de6d4a..574a729 100644
--- a/README.md
+++ b/README.md
@@ -14,9 +14,6 @@
-
-
-
diff --git a/notebook.ipynb b/notebook.ipynb
index 21cde47..ad8ff29 100644
--- a/notebook.ipynb
+++ b/notebook.ipynb
@@ -16,9 +16,6 @@
" \n",
" \n",
" \n",
- " \n",
- " \n",
- " \n",
" \n",
" \n",
" \n",
From 08d5e2bd2f3114465f76915e14e9b6aaaa34632b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C2=A9?=
Date: Fri, 1 Sep 2023 16:40:25 +0100
Subject: [PATCH 3/9] add binderhub line
---
README.md | 10 ++++++++++
notebook.ipynb | 10 ++++++++++
2 files changed, 20 insertions(+)
diff --git a/README.md b/README.md
index 574a729..14d40b8 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/notebook.ipynb b/notebook.ipynb
index ad8ff29..6291dff 100644
--- a/notebook.ipynb
+++ b/notebook.ipynb
@@ -26,6 +26,16 @@
"
\n",
"\n",
"\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ "
\n",
+ "\n",
+ "\n",
" \n",
" \n",
" \n",
From a90dac14fdd24bb8d321513d4d52f1aa503063ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C2=A9?=
Date: Fri, 1 Sep 2023 16:41:05 +0100
Subject: [PATCH 4/9] remove old zenodo badge
---
README.md | 3 ---
notebook.ipynb | 3 ---
2 files changed, 6 deletions(-)
diff --git a/README.md b/README.md
index 14d40b8..7723d79 100644
--- a/README.md
+++ b/README.md
@@ -37,9 +37,6 @@
-
-
-
diff --git a/notebook.ipynb b/notebook.ipynb
index 6291dff..253580a 100644
--- a/notebook.ipynb
+++ b/notebook.ipynb
@@ -39,9 +39,6 @@
" \n",
" \n",
" \n",
- " \n",
- " \n",
- " \n",
"
\n"
]
},
From fb1b3085dddfa5121d8b2427520fd0d99277685d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C2=A9?=
Date: Fri, 1 Sep 2023 16:41:54 +0100
Subject: [PATCH 5/9] set bumpversion
---
.bumpversion.cfg | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 .bumpversion.cfg
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
new file mode 100644
index 0000000..3dd6671
--- /dev/null
+++ b/.bumpversion.cfg
@@ -0,0 +1,12 @@
+[bumpversion]
+current_version = v1.0.0
+commit = True
+tag = True
+parse = (v(?P\d+))(.(?P\d+))(.(?P\d+))
+serialize = v{major}.{minor}.{patch}
+
+[bumpversion:file:CITATION.cff]
+
+[bumpversion:file:notebook.ipynb]
+search = "print('Notebook repository version: {current_version}')\n"
+replace = "print('Notebook repository version: {new_version}')\n"
From b596073b77ba8483a8e7c8b7b66df0fc8fcc82ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C2=A9?=
Date: Fri, 1 Sep 2023 16:42:04 +0100
Subject: [PATCH 6/9] update workflows
---
.github/workflows/binder.yaml | 2 +-
.github/workflows/build.yaml | 3 ++-
.github/workflows/render.yaml | 1 +
.github/workflows/test.yaml | 2 +-
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/binder.yaml b/.github/workflows/binder.yaml
index 0de1a9c..d5571b3 100644
--- a/.github/workflows/binder.yaml
+++ b/.github/workflows/binder.yaml
@@ -1,5 +1,5 @@
# Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html
-name: test this PR on Binder Badge
+name: Test this PR on Binder Badge
on:
pull_request_target:
types: [opened]
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index d6b8b57..8b49ac5 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -1,9 +1,10 @@
-name: build and push container image
+name: Build and push container image
on:
push:
branches:
- main
+ - postprint
jobs:
build-and-push:
diff --git a/.github/workflows/render.yaml b/.github/workflows/render.yaml
index 6b32279..81e0dfd 100644
--- a/.github/workflows/render.yaml
+++ b/.github/workflows/render.yaml
@@ -3,6 +3,7 @@ name: render
on:
workflow_run:
workflows: ["Build and push container image"]
+ branches: main
types:
- completed
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index c1e29dd..69140db 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -1,4 +1,4 @@
-name: test container image build
+name: Test container image build
on:
pull_request:
From cf302ffe95b9c5412344b51488fa5c127c71cad4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C2=A9?=
Date: Fri, 1 Sep 2023 16:42:13 +0100
Subject: [PATCH 7/9] add preview workflow
---
.github/workflows/preview.yaml | 74 ++++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 .github/workflows/preview.yaml
diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml
new file mode 100644
index 0000000..5654d1a
--- /dev/null
+++ b/.github/workflows/preview.yaml
@@ -0,0 +1,74 @@
+name: Preview
+
+on:
+ workflow_run:
+ workflows: ["Build and push container image"]
+ branches: [postprint]
+ types: [completed]
+
+# This job installs dependencies, build the jupyter notebook, and pushes it to `preview`, a new `branch`
+jobs:
+ on-success:
+ runs-on: ubuntu-latest
+ if: ${{ github.repository_owner == 'eds-book-gallery' && github.event.workflow_run.conclusion == 'success' }}
+ defaults:
+ run:
+ shell: bash -l {0}
+ steps:
+ - name: Check conditions meet
+ run: echo 'The triggering workflow passed'
+ - uses: actions/checkout@v2
+ with:
+ ref: postprint
+ # Set notebook name
+ - name: Get properties from the config file
+ id: config_file
+ uses: notiz-dev/github-action-json-property@release
+ with:
+ path: '.github/config.json'
+ prop_path: 'notebook_name'
+ # Set quay image
+ - name: Get properties from the config file
+ id: config_quay
+ uses: notiz-dev/github-action-json-property@release
+ with:
+ path: '.github/config.json'
+ prop_path: 'quay_image'
+ # Set kernel name
+ - name: Get properties from the config file
+ id: config_kernel
+ uses: notiz-dev/github-action-json-property@release
+ with:
+ path: '.github/config.json'
+ prop_path: 'kernel'
+ # Render the notebook
+ - name: Run the build process with Docker
+ uses: addnab/docker-run-action@v3
+ with:
+ image: quay.io/${{steps.config_quay.outputs.prop}}:latest
+ options: --user root -v ${{ github.workspace }}:/tmp
+ shell: bash
+ run: |
+ v=$(jupyter kernelspec list | awk '{print $1}' | egrep ${{steps.config_kernel.outputs.prop}})
+ jupyter-nbconvert --to notebook --ExecutePreprocessor.kernel_name="$v" --inplace --execute ${{steps.config_file.outputs.prop}}
+ cp ${{steps.config_file.outputs.prop}} /tmp
+ - name: Commit
+ run: |
+ ls
+ git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git config --local user.name "github-actions[bot]"
+ git rm \* ':!${{steps.config_file.outputs.prop}}'
+ git add ${{steps.config_file.outputs.prop}}
+ git commit -m 'update'
+ - name: Push
+ uses: ad-m/github-push-action@master
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ branch: preview
+ force: true
+ on-failure:
+ runs-on: ubuntu-latest
+ if: ${{ github.repository_owner == 'eds-book-gallery' && github.event.workflow_run.conclusion == 'failure' }}
+ steps:
+ - name: Check conditions meet
+ run: echo 'The triggering workflow failed'
\ No newline at end of file
From 7ad9b6c81a3856fa1fac4e570c688b7e4fe5ac8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C2=A9?=
Date: Fri, 1 Sep 2023 16:44:34 +0100
Subject: [PATCH 8/9] add citation
---
CITATION.cff | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 CITATION.cff
diff --git a/CITATION.cff b/CITATION.cff
new file mode 100644
index 0000000..15738da
--- /dev/null
+++ b/CITATION.cff
@@ -0,0 +1,22 @@
+cff-version: 1.2.0
+title: "Tree crown detection using DeepForest"
+message: "If you use this software, please cite it using the metadata from this file."
+type: software
+authors:
+ - family-names: Coca-Castro
+ given-names: Alejandro
+ website: https://github.com/acocac
+ affiliation: The Alan Turing Institute
+ - name: "This EDS book notebook contributors"
+ website: "https://github.com/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/graphs/contributors"
+version: v1.0.0 # This is automatically set using the bumpversion tool.
+identifiers:
+ - type: doi
+ value: TBA
+ description: The concept DOI for the collection containing all versions of the notebook.
+abstract: "Notebook developed to demonstrate how to detect tree crown using a state-of-art Deep Learning model for object detection."
+keywords:
+ - Environmental Data Science
+ - Forest
+ - Modelling
+ - Deep learning
\ No newline at end of file
From 6a42cbca8af8cb087ef93a8e3d90c98a83c00d39 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C2=A9?=
Date: Fri, 1 Sep 2023 16:45:52 +0100
Subject: [PATCH 9/9] add notebook repository version
---
notebook.ipynb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/notebook.ipynb b/notebook.ipynb
index 253580a..8744e41 100644
--- a/notebook.ipynb
+++ b/notebook.ipynb
@@ -622,6 +622,8 @@
"outputs": [],
"source": [
"from datetime import date\n",
+ "\n",
+ "print('Notebook repository version: v1.0.0')\n",
"print(f'Last tested: {date.today()}')"
]
},