-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3106ca9
commit 3f2d73e
Showing
2 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "fc9345cb-46bf-4df3-9dac-1bde062d9020", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import os\n", | ||
"print(os.getcwd())" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "e69ad935-80fd-4e70-af69-ac98e0bf2e34", | ||
"metadata": {}, | ||
"source": [ | ||
"## Define tests" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "48f6e922-52d3-412f-8345-0641d33e676e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"tests = {\n", | ||
" # \"eln\": [(\"eln_data.yaml\", \"apm.oasis.specific.yaml\")],\n", | ||
" \"apt\": [\"Si.apt\"],\n", | ||
" \"csv\": [\"Annealed_CoCrNi_100.csv\"],\n", | ||
" \"env\": [\"ErMnO.env\"],\n", | ||
" \"epos\": [\"R45_04472-v03.epos\"],\n", | ||
" \"fig\": [\"Superalloy_MassSpec_ranged.fig.txt\"],\n", | ||
" \"imago\": [\"default.analysis\"],\n", | ||
" \"pos\": [\"ErMnO_pole.pos\"],\n", | ||
" # \"pyccapt\": [(\"1748_Al_range_.h5\", \"1748_Al.h5\")],\n", | ||
" \"rng\": [\"87D_1.rng\"],\n", | ||
" \"rrng\": [\"VAlN_film_plan-view_700C.rrng\"]\n", | ||
"}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "6ae5057c-2101-4792-9804-3af046003db7", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"! mkdir -p log\n", | ||
"! mkdir -p prod" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "36a351a5-940d-4891-bb7e-1f4ba4100f6d", | ||
"metadata": {}, | ||
"source": [ | ||
"## Run tests" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "809a88fe-5e4f-4429-b668-8a7956210606", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"for parser_type, list_of_tests in tests.items():\n", | ||
" for entry in list_of_tests:\n", | ||
" if isinstance(entry, str): # no sidecar file \n", | ||
" print(f\"Running test {parser_type}/{entry}\")\n", | ||
" curr_dir = f\"{os.getcwd()}/data/{parser_type}\"\n", | ||
" in_one = f\"{curr_dir}/{entry}\"\n", | ||
" out = f\"prod/data.{parser_type}.{entry}.nxs\"\n", | ||
" stdout = f\"log/stdout.{parser_type}.{entry}.txt\"\n", | ||
" stderr = f\"log/stderr.{parser_type}.{entry}.txt\"\n", | ||
" ! dataconverter $in_one --reader apm --nxdl NXapm --output $out 1>$stdout 2>$stderr \n", | ||
" continue\n", | ||
" elif isinstance(entry, tuple): # with sidecar file\n", | ||
" if len(entry) == 2 and all(isinstance(val, str) for val in entry):\n", | ||
" print(f\"Running test {parser_type}/{entry}\")\n", | ||
" curr_dir = f\"{os.getcwd()}/data/{parser_type}\"\n", | ||
" in_one = f\"{curr_dir}/{entry[0]}\"\n", | ||
" in_two = f\"{curr_dir}/{entry[1]}\"\n", | ||
" out = f\"prod/data.{parser_type}.{entry[0]}.nxs\"\n", | ||
" stdout = f\"log/stdout.{parser_type}.{entry[0]}.txt\"\n", | ||
" stderr = f\"log/stderr.{parser_type}.{entry[0]}.txt\"\n", | ||
" ! dataconverter $in_one $in_two --reader apm --nxdl NXapm --output $out 1>$stdout 2>$stderr\n", | ||
" continue\n", | ||
" print(f\"Skipping test {parser_type}/{entry}\")\n", | ||
"print(\"Ran all tests\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "213077cb-6c43-42d0-8f0a-213c0f82696d", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |