Skip to content

Commit

Permalink
Add makefile and CI to check analysis notebooks work
Browse files Browse the repository at this point in the history
  • Loading branch information
fjclark committed Jun 6, 2024
1 parent 91ebbfe commit fdaf1c8
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- name: Setup Conda Environment
run: |
apt update && apt install -y git make
make env
- name: Test Analysis
run: |
make test-analysis
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
20 changes: 20 additions & 0 deletions analysis/print.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
21 changes: 21 additions & 0 deletions devtools/envs/base.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fdaf1c8

Please sign in to comment.