Skip to content

Commit

Permalink
ci: prevent latex formating errors with nbval
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jul 17, 2023
1 parent 10b8a48 commit 066d7c0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions tests/conftest.py → conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
MPI = None


def pytest_collectstart(collector):
if collector.fspath and collector.fspath.ext == '.ipynb':
collector.skip_compare += ('text/latex', 'stderr')


def skipif(items, whole_module=False):
assert isinstance(whole_module, bool)
items = as_tuple(items)
Expand Down
2 changes: 1 addition & 1 deletion examples/cfd/08_shallow_water_equation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
"N0 = 0. * M0\n",
"D0 = eta0 + 50.\n",
"\n",
"grid = Grid(shape=(ny, nx), extent=(Ly, Lx), dtype=np.float64)"
"grid = Grid(shape=(ny, nx), extent=(Ly, Lx), dtype=np.float32)"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions examples/seismic/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def __init__(self, start=None, step=None, num=None, stop=None):
if not isinstance(num, int):
raise TypeError("input argument must be of type int")

self.start = start
self.stop = stop
self.step = step
self.num = num
self.start = float(start)
self.stop = float(stop)
self.step = float(step)
self.num = int(num)

def __str__(self):
return "TimeAxis: start=%g, stop=%g, step=%g, num=%g" % \
Expand Down
3 changes: 1 addition & 2 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ pytest-cov
codecov
flake8>=2.1.0
nbval
scipy
cloudpickle
scipy
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ codepy>=2019.1
click<9.0
multidict
anytree>=2.4.3,<=2.9.0
cloudpickle

0 comments on commit 066d7c0

Please sign in to comment.