Skip to content

Commit

Permalink
Merge pull request #51 from justinlaughlin/dokken/CI-example1
Browse files Browse the repository at this point in the history
Add Example 1 to CI
  • Loading branch information
jorgensd authored Jan 17, 2023
2 parents e5e4d05 + 32b6e98 commit 4eee0b8
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 49 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/test_fenics_stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@ on:
jobs:
check-code:
runs-on: ubuntu-22.04
# Runs against FEniCS main branch built the 12-12-2022
container: ghcr.io/scientificcomputing/fenics:2022-12-12
# Runs against FEniCS main branch built the 16-01-2023
container: ghcr.io/scientificcomputing/fenics:2023-01-16
steps:
# This action sets the current path to the root of your github repo
- uses: actions/checkout@v3

- name: "Install code"
run: python3 -m pip install --no-binary=h5py .[dev]
- name: Run tests

- name: Run example 1
run: |
cd tests/
python3 -m pytest .
cd examples/example1/
python3 example1_driver.py
# - name: Run tests
# run: |
# cd tests/
# python3 -m pytest .
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Although FEniCS is a core dependency, because it has many different versions (20

```bash
# create a container using DOLFIN built on ubuntu 22.04 with Python 3.10
jgl:~$ docker run -ti --init ghcr.io/scientificcomputing/fenics:2022-12-12
jgl:~$ docker run -ti --init ghcr.io/scientificcomputing/fenics:2023-01-16
# pip install stubs from within the container
root@jgl:~$ python3 -m pip install fenics-stubs
```
Expand Down
10 changes: 7 additions & 3 deletions examples/example1/example1_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
# STUBS driver script example
# =============================================================================================
# Imports
import stubs
import dolfin as d
import os

import dolfin as d

import example1_model

import stubs


# =============================================================================================
# Load model
# =============================================================================================
import example1_model
pc, sc, cc, rc = example1_model.make_model()

# =============================================================================================
Expand Down
9 changes: 5 additions & 4 deletions examples/example1/example1_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
Roughly, this model is similar to an IP3 pulse at the PM, leading to Ca2+ release at the ER
"""
# Imports
import stubs
from stubs.common import empty_sbmodel, sbmodel_from_locals
from stubs.model_assembly import Parameter, Species, Compartment, Reaction, parse_expr

import sympy as sym

import stubs
from stubs.common import sbmodel_from_locals
from stubs.model_assembly import Compartment, Parameter, Reaction, Species

# Aliases - base units
unit = stubs.unit # unit registry
uM = unit.uM
Expand Down
Binary file removed examples/example1/mesh/DemoCuboidsMesh.png
Binary file not shown.
18 changes: 0 additions & 18 deletions examples/example1/mesh/DemoCuboidsMesh_mf2000000.vtu

This file was deleted.

18 changes: 0 additions & 18 deletions examples/example1/mesh/DemoCuboidsMesh_mf3000000.vtu

This file was deleted.

0 comments on commit 4eee0b8

Please sign in to comment.