Skip to content

Commit 07a77ca

Browse files
committed
change papermill output notebook name, modfy gh actions
gh actions script is modified by changing the papermill output notebook name, and output notebooks are no longer checked for errors as there is no catch all command anymore, if papermill fails, so essentially relying on papermill for raising exceptions. preprocessing script now adds a line describing the action it took whenever something is injected
1 parent be0d624 commit 07a77ca

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

test/src/preProcessNotebooks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ def modify_notebook(file_name, project_id, query1, query2):
1010
for cell in nb.cells:
1111
if cell.cell_type == "code":
1212
# Replace the line if it exists
13-
cell.source = cell.source.replace('my_ProjectID = "" #@param {type:"string"}', f"my_ProjectID='{project_id}'")
13+
cell.source = cell.source.replace('my_ProjectID = "" #@param {type:"string"}', f"this project_id is injected for testing /n my_ProjectID='{project_id}'")
1414
# Comment out another line
15-
cell.source = cell.source.replace('auth.authenticate_user()', '# auth.authenticate_user()')
15+
cell.source = cell.source.replace('auth.authenticate_user()', '#while testing, the authentication is handled by using application default credentials /n #auth.authenticate_user()')
1616
cell.source = cell.source.replace('REPLACE THIS TEXT WITH YOUR QUERY!', query1)
1717
cell.source = cell.source.replace('# write the selection criteria under this line!', query2)
1818

@@ -29,7 +29,7 @@ def modify_notebook(file_name, project_id, query1, query2):
2929

3030
for file_name in files:
3131

32-
project_id = 'named-storm-395312'
33-
query1 = 'SELECT DISTINCT collection_tumorLocation FROM `bigquery-public-data.idc_current.dicom_all` ' if 'part2' in file_name else ''
34-
query2 = 'MODALITY=\'MR\' AND collection_tumorLocation=\'Lung\'' if 'part2' in file_name else ''
32+
project_id = 'idc-external-025'
33+
query1 = '#this query is injected for testing /n SELECT DISTINCT collection_tumorLocation FROM `bigquery-public-data.idc_current.dicom_all` ' if 'part2' in file_name else ''
34+
query2 = '#this query is injected for testing /n MODALITY=\'MR\' AND collection_tumorLocation=\'Lung\'' if 'part2' in file_name else ''
3535
modify_notebook(file_name, project_id, query1, query2)

0 commit comments

Comments
 (0)