From e551f09ac3bf611e9efc8c4e82569f0c07a1b5ff Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Tue, 3 Dec 2024 15:16:59 +0100 Subject: [PATCH 1/2] Add conda CI and local use instructions, add buttons for colab/binder in quickstart --- .github/workflows/notebooks.yml | 30 +++++++++++++++++-- docs/index.md | 52 +++++++++++++++++++++++++++------ environment.yml | 8 +++++ mkdocs.yml | 2 ++ 4 files changed, 80 insertions(+), 12 deletions(-) create mode 100644 environment.yml diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index 6ffc684..a07c909 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -7,15 +7,39 @@ on: branches: - main jobs: - deploy: - runs-on: ubuntu-latest + pypi: + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest"] + python-version: ["3.12", "3.13"] + runs-on: ${{ matrix.os }} + name: "${{ matrix.os }} :: pypi :: ${{ matrix.python-version }}" steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: ${{ matrix.python-version }} - run : | pip install uv uv pip install --system -r requirements.txt - run: | jupyter execute notebooks/example.ipynb + conda-forge: + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest"] + runs-on: ${{ matrix.os }} + name: "${{ matrix.os }} :: conda-forge" + timeout-minutes: 15 + defaults: + run: + shell: bash -leo pipefail {0} + steps: + - uses: actions/checkout@v4 + - uses: mamba-org/setup-micromamba@v1 + with: + environment-file: environment.yml + - run: | + jupyter execute notebooks/example.ipynb diff --git a/docs/index.md b/docs/index.md index 98d6a66..b8b92df 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,22 +6,56 @@ Some text about what this is... Our example notebook shows how you can download a dataset from heiData. -### Online with Colab +### Online -You can run our example notebook online without installing anything locally using Google Colab (Google account required): +You can run our example notebook online without installing anything on your computer. -[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ssciwr/QHCC/blob/main/notebooks/example.ipynb) +
-### Online with Binder +- __Google Colab__ -Alternatively you can run it online using Binder: + --- -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ssciwr/QHCC/HEAD?labpath=notebooks%2Fexample.ipynb) + [Open In Colab](https://colab.research.google.com/github/ssciwr/QHCC/blob/main/notebooks/example.ipynb){ .md-button } -### Locally with Docker + (Google account required) -todo +- __Binder__ + + --- + + [Open in Binder](https://mybinder.org/v2/gh/ssciwr/QHCC/HEAD?labpath=notebooks%2Fexample.ipynb){ .md-button } +
### Locally -todo +Alternatively you can run it on your computer. + +First clone the repository using git: + +```bash +git clone https://github.com/ssciwr/QHCC +cd QHCC +``` + +Then install the required Python libraries and launch JupyterLab: + +=== "pip" + ```bash + pip install -r requirements.txt + jupyter lab notebooks/example.ipynb + ``` + +=== "conda" + ```bash + conda env create -f environment.yml + conda activate QHCC + jupyter lab notebooks/example.ipynb + ``` + +=== "micromamba" + ```bash + micromamba env create -f environment.yml + micromamba activate QHCC + jupyter lab notebooks/example.ipynb + ``` diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..35dd87b --- /dev/null +++ b/environment.yml @@ -0,0 +1,8 @@ +name: QHCC +channels: + - conda-forge +dependencies: + - python + - pooch + - pandas + - jupyter diff --git a/mkdocs.yml b/mkdocs.yml index 3d79979..4a702b0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -15,6 +15,8 @@ markdown_extensions: - pymdownx.inlinehilite - pymdownx.snippets - pymdownx.superfences + - attr_list + - md_in_html nav: - Home: index.md - Data: data.md From 8f939121120a6e2239aa4de1dceda6dca4e9c128 Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Tue, 3 Dec 2024 15:19:24 +0100 Subject: [PATCH 2/2] add windows to CI --- .github/workflows/notebooks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index a07c909..25c1e73 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -11,8 +11,8 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest"] - python-version: ["3.12", "3.13"] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: ["3.11", "3.12", "3.13"] runs-on: ${{ matrix.os }} name: "${{ matrix.os }} :: pypi :: ${{ matrix.python-version }}" steps: