From fdaf1c8879c8088dd9025788c336197b7bd152e5 Mon Sep 17 00:00:00 2001 From: finlayclark Date: Thu, 6 Jun 2024 11:33:43 +0100 Subject: [PATCH] Add makefile and CI to check analysis notebooks work --- .github/workflows/ci.yaml | 27 +++++++++++++++++++++++++++ Makefile | 14 ++++++++++++++ analysis/print.ipynb | 20 ++++++++++++++++++++ devtools/envs/base.yaml | 21 +++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 Makefile create mode 100644 analysis/print.ipynb create mode 100644 devtools/envs/base.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..0a8ca2b --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,27 @@ +name: CI + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +on: + push: { branches: [ "main" ] } + pull_request: { branches: [ "main" ] } + +jobs: + test: + + runs-on: ubuntu-latest + container: condaforge/mambaforge:latest + + steps: + - uses: actions/checkout@v3.3.0 + + - name: Setup Conda Environment + run: | + apt update && apt install -y git make + make env + + - name: Test Analysis + run: | + make test-analysis \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..39d5e1b --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +PACKAGE_NAME := a3fe_reproduce +CONDA_ENV_RUN := conda run --no-capture-output --name $(PACKAGE_NAME) + +ANALYSIS_NBS := $(wildcard analysis/*.ipynb) + +.PHONY: env test-analysis + +env: + mamba create --name $(PACKAGE_NAME) + mamba env update --name $(PACKAGE_NAME) --file devtools/envs/base.yaml + $(CONDA_ENV_RUN) pip install --no-build-isolation --no-deps git+https://github.com/michellab/a3fe.git + +test-analysis: + $(CONDA_ENV_RUN) jupyter nbconvert --to notebook --execute $(ANALYSIS_NBS) diff --git a/analysis/print.ipynb b/analysis/print.ipynb new file mode 100644 index 0000000..7543806 --- /dev/null +++ b/analysis/print.ipynb @@ -0,0 +1,20 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!echo \"Hello make world!\"" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/devtools/envs/base.yaml b/devtools/envs/base.yaml new file mode 100644 index 0000000..691279f --- /dev/null +++ b/devtools/envs/base.yaml @@ -0,0 +1,21 @@ +name: a3fe_reproduce + +channels: + - conda-forge + - "openbiosim/label/dev" + +dependencies: + # Base depends + - arviz + - pandas + - python + - pip + - numpy + - matplotlib + - scipy + - ipython + - pymbar<4 + - ambertools + - biosimspace>2023.4 + - numpydoc + - pydantic \ No newline at end of file