1- import nbformat
2- from nbclient import NotebookClient
3- import os
4- import pytest
1+ def test_ex07 ():
2+ import calphy
3+ from calphy .postprocessing import read_report
54
6- def test_example07_first_cell_runs ():
7- notebook_path = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '../examples/example_07/analysis.ipynb' ))
5+ # def test_example07_first_cell_runs():
6+ # notebook_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../examples/example_07/analysis.ipynb'))
87
9- with open (notebook_path , "r" , encoding = "utf-8" ) as f :
10- nb = nbformat .read (f , as_version = 4 )
8+ # with open(notebook_path, "r", encoding="utf-8") as f:
9+ # nb = nbformat.read(f, as_version=4)
1110
12- # Filter just the first code cell
13- first_code_cell = next ((cell for cell in nb .cells if cell .cell_type == "code" ), None )
11+ # # Filter just the first code cell
12+ # first_code_cell = next((cell for cell in nb.cells if cell.cell_type == "code"), None)
1413
15- if not first_code_cell :
16- pytest .fail ("No code cell found in example07.ipynb" )
14+ # if not first_code_cell:
15+ # pytest.fail("No code cell found in example07.ipynb")
1716
18- # Create a minimal notebook with only the first cell
19- nb_single = nbformat .v4 .new_notebook ()
20- nb_single .cells = [first_code_cell ]
17+ # # Create a minimal notebook with only the first cell
18+ # nb_single = nbformat.v4.new_notebook()
19+ # nb_single.cells = [first_code_cell]
2120
22- try :
23- client = NotebookClient (nb_single , timeout = 60 , kernel_name = "pyiron" )
24- client .execute ()
25- except Exception as e :
26- pytest .fail (f"First code cell in example07.analysis.ipynb failed: { e } " )
21+ # try:
22+ # client = NotebookClient(nb_single, timeout=60, kernel_name="pyiron")
23+ # client.execute()
24+ # except Exception as e:
25+ # pytest.fail(f"First code cell in example07.analysis.ipynb failed: {e}")
0 commit comments