Skip to content

Commit

Permalink
Merge pull request #2 from eds-book-gallery/postprint
Browse files Browse the repository at this point in the history
Postprint - versioning
  • Loading branch information
acocac authored Sep 1, 2023
2 parents af9a9bf + 6a42cbc commit 260a4f4
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 16 deletions.
12 changes: 12 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[bumpversion]
current_version = v1.0.0
commit = True
tag = True
parse = (v(?P<major>\d+))(.(?P<minor>\d+))(.(?P<patch>\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"
2 changes: 1 addition & 1 deletion .github/workflows/binder.yaml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -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'
1 change: 1 addition & 0 deletions .github/workflows/render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: render
on:
workflow_run:
workflows: ["Build and push container image"]
branches: main
types:
- completed

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test container image build
name: Test container image build

on:
pull_request:
Expand Down
22 changes: 22 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -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
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
<a href="https://github.com/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/blob/main/LICENSE">
<img alt="license" src="https://img.shields.io/badge/license-MIT-yellow.svg">
</a>
<a href="https://notebooks.gesis.org/binder/v2/gh/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/main?labpath=notebook.ipynb">
<img alt="binder" src="https://mybinder.org/badge_logo.svg">
</a>
<a href="https://github.com/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/actions/workflows/render.yaml">
<img alt="render" src="https://github.com/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/actions/workflows/render.yaml/badge.svg">
</a>
Expand All @@ -26,13 +23,20 @@
<br/>
</p>

<p align="left">
<a href="http://mybinder.org/v2/gh/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/main?labpath=notebook.ipynb">
<img alt="binder" src="https://mybinder.org/badge_logo.svg">
</a>
<a href="https://replay.notebooks.egi.eu/v2/gh/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/main?labpath=notebook.ipynb">
<img alt="binder" src="https://img.shields.io/badge/launch-EGI%20binder-F5A252.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJX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NKaQJdScAAAAAElFTkSuQmCC">
</a>
<br/>
</p>

<p align="center">
<a href="https://w3id.org/ro-id/15d986da-2d7c-44fb-af71-700494485def">
<img alt="RoHub" src="https://img.shields.io/badge/RoHub-FAIR_Executable_Research_Object-2ea44f?logo=Open+Access&logoColor=blue">
</a>
<a href="https://doi.org/10.24424/td9g-0533">
<img alt="doi" src="https://zenodo.org/badge/DOI/10.24424/td9g-0533.svg">
</a>
</p>

<p align="center">
Expand Down
20 changes: 13 additions & 7 deletions notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
" <a href=\"https://github.com/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/blob/main/LICENSE\">\n",
" <img alt=\"license\" src=\"https://img.shields.io/badge/license-MIT-yellow.svg\">\n",
" </a>\n",
" <a href=\"https://notebooks.gesis.org/binder/v2/gh/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/main?labpath=notebook.ipynb\">\n",
" <img alt=\"binder\" src=\"https://mybinder.org/badge_logo.svg\">\n",
" </a>\n",
" <a href=\"https://github.com/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/actions/workflows/render.yaml\">\n",
" <img alt=\"render\" src=\"https://github.com/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/actions/workflows/render.yaml/badge.svg\">\n",
" </a>\n",
Expand All @@ -29,12 +26,19 @@
"</p>\n",
"\n",
"<p align=\"left\">\n",
" <a href=\"http://mybinder.org/v2/gh/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/main?labpath=notebook.ipynb\">\n",
" <img alt=\"binder\" src=\"https://mybinder.org/badge_logo.svg\">\n",
" </a>\n",
" <a href=\"https://replay.notebooks.egi.eu/v2/gh/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/main?labpath=notebook.ipynb\">\n",
" <img alt=\"binder\" src=\"https://img.shields.io/badge/launch-EGI%20binder-F5A252.svg?logo=data:image/png;base64,iVBORw0KGgoAAAAN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RpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC\">\n",
" </a>\n",
" <br/>\n",
"</p>\n",
"\n",
"<p align=\"left\">\n",
" <a href=\"https://w3id.org/ro-id/15d986da-2d7c-44fb-af71-700494485def\">\n",
" <img alt=\"RoHub\" src=\"https://img.shields.io/badge/RoHub-FAIR_Executable_Research_Object-2ea44f?logo=Open+Access&logoColor=blue\">\n",
" </a>\n",
" <a href=\"https://doi.org/10.24424/td9g-0533\">\n",
" <img alt=\"doi\" src=\"https://zenodo.org/badge/DOI/10.24424/td9g-0533.svg\">\n",
" </a>\n",
"</p>\n"
]
},
Expand Down Expand Up @@ -598,7 +602,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))."
]
},
{
Expand All @@ -618,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()}')"
]
},
Expand Down

0 comments on commit 260a4f4

Please # to comment.