Skip to content

Commit

Permalink
🚚 reshuffle for lfs
Browse files Browse the repository at this point in the history
  • Loading branch information
cemachelen committed Jul 7, 2022
1 parent 8e9d1d2 commit 7711c82
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 18 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Python Package using Conda
on: [push]

jobs:
test:
name: Test python ${{ matrix.python-version }} on ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
python-version: [3.7]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: install mamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: CNN.yml
environment-name: CNN
- name: Install test packages
shell: bash -l {0}
run: |
pip install pytest nbconvert nbformat
- name: which python
shell: bash -l {0}
run: |
which python
- name: Test with pytest
shell: bash -l {0}
run: |
pytest .github/workflows/test_CNN_notebooks.py
47 changes: 47 additions & 0 deletions .github/workflows/test_CNN_notebooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""
Tests for checking that all Jupyter notebooks in repository execute without errors.
Based on https://github.com/mcullan/jupyter-actions/blob/master/test/test_notebooks.py
Leif Denby - MIT License 2021
"""
import os
import subprocess
import pytest
from pathlib import Path

import nbformat
from nbconvert.preprocessors import ExecutePreprocessor

TEST_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.join(TEST_DIR, "../")


def _find_notebooks():
# Get all files included in the git repository
git_files = (
subprocess.check_output(
"git ls-tree --full-tree --name-only -r HEAD", shell=True
)
.decode("utf-8")
.splitlines()
)

# Get just the notebooks from the git files
notebooks_files = [Path(fn) for fn in git_files if fn.endswith("CNN_Volcanic_deformation_test.ipynb")]

# remove all notebooks that haven't been checked
notebooks_files = [p for p in notebooks_files if p.parent.name != "unchecked"]
return [str(p) for p in notebooks_files]


@pytest.mark.parametrize("notebook_filename", _find_notebooks())
def test_notebook(notebook_filename, html_directory="notebook-html"):
"""
Checks if an IPython notebook runs without error from start to finish.
"""
with open(notebook_filename) as f:
nb = nbformat.read(f, as_version=4)

ep = ExecutePreprocessor(timeout=600)

# Check that the notebook runs
ep.preprocess(nb, {"metadata": {"path": Path(notebook_filename).parent }})
33 changes: 33 additions & 0 deletions .github/workflows/windows_python_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Python Package using Conda
on: [push]

jobs:
test:
name: Test python ${{ matrix.python-version }} on ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python-version: [3.7]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: install mamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: CNN_windows.yml
environment-name: CNN
- name: Install test packages
shell: bash -l {0}
run: |
pip install pytest nbconvert nbformat
- name: which python
shell: bash -l {0}
run: |
which python
- name: Test with pytest
shell: bash -l {0}
run: |
pytest .github/workflows/test_CNN_notebooks.py
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ConvolutionalNeuralNetworks/**/*.npz
**/.ipynb_checkpoints/
**/__pycache__
ConvolutionalNeuralNetworks/data/real/
ConvolutionalNeuralNetworks/data/train_full_model/
ConvolutionalNeuralNetworks/data/train_fully_connected_model/
ConvolutionalNeuralNetworks/vgg16_2head.png
Empty file added Data/README.md
Empty file.
3 changes: 0 additions & 3 deletions Data/Stenosis2D.mat

This file was deleted.

3 changes: 0 additions & 3 deletions Data/cylinder_nektar_t0_vorticity.mat

This file was deleted.

3 changes: 0 additions & 3 deletions Data/cylinder_nektar_wake.mat

This file was deleted.

3 changes: 0 additions & 3 deletions Data/heatEquation_data.mat

This file was deleted.

3 changes: 0 additions & 3 deletions Data/heatEquation_data_coarse.mat

This file was deleted.

3 changes: 0 additions & 3 deletions PINNs_NavierStokes_HFM.md

This file was deleted.

0 comments on commit 7711c82

Please sign in to comment.