Skip to content

Commit

Permalink
Set contents of temporary file if reference data does not match in `r…
Browse files Browse the repository at this point in the history
…ef_data_compare_from_paths.ipynb` (#58)

* Set contents of tmp file to zero if datasets do not match

* change file location and contents

* Rename file variable to fh
  • Loading branch information
atharva-2001 authored Nov 17, 2022
1 parent 2e517a7 commit f3ec684
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion notebooks/ref_data_compare_from_paths.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"import os\n",
"import sys\n",
"import shutil\n",
"import tempfile\n",
"import subprocess\n",
"import numpy as np\n",
"import pandas as pd\n",
Expand Down Expand Up @@ -456,6 +455,22 @@
" tmp2['/test_runner_simple/spectrum_virtual/_frequency'][:-1], \n",
" tmp2['/test_runner_simple/spectrum_virtual/luminosity'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if False in tt.match.values or None in tt.match.values:\n",
" print(\"Reference files do not match, setting contents of tmp file to zero.\")\n",
" with open('refdata_compare_result', 'w+') as fh:\n",
" fh.write('REFDATA COMPARISON FAILED')\n",
"else:\n",
" print(\"Reference files match.\")\n",
" with open('refdata_compare_result', 'w+') as fh:\n",
" fh.write('REFDATA COMPARISON SUCCEEDED') "
]
}
],
"metadata": {
Expand Down

0 comments on commit f3ec684

Please sign in to comment.