Skip to content

Commit 015b1e8

Browse files
authored
Merge pull request #1702 from pints-team/rt-notebook-fix-2
Rt notebook fix 2
2 parents dd2f625 + bb70b0b commit 015b1e8

File tree

4 files changed

+6
-207
lines changed

4 files changed

+6
-207
lines changed

examples/miscellaneous/model-rt-estimation-renewal-equation.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@
10281028
"metadata": {},
10291029
"outputs": [],
10301030
"source": [
1031-
"pois_intervals.to_csv('pois_rt.csv')"
1031+
"#pois_intervals.to_csv('pois_rt.csv')"
10321032
]
10331033
},
10341034
{
@@ -1844,7 +1844,7 @@
18441844
"metadata": {},
18451845
"outputs": [],
18461846
"source": [
1847-
"negbin_intervals.to_csv('negbin_rt.csv')"
1847+
"#negbin_intervals.to_csv('negbin_rt.csv')"
18481848
]
18491849
},
18501850
{

examples/miscellaneous/negbin_rt.csv

-101
This file was deleted.

examples/miscellaneous/pois_rt.csv

-101
This file was deleted.

run-tests.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def list_notebooks(root, recursive=True, ignore_list=None, notebooks=None):
432432

433433
def test_notebook(path):
434434
"""
435-
Tests a notebook in a subprocess, exists if it doesn't finish.
435+
Tests a notebook in a subprocess, exits if it doesn't finish.
436436
"""
437437
import nbconvert
438438
import pints
@@ -442,7 +442,7 @@ def test_notebook(path):
442442

443443
# Load notebook, convert to python
444444
e = nbconvert.exporters.PythonExporter()
445-
code, __ = e.from_filename(path)
445+
code, _ = e.from_filename(path)
446446

447447
# Remove coding statement, if present
448448
code = '\n'.join([x for x in code.splitlines() if x[:9] != '# coding'])
@@ -455,7 +455,8 @@ def test_notebook(path):
455455
cmd = [sys.executable, '-c', code]
456456
try:
457457
p = subprocess.Popen(
458-
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env
458+
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env,
459+
cwd=os.path.dirname(path)
459460
)
460461
stdout, stderr = p.communicate()
461462
# TODO: Use p.communicate(timeout=3600)

0 commit comments

Comments
 (0)