Skip to content

Commit

Permalink
infra to ensure notebooks run
Browse files Browse the repository at this point in the history
  • Loading branch information
tjlane committed Nov 29, 2024
1 parent 4915171 commit b81ec6a
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: run-examples

on:
pull_request:
workflow_call:
inputs:
job:
required: true
type: string

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS) }}

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Ensure notebooks complete without errors with pytest and nbmake
run: |
pip install '.[tests]'
pytest --nbmake examples/*ipynb
19 changes: 16 additions & 3 deletions examples/customized_meteor_diffmap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# 3. TV denoise the map\n",
"### 3. TV denoise the map\n",
"\n",
"Finally, the main event, the entreé! Let's improve our _k_-weighted map by TV-denoising it."
]
Expand Down Expand Up @@ -215,12 +215,25 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 4. Write out the results\n",
"\n",
"Awesome! Now we have a fancy new diffmap, which we probably want to save so we can do something with it. Like fire up Coot and check it out. If you are curious, the PDB ID corresponding to this dataset is `8a6g`, and you can find a copy of the structure as a PDB file in this repository:\n",
"\n",
"> `../test/data/8a6g.pdb`"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 41,
"metadata": {},
"outputs": [],
"source": []
"source": [
"tv_denosied_map.write_mtz(\"my_denoised_diffmap.mtz\")"
]
}
],
"metadata": {
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tests = [
"pytest",
"pytest-cov",
"pytest-xdist",
"nbmake",
]

[project.scripts]
Expand Down

0 comments on commit b81ec6a

Please sign in to comment.