From 3fe2a25e4f0360a69aea921db95e3f223159a003 Mon Sep 17 00:00:00 2001 From: Henry LE BERRE Date: Thu, 4 Jan 2024 19:43:38 -0500 Subject: [PATCH] Linting the toolchain (#230) Co-authored-by: Spencer Bryngelson --- .github/workflows/lint.yml | 19 +++++ mfc.sh | 10 ++- tests/02748F0F/case.py | 2 +- tests/043B535A/case.py | 2 +- tests/07C33719/case.py | 2 +- tests/0879E062/case.py | 4 +- tests/09623DE3/case.py | 2 +- tests/0982571B/case.py | 2 +- tests/09DAFEBA/case.py | 2 +- tests/0A022883/case.py | 2 +- tests/0FCCE9F1/case.py | 2 +- tests/122713AA/case.py | 2 +- tests/13DFC31D/case.py | 2 +- tests/14975B87/case.py | 2 +- tests/14B6198D/case.py | 2 +- tests/16C03D8E/case.py | 2 +- tests/16FBF4C8/case.py | 2 +- tests/18431ACB/case.py | 2 +- tests/18BDCBC8/case.py | 2 +- tests/19E33853/case.py | 2 +- tests/1C0780C8/case.py | 2 +- tests/1CCA82F5/case.py | 2 +- tests/1E738705/case.py | 2 +- tests/2060F55A/case.py | 2 +- tests/20AE0551/case.py | 2 +- tests/27A13E25/case.py | 2 +- tests/284E0EF5/case.py | 2 +- tests/2A523AC1/case.py | 4 +- tests/2A6136EF/case.py | 2 +- tests/2AB32975/case.py | 2 +- tests/2E021372/case.py | 2 +- tests/2F35A1FE/case.py | 2 +- tests/2FD933A2/case.py | 2 +- tests/301B9153/case.py | 2 +- tests/303B925A/case.py | 2 +- tests/32D0F235/case.py | 4 +- tests/34580912/case.py | 2 +- tests/345A94C0/case.py | 4 +- tests/34DBFE14/case.py | 2 +- tests/361D2A9B/case.py | 2 +- tests/36256906/case.py | 2 +- tests/38533D07/case.py | 2 +- tests/3974AC7B/case.py | 2 +- tests/3A8359F6/case.py | 2 +- tests/3AE495F4/case.py | 2 +- tests/3B414AF0/case.py | 2 +- tests/3BFEAC19/case.py | 4 +- tests/3C00B89D/case.py | 4 +- tests/3FC6FC4A/case.py | 2 +- tests/4129A23A/case.py | 2 +- tests/42B169F5/case.py | 2 +- tests/461DCB09/case.py | 4 +- tests/46AA7AF8/case.py | 2 +- tests/48B9D0C4/case.py | 2 +- tests/48CCE072/case.py | 2 +- tests/4AEF478A/case.py | 4 +- tests/4D7926CD/case.py | 2 +- tests/4F2F4ACE/case.py | 2 +- tests/5010B814/case.py | 2 +- tests/50A8B1FE/case.py | 2 +- tests/5281BD7B/case.py | 2 +- tests/53E13D19/case.py | 2 +- tests/541A30DB/case.py | 2 +- tests/5527832F/case.py | 2 +- tests/55533234/case.py | 2 +- tests/557FF170/case.py | 2 +- tests/5781A4C2/case.py | 2 +- tests/59B127EF/case.py | 2 +- tests/59D05DE9/case.py | 2 +- tests/5DAB50B2/case.py | 2 +- tests/5E2265C4/case.py | 2 +- tests/5E454E32/case.py | 2 +- tests/5EC236F2/case.py | 2 +- tests/5F877BC9/case.py | 2 +- tests/61FFF3D3/case.py | 2 +- tests/622DEC78/case.py | 2 +- tests/6241177B/case.py | 2 +- tests/6249EDDE/case.py | 2 +- tests/63850240/case.py | 2 +- tests/645A26E3/case.py | 4 +- tests/64E032D7/case.py | 2 +- tests/66CFF8CC/case.py | 2 +- tests/6784C02E/case.py | 2 +- tests/6B22A317/case.py | 2 +- tests/6B4B738B/case.py | 2 +- tests/6D24B115/case.py | 4 +- tests/6F296065/case.py | 2 +- tests/6FC6A809/case.py | 2 +- tests/7077C99F/case.py | 2 +- tests/70DAE9E8/case.py | 2 +- tests/727F72ED/case.py | 2 +- tests/728A2A5B/case.py | 2 +- tests/729A4333/case.py | 2 +- tests/72FD6FF5/case.py | 2 +- tests/730DFD6D/case.py | 2 +- tests/7374E266/case.py | 2 +- tests/73B0539E/case.py | 4 +- tests/758D0268/case.py | 2 +- tests/786DE444/case.py | 2 +- tests/7C8F1BA9/case.py | 2 +- tests/7DEA8C54/case.py | 2 +- tests/7EFBCDAE/case.py | 2 +- tests/7FC6826B/case.py | 2 +- tests/83291843/case.py | 2 +- tests/8360C26B/case.py | 2 +- tests/83EFC30C/case.py | 4 +- tests/84017671/case.py | 2 +- tests/842C6FFC/case.py | 2 +- tests/851F7AE2/case.py | 4 +- tests/8A341282/case.py | 2 +- tests/8A59E8E6/case.py | 2 +- tests/8B679445/case.py | 2 +- tests/8BCBAED8/case.py | 2 +- tests/8C7AA13B/case.py | 2 +- tests/8E3D99E6/case.py | 2 +- tests/8EAC3DA7/case.py | 2 +- tests/8FDEE23A/case.py | 2 +- tests/939D6718/case.py | 2 +- tests/9465D0F5/case.py | 2 +- tests/98081DA3/case.py | 2 +- tests/9ACD5174/case.py | 2 +- tests/9CB03CEF/case.py | 2 +- tests/9DAC4DDC/case.py | 2 +- tests/9EB947DB/case.py | 2 +- tests/9EF19F0A/case.py | 2 +- tests/9F3B58E7/case.py | 2 +- tests/A0B82851/case.py | 2 +- tests/A5C93D62/case.py | 4 +- tests/A60691E7/case.py | 2 +- tests/A6AC2E06/case.py | 2 +- tests/A6E65782/case.py | 2 +- tests/A6EEAE2D/case.py | 2 +- tests/A83CADB5/case.py | 2 +- tests/AACF1BC5/case.py | 2 +- tests/AB04C64D/case.py | 2 +- tests/AB0BE4E4/case.py | 4 +- tests/ABAC3AE3/case.py | 2 +- tests/AD63A4A5/case.py | 2 +- tests/AE37D842/case.py | 2 +- tests/AED93D34/case.py | 2 +- tests/AF0BCEE4/case.py | 2 +- tests/AF46C382/case.py | 2 +- tests/B33E256A/case.py | 4 +- tests/B3AAC9C8/case.py | 2 +- tests/B3C85904/case.py | 2 +- tests/B7250A5B/case.py | 2 +- tests/B89B8C70/case.py | 2 +- tests/B8F5F1C8/case.py | 4 +- tests/B96AC58F/case.py | 2 +- tests/BD8004FF/case.py | 4 +- tests/BDD3411B/case.py | 2 +- tests/BF46F657/case.py | 2 +- tests/C04741B4/case.py | 2 +- tests/C06849AD/case.py | 2 +- tests/C36F18FB/case.py | 4 +- tests/C4907722/case.py | 2 +- tests/C4A2FAA3/case.py | 2 +- tests/C5B79059/case.py | 2 +- tests/C79E1D3C/case.py | 2 +- tests/C93BE9B5/case.py | 2 +- tests/CC4F7C44/case.py | 2 +- tests/CD3D9660/case.py | 2 +- tests/CD6DC908/case.py | 2 +- tests/CD9D3050/case.py | 2 +- tests/CE232828/case.py | 2 +- tests/CFE87594/case.py | 2 +- tests/D0045756/case.py | 2 +- tests/D3C860B9/case.py | 2 +- tests/D6BAC936/case.py | 2 +- tests/D79C3E6F/case.py | 2 +- tests/D972BA0F/case.py | 2 +- tests/DA8AF07E/case.py | 2 +- tests/DB670E50/case.py | 2 +- tests/DC46C302/case.py | 2 +- tests/DC9CB97E/case.py | 4 +- tests/DCB3BC6C/case.py | 2 +- tests/E09A12D9/case.py | 2 +- tests/E1352143/case.py | 2 +- tests/E4EFEDB2/case.py | 2 +- tests/E76D41CE/case.py | 2 +- tests/E84967E7/case.py | 2 +- tests/E8C28D5B/case.py | 2 +- tests/EAA53889/case.py | 2 +- tests/ED728400/case.py | 2 +- tests/EF54219C/case.py | 2 +- tests/F0E6771E/case.py | 2 +- tests/F0F175B2/case.py | 2 +- tests/F1457D58/case.py | 2 +- tests/F4F6AC27/case.py | 4 +- tests/F5890628/case.py | 2 +- tests/F97573DB/case.py | 4 +- tests/F99FBB36/case.py | 2 +- tests/FB822062/case.py | 2 +- tests/FBF808BE/case.py | 4 +- tests/FC4D07B6/case.py | 4 +- tests/FD891191/case.py | 2 +- tests/FE3E35C4/case.py | 2 +- toolchain/bootstrap/lint.sh | 7 ++ toolchain/{mfc.py => main.py} | 11 ++- toolchain/mfc/args.py | 31 +++---- toolchain/mfc/bench.py | 62 +------------- toolchain/mfc/build.py | 65 +++++++------- toolchain/mfc/case.py | 4 +- toolchain/mfc/common.py | 93 ++++++++++---------- toolchain/mfc/count.py | 20 ++--- toolchain/mfc/lock.py | 14 +-- toolchain/mfc/packer/errors.py | 2 +- toolchain/mfc/packer/pack.py | 23 +++-- toolchain/mfc/packer/packer.py | 21 +++-- toolchain/mfc/packer/tol.py | 9 +- toolchain/mfc/printer.py | 10 +-- toolchain/mfc/run/case_dicts.py | 15 ++-- toolchain/mfc/run/engines.py | 58 +++++++------ toolchain/mfc/run/input.py | 62 +++++++------- toolchain/mfc/run/queues.py | 20 ++--- toolchain/mfc/run/run.py | 11 +-- toolchain/mfc/sched.py | 9 +- toolchain/mfc/state.py | 6 +- toolchain/mfc/test/case.py | 32 +++++-- toolchain/mfc/test/cases.py | 116 ++++++++++++------------- toolchain/mfc/test/test.py | 146 +++++++++++++++----------------- toolchain/requirements.txt | 1 + 222 files changed, 649 insertions(+), 666 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 toolchain/bootstrap/lint.sh rename toolchain/{mfc.py => main.py} (91%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..a2f219485 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,19 @@ +name: Lint + +on: + push: + + pull_request: + + workflow_dispatch: + +jobs: + docs: + name: Lint Toolchain + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Lint the toolchain + run: ./mfc.sh lint diff --git a/mfc.sh b/mfc.sh index 1b5eb4a08..bd6d8b919 100755 --- a/mfc.sh +++ b/mfc.sh @@ -24,6 +24,10 @@ fi # If the user wishes to run the "load" script if [ "$1" == 'load' ]; then shift; . "$(pwd)/toolchain/bootstrap/modules.sh" $@; return +elif [ "$1" == "lint" ]; then + . "$(pwd)/toolchain/bootstrap/python.sh" + + shift; . "$(pwd)/toolchain/bootstrap/lint.sh" $@; exit 0 elif [ "$1" == "format" ]; then . "$(pwd)/toolchain/bootstrap/python.sh" @@ -37,10 +41,14 @@ mkdir -p "$(pwd)/build" . "$(pwd)/toolchain/bootstrap/cmake.sh" . "$(pwd)/toolchain/bootstrap/python.sh" +echo + # Run the main.py bootstrap script -python3 "$(pwd)/toolchain/mfc.py" "$@" +python3 "$(pwd)/toolchain/main.py" "$@" code=$? +echo + if [ $code -ne 0 ]; then error "mfc.py finished with a $code exit code." fi diff --git a/tests/02748F0F/case.py b/tests/02748F0F/case.py index 3a9cfbfb3..2ceaf1b1e 100644 --- a/tests/02748F0F/case.py +++ b/tests/02748F0F/case.py @@ -126,7 +126,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/043B535A/case.py b/tests/043B535A/case.py index 5bfea6a80..046aea0ad 100644 --- a/tests/043B535A/case.py +++ b/tests/043B535A/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/07C33719/case.py b/tests/07C33719/case.py index 3726f0e10..20aa542cb 100644 --- a/tests/07C33719/case.py +++ b/tests/07C33719/case.py @@ -166,7 +166,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/0879E062/case.py b/tests/0879E062/case.py index 69b6041b8..dc7e6a69d 100644 --- a/tests/0879E062/case.py +++ b/tests/0879E062/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 1, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -131,7 +131,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/09623DE3/case.py b/tests/09623DE3/case.py index 238c112d9..8e009e095 100644 --- a/tests/09623DE3/case.py +++ b/tests/09623DE3/case.py @@ -167,7 +167,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/0982571B/case.py b/tests/0982571B/case.py index 1a1bd52ef..166884967 100644 --- a/tests/0982571B/case.py +++ b/tests/0982571B/case.py @@ -166,7 +166,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/09DAFEBA/case.py b/tests/09DAFEBA/case.py index 68f959291..61561b8cd 100644 --- a/tests/09DAFEBA/case.py +++ b/tests/09DAFEBA/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/0A022883/case.py b/tests/0A022883/case.py index 2df2a55b6..15fc4f2ef 100644 --- a/tests/0A022883/case.py +++ b/tests/0A022883/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/0FCCE9F1/case.py b/tests/0FCCE9F1/case.py index 3e94b2b8e..e014d51ae 100644 --- a/tests/0FCCE9F1/case.py +++ b/tests/0FCCE9F1/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/122713AA/case.py b/tests/122713AA/case.py index cbaa96de6..402f371c9 100644 --- a/tests/122713AA/case.py +++ b/tests/122713AA/case.py @@ -147,7 +147,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/13DFC31D/case.py b/tests/13DFC31D/case.py index ee415130e..f6c13bfd4 100644 --- a/tests/13DFC31D/case.py +++ b/tests/13DFC31D/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/14975B87/case.py b/tests/14975B87/case.py index 4f48af455..dca19a6a2 100644 --- a/tests/14975B87/case.py +++ b/tests/14975B87/case.py @@ -164,7 +164,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/14B6198D/case.py b/tests/14B6198D/case.py index 6475fbbd2..fd507295f 100644 --- a/tests/14B6198D/case.py +++ b/tests/14B6198D/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/16C03D8E/case.py b/tests/16C03D8E/case.py index 46f7b79fa..92e419d24 100644 --- a/tests/16C03D8E/case.py +++ b/tests/16C03D8E/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/16FBF4C8/case.py b/tests/16FBF4C8/case.py index ed10765d5..e0b76b99a 100644 --- a/tests/16FBF4C8/case.py +++ b/tests/16FBF4C8/case.py @@ -144,7 +144,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/18431ACB/case.py b/tests/18431ACB/case.py index 70d2b76a7..ebac14888 100644 --- a/tests/18431ACB/case.py +++ b/tests/18431ACB/case.py @@ -175,7 +175,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/18BDCBC8/case.py b/tests/18BDCBC8/case.py index 35dd4dc64..a85071192 100644 --- a/tests/18BDCBC8/case.py +++ b/tests/18BDCBC8/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/19E33853/case.py b/tests/19E33853/case.py index 03a5ba5db..8a81425db 100644 --- a/tests/19E33853/case.py +++ b/tests/19E33853/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/1C0780C8/case.py b/tests/1C0780C8/case.py index 6c79bf82c..e85669110 100644 --- a/tests/1C0780C8/case.py +++ b/tests/1C0780C8/case.py @@ -162,7 +162,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/1CCA82F5/case.py b/tests/1CCA82F5/case.py index 3d07f9d1e..458ad8b16 100644 --- a/tests/1CCA82F5/case.py +++ b/tests/1CCA82F5/case.py @@ -131,7 +131,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/1E738705/case.py b/tests/1E738705/case.py index 98f08af05..139f49244 100644 --- a/tests/1E738705/case.py +++ b/tests/1E738705/case.py @@ -131,7 +131,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/2060F55A/case.py b/tests/2060F55A/case.py index e12a36ac5..95ead1f9c 100644 --- a/tests/2060F55A/case.py +++ b/tests/2060F55A/case.py @@ -162,7 +162,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/20AE0551/case.py b/tests/20AE0551/case.py index 862188dc0..c3a13ebcd 100644 --- a/tests/20AE0551/case.py +++ b/tests/20AE0551/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/27A13E25/case.py b/tests/27A13E25/case.py index 9835fa2ce..b2101453e 100644 --- a/tests/27A13E25/case.py +++ b/tests/27A13E25/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/284E0EF5/case.py b/tests/284E0EF5/case.py index 560918558..7be4b7d31 100644 --- a/tests/284E0EF5/case.py +++ b/tests/284E0EF5/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/2A523AC1/case.py b/tests/2A523AC1/case.py index 26b38e9d3..6b22f0e4f 100644 --- a/tests/2A523AC1/case.py +++ b/tests/2A523AC1/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 1, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/2A6136EF/case.py b/tests/2A6136EF/case.py index bdb1d748d..b5e260398 100644 --- a/tests/2A6136EF/case.py +++ b/tests/2A6136EF/case.py @@ -137,7 +137,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/2AB32975/case.py b/tests/2AB32975/case.py index 32f44a54c..674937534 100644 --- a/tests/2AB32975/case.py +++ b/tests/2AB32975/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/2E021372/case.py b/tests/2E021372/case.py index 42ffd0c7f..fe9a7211d 100644 --- a/tests/2E021372/case.py +++ b/tests/2E021372/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/2F35A1FE/case.py b/tests/2F35A1FE/case.py index 01d48c148..4a090bdb9 100644 --- a/tests/2F35A1FE/case.py +++ b/tests/2F35A1FE/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/2FD933A2/case.py b/tests/2FD933A2/case.py index e37b64c49..95dd965eb 100644 --- a/tests/2FD933A2/case.py +++ b/tests/2FD933A2/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/301B9153/case.py b/tests/301B9153/case.py index 892ad5ab9..33812e49d 100644 --- a/tests/301B9153/case.py +++ b/tests/301B9153/case.py @@ -161,7 +161,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/303B925A/case.py b/tests/303B925A/case.py index 86231016d..97a7197cf 100644 --- a/tests/303B925A/case.py +++ b/tests/303B925A/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/32D0F235/case.py b/tests/32D0F235/case.py index 417fe0f60..f29fe806b 100644 --- a/tests/32D0F235/case.py +++ b/tests/32D0F235/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 1, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/34580912/case.py b/tests/34580912/case.py index e072d209e..4df5a7f6b 100644 --- a/tests/34580912/case.py +++ b/tests/34580912/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/345A94C0/case.py b/tests/345A94C0/case.py index 01974e992..725167223 100644 --- a/tests/345A94C0/case.py +++ b/tests/345A94C0/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 2, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/34DBFE14/case.py b/tests/34DBFE14/case.py index 384360fe5..ec5b0e234 100644 --- a/tests/34DBFE14/case.py +++ b/tests/34DBFE14/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/361D2A9B/case.py b/tests/361D2A9B/case.py index 81a590f76..321bb8318 100644 --- a/tests/361D2A9B/case.py +++ b/tests/361D2A9B/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/36256906/case.py b/tests/36256906/case.py index a04944b23..5a5d5b019 100644 --- a/tests/36256906/case.py +++ b/tests/36256906/case.py @@ -166,7 +166,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/38533D07/case.py b/tests/38533D07/case.py index 50d81ca5b..cdacde696 100644 --- a/tests/38533D07/case.py +++ b/tests/38533D07/case.py @@ -164,7 +164,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/3974AC7B/case.py b/tests/3974AC7B/case.py index 1bb33d4dd..ef3f11c47 100644 --- a/tests/3974AC7B/case.py +++ b/tests/3974AC7B/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/3A8359F6/case.py b/tests/3A8359F6/case.py index 53afed7c8..e5df97366 100644 --- a/tests/3A8359F6/case.py +++ b/tests/3A8359F6/case.py @@ -131,7 +131,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/3AE495F4/case.py b/tests/3AE495F4/case.py index ebc4658b5..56b8d3262 100644 --- a/tests/3AE495F4/case.py +++ b/tests/3AE495F4/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/3B414AF0/case.py b/tests/3B414AF0/case.py index f600496c5..2e9a62302 100644 --- a/tests/3B414AF0/case.py +++ b/tests/3B414AF0/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/3BFEAC19/case.py b/tests/3BFEAC19/case.py index 119b84fd9..8f926db2c 100644 --- a/tests/3BFEAC19/case.py +++ b/tests/3BFEAC19/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 1, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/3C00B89D/case.py b/tests/3C00B89D/case.py index c5c0cfa3a..f66685244 100644 --- a/tests/3C00B89D/case.py +++ b/tests/3C00B89D/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 2, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/3FC6FC4A/case.py b/tests/3FC6FC4A/case.py index c70064444..1a3f8d336 100644 --- a/tests/3FC6FC4A/case.py +++ b/tests/3FC6FC4A/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/4129A23A/case.py b/tests/4129A23A/case.py index dc9759056..860956898 100644 --- a/tests/4129A23A/case.py +++ b/tests/4129A23A/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/42B169F5/case.py b/tests/42B169F5/case.py index 2e52037a3..896783b63 100644 --- a/tests/42B169F5/case.py +++ b/tests/42B169F5/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/461DCB09/case.py b/tests/461DCB09/case.py index 7917913fe..87fb38093 100644 --- a/tests/461DCB09/case.py +++ b/tests/461DCB09/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 2, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -131,7 +131,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/46AA7AF8/case.py b/tests/46AA7AF8/case.py index 435784183..8c3202cad 100644 --- a/tests/46AA7AF8/case.py +++ b/tests/46AA7AF8/case.py @@ -137,7 +137,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/48B9D0C4/case.py b/tests/48B9D0C4/case.py index d494fa983..e1c1b845c 100644 --- a/tests/48B9D0C4/case.py +++ b/tests/48B9D0C4/case.py @@ -164,7 +164,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/48CCE072/case.py b/tests/48CCE072/case.py index 7345a9245..72649cee6 100644 --- a/tests/48CCE072/case.py +++ b/tests/48CCE072/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/4AEF478A/case.py b/tests/4AEF478A/case.py index af1c30ea4..344d04231 100644 --- a/tests/4AEF478A/case.py +++ b/tests/4AEF478A/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 1, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/4D7926CD/case.py b/tests/4D7926CD/case.py index e0f591b2d..b04ffbd30 100644 --- a/tests/4D7926CD/case.py +++ b/tests/4D7926CD/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/4F2F4ACE/case.py b/tests/4F2F4ACE/case.py index 4a4e495ac..aa16f2190 100644 --- a/tests/4F2F4ACE/case.py +++ b/tests/4F2F4ACE/case.py @@ -144,7 +144,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/5010B814/case.py b/tests/5010B814/case.py index 5fddab54a..9d56297d2 100644 --- a/tests/5010B814/case.py +++ b/tests/5010B814/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/50A8B1FE/case.py b/tests/50A8B1FE/case.py index af8ec9576..da620478d 100644 --- a/tests/50A8B1FE/case.py +++ b/tests/50A8B1FE/case.py @@ -137,7 +137,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/5281BD7B/case.py b/tests/5281BD7B/case.py index 6e473da47..8a92701f2 100644 --- a/tests/5281BD7B/case.py +++ b/tests/5281BD7B/case.py @@ -156,7 +156,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/53E13D19/case.py b/tests/53E13D19/case.py index c112f71dc..644c9d24d 100644 --- a/tests/53E13D19/case.py +++ b/tests/53E13D19/case.py @@ -138,7 +138,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/541A30DB/case.py b/tests/541A30DB/case.py index 2d428865d..10e581cb7 100644 --- a/tests/541A30DB/case.py +++ b/tests/541A30DB/case.py @@ -164,7 +164,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/5527832F/case.py b/tests/5527832F/case.py index 097a6274e..8c70c81f6 100644 --- a/tests/5527832F/case.py +++ b/tests/5527832F/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/55533234/case.py b/tests/55533234/case.py index bbab76345..d468f6c11 100644 --- a/tests/55533234/case.py +++ b/tests/55533234/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/557FF170/case.py b/tests/557FF170/case.py index 06db68dd4..8a3b8fd2f 100644 --- a/tests/557FF170/case.py +++ b/tests/557FF170/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/5781A4C2/case.py b/tests/5781A4C2/case.py index e66da5ed7..5dc19d5c0 100644 --- a/tests/5781A4C2/case.py +++ b/tests/5781A4C2/case.py @@ -144,7 +144,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/59B127EF/case.py b/tests/59B127EF/case.py index 8e594b756..c56191410 100644 --- a/tests/59B127EF/case.py +++ b/tests/59B127EF/case.py @@ -139,7 +139,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/59D05DE9/case.py b/tests/59D05DE9/case.py index bffd8092d..0874eefa5 100644 --- a/tests/59D05DE9/case.py +++ b/tests/59D05DE9/case.py @@ -137,7 +137,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/5DAB50B2/case.py b/tests/5DAB50B2/case.py index 09ab1cfd1..85f08cd26 100644 --- a/tests/5DAB50B2/case.py +++ b/tests/5DAB50B2/case.py @@ -144,7 +144,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/5E2265C4/case.py b/tests/5E2265C4/case.py index e23d1c641..6cd69e6c5 100644 --- a/tests/5E2265C4/case.py +++ b/tests/5E2265C4/case.py @@ -138,7 +138,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/5E454E32/case.py b/tests/5E454E32/case.py index 946f75801..101eda554 100644 --- a/tests/5E454E32/case.py +++ b/tests/5E454E32/case.py @@ -150,7 +150,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/5EC236F2/case.py b/tests/5EC236F2/case.py index 2ac9c06e6..0958071cb 100644 --- a/tests/5EC236F2/case.py +++ b/tests/5EC236F2/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/5F877BC9/case.py b/tests/5F877BC9/case.py index 62f6f48fb..b952c531e 100644 --- a/tests/5F877BC9/case.py +++ b/tests/5F877BC9/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/61FFF3D3/case.py b/tests/61FFF3D3/case.py index 8a7b034da..4639cf1a7 100644 --- a/tests/61FFF3D3/case.py +++ b/tests/61FFF3D3/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/622DEC78/case.py b/tests/622DEC78/case.py index cffe9bfae..5b8316ea9 100644 --- a/tests/622DEC78/case.py +++ b/tests/622DEC78/case.py @@ -166,7 +166,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/6241177B/case.py b/tests/6241177B/case.py index 12217035d..0e09e4103 100644 --- a/tests/6241177B/case.py +++ b/tests/6241177B/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/6249EDDE/case.py b/tests/6249EDDE/case.py index b4dc90ff5..3e694f86f 100644 --- a/tests/6249EDDE/case.py +++ b/tests/6249EDDE/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/63850240/case.py b/tests/63850240/case.py index d6e7532d5..10f73b6c8 100644 --- a/tests/63850240/case.py +++ b/tests/63850240/case.py @@ -166,7 +166,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/645A26E3/case.py b/tests/645A26E3/case.py index 322e049cd..1a4952387 100644 --- a/tests/645A26E3/case.py +++ b/tests/645A26E3/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 2, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -144,7 +144,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/64E032D7/case.py b/tests/64E032D7/case.py index 9cb85734c..9faa424c0 100644 --- a/tests/64E032D7/case.py +++ b/tests/64E032D7/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/66CFF8CC/case.py b/tests/66CFF8CC/case.py index 0c54223f2..8376fc1ef 100644 --- a/tests/66CFF8CC/case.py +++ b/tests/66CFF8CC/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/6784C02E/case.py b/tests/6784C02E/case.py index 88155cd2c..d188a30dc 100644 --- a/tests/6784C02E/case.py +++ b/tests/6784C02E/case.py @@ -138,7 +138,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/6B22A317/case.py b/tests/6B22A317/case.py index 7b0885c9b..cfd1de476 100644 --- a/tests/6B22A317/case.py +++ b/tests/6B22A317/case.py @@ -137,7 +137,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/6B4B738B/case.py b/tests/6B4B738B/case.py index c5b75d071..1a7ed9161 100644 --- a/tests/6B4B738B/case.py +++ b/tests/6B4B738B/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/6D24B115/case.py b/tests/6D24B115/case.py index f6c90a183..07cca224c 100644 --- a/tests/6D24B115/case.py +++ b/tests/6D24B115/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 2, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -131,7 +131,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/6F296065/case.py b/tests/6F296065/case.py index 76ea9c5b1..60e65e2ec 100644 --- a/tests/6F296065/case.py +++ b/tests/6F296065/case.py @@ -162,7 +162,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/6FC6A809/case.py b/tests/6FC6A809/case.py index b76a205ef..92ce7164b 100644 --- a/tests/6FC6A809/case.py +++ b/tests/6FC6A809/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/7077C99F/case.py b/tests/7077C99F/case.py index 51db3850a..a13916da1 100644 --- a/tests/7077C99F/case.py +++ b/tests/7077C99F/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/70DAE9E8/case.py b/tests/70DAE9E8/case.py index a5f94e42c..dd36a0ff3 100644 --- a/tests/70DAE9E8/case.py +++ b/tests/70DAE9E8/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/727F72ED/case.py b/tests/727F72ED/case.py index b4ed107b0..e77aa942e 100644 --- a/tests/727F72ED/case.py +++ b/tests/727F72ED/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/728A2A5B/case.py b/tests/728A2A5B/case.py index 05f806420..db49a3e43 100644 --- a/tests/728A2A5B/case.py +++ b/tests/728A2A5B/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/729A4333/case.py b/tests/729A4333/case.py index cdbd1a1b8..ad6bb9047 100644 --- a/tests/729A4333/case.py +++ b/tests/729A4333/case.py @@ -138,7 +138,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/72FD6FF5/case.py b/tests/72FD6FF5/case.py index c4a2ab53e..630df15a6 100644 --- a/tests/72FD6FF5/case.py +++ b/tests/72FD6FF5/case.py @@ -164,7 +164,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/730DFD6D/case.py b/tests/730DFD6D/case.py index 353575f78..b20ba63e8 100644 --- a/tests/730DFD6D/case.py +++ b/tests/730DFD6D/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/7374E266/case.py b/tests/7374E266/case.py index 0d9627e5c..1c728b859 100644 --- a/tests/7374E266/case.py +++ b/tests/7374E266/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/73B0539E/case.py b/tests/73B0539E/case.py index e48783b2d..a6f1e685c 100644 --- a/tests/73B0539E/case.py +++ b/tests/73B0539E/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 1, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/758D0268/case.py b/tests/758D0268/case.py index 5693e3ef9..2b8d33ec9 100644 --- a/tests/758D0268/case.py +++ b/tests/758D0268/case.py @@ -157,7 +157,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/786DE444/case.py b/tests/786DE444/case.py index 6c7216f56..632d72a0a 100644 --- a/tests/786DE444/case.py +++ b/tests/786DE444/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/7C8F1BA9/case.py b/tests/7C8F1BA9/case.py index c61ad321b..375534282 100644 --- a/tests/7C8F1BA9/case.py +++ b/tests/7C8F1BA9/case.py @@ -157,7 +157,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/7DEA8C54/case.py b/tests/7DEA8C54/case.py index 6eb241e3a..ca6d2d517 100644 --- a/tests/7DEA8C54/case.py +++ b/tests/7DEA8C54/case.py @@ -152,7 +152,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/7EFBCDAE/case.py b/tests/7EFBCDAE/case.py index 87fae3667..4504b0737 100644 --- a/tests/7EFBCDAE/case.py +++ b/tests/7EFBCDAE/case.py @@ -169,7 +169,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/7FC6826B/case.py b/tests/7FC6826B/case.py index 376188b25..29bc448e1 100644 --- a/tests/7FC6826B/case.py +++ b/tests/7FC6826B/case.py @@ -137,7 +137,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/83291843/case.py b/tests/83291843/case.py index c121c7819..ac303460c 100644 --- a/tests/83291843/case.py +++ b/tests/83291843/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/8360C26B/case.py b/tests/8360C26B/case.py index 9b7cde1a9..14510752a 100644 --- a/tests/8360C26B/case.py +++ b/tests/8360C26B/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/83EFC30C/case.py b/tests/83EFC30C/case.py index d662444f9..29500e655 100644 --- a/tests/83EFC30C/case.py +++ b/tests/83EFC30C/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 1, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -131,7 +131,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/84017671/case.py b/tests/84017671/case.py index 1b586cbba..41ac7a424 100644 --- a/tests/84017671/case.py +++ b/tests/84017671/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/842C6FFC/case.py b/tests/842C6FFC/case.py index 16be94302..fce767cff 100644 --- a/tests/842C6FFC/case.py +++ b/tests/842C6FFC/case.py @@ -138,7 +138,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/851F7AE2/case.py b/tests/851F7AE2/case.py index 5456ead6a..7b8812753 100644 --- a/tests/851F7AE2/case.py +++ b/tests/851F7AE2/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 1, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -157,7 +157,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/8A341282/case.py b/tests/8A341282/case.py index e65afe6af..3a1bf03fc 100644 --- a/tests/8A341282/case.py +++ b/tests/8A341282/case.py @@ -166,7 +166,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/8A59E8E6/case.py b/tests/8A59E8E6/case.py index 0dc97f07a..ef709eebb 100644 --- a/tests/8A59E8E6/case.py +++ b/tests/8A59E8E6/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/8B679445/case.py b/tests/8B679445/case.py index 8750e3d5d..2b8ad413d 100644 --- a/tests/8B679445/case.py +++ b/tests/8B679445/case.py @@ -164,7 +164,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/8BCBAED8/case.py b/tests/8BCBAED8/case.py index 2fe1a47e2..aa18893b5 100644 --- a/tests/8BCBAED8/case.py +++ b/tests/8BCBAED8/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/8C7AA13B/case.py b/tests/8C7AA13B/case.py index 1645f40b3..cf0d2c3d3 100644 --- a/tests/8C7AA13B/case.py +++ b/tests/8C7AA13B/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/8E3D99E6/case.py b/tests/8E3D99E6/case.py index 1aea240ef..5117f5131 100644 --- a/tests/8E3D99E6/case.py +++ b/tests/8E3D99E6/case.py @@ -125,7 +125,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/8EAC3DA7/case.py b/tests/8EAC3DA7/case.py index a7d47f9e8..c505f54b0 100644 --- a/tests/8EAC3DA7/case.py +++ b/tests/8EAC3DA7/case.py @@ -125,7 +125,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/8FDEE23A/case.py b/tests/8FDEE23A/case.py index 4a254453c..624ba9327 100644 --- a/tests/8FDEE23A/case.py +++ b/tests/8FDEE23A/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/939D6718/case.py b/tests/939D6718/case.py index b570880f7..50f81adb4 100644 --- a/tests/939D6718/case.py +++ b/tests/939D6718/case.py @@ -166,7 +166,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/9465D0F5/case.py b/tests/9465D0F5/case.py index d723d4e6b..c8a182c34 100644 --- a/tests/9465D0F5/case.py +++ b/tests/9465D0F5/case.py @@ -138,7 +138,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/98081DA3/case.py b/tests/98081DA3/case.py index 2ff16fa54..d87e2e4a7 100644 --- a/tests/98081DA3/case.py +++ b/tests/98081DA3/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/9ACD5174/case.py b/tests/9ACD5174/case.py index 4cd83d5d9..1736e870b 100644 --- a/tests/9ACD5174/case.py +++ b/tests/9ACD5174/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/9CB03CEF/case.py b/tests/9CB03CEF/case.py index 36ff14983..7ace2ee4b 100644 --- a/tests/9CB03CEF/case.py +++ b/tests/9CB03CEF/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/9DAC4DDC/case.py b/tests/9DAC4DDC/case.py index 8017c1a80..f7b5c2306 100644 --- a/tests/9DAC4DDC/case.py +++ b/tests/9DAC4DDC/case.py @@ -131,7 +131,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/9EB947DB/case.py b/tests/9EB947DB/case.py index 8bce432b0..0f6081d2f 100644 --- a/tests/9EB947DB/case.py +++ b/tests/9EB947DB/case.py @@ -128,7 +128,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/9EF19F0A/case.py b/tests/9EF19F0A/case.py index 1b5690a85..be830863c 100644 --- a/tests/9EF19F0A/case.py +++ b/tests/9EF19F0A/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/9F3B58E7/case.py b/tests/9F3B58E7/case.py index 42b1c9453..ec5714ff3 100644 --- a/tests/9F3B58E7/case.py +++ b/tests/9F3B58E7/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/A0B82851/case.py b/tests/A0B82851/case.py index 9e3ded3e9..389be206f 100644 --- a/tests/A0B82851/case.py +++ b/tests/A0B82851/case.py @@ -157,7 +157,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/A5C93D62/case.py b/tests/A5C93D62/case.py index 68f5a4db8..9220e7c01 100644 --- a/tests/A5C93D62/case.py +++ b/tests/A5C93D62/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 1, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -144,7 +144,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/A60691E7/case.py b/tests/A60691E7/case.py index 90d2b0412..f6176ff0a 100644 --- a/tests/A60691E7/case.py +++ b/tests/A60691E7/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/A6AC2E06/case.py b/tests/A6AC2E06/case.py index 92ef62037..3cf9e3069 100644 --- a/tests/A6AC2E06/case.py +++ b/tests/A6AC2E06/case.py @@ -144,7 +144,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/A6E65782/case.py b/tests/A6E65782/case.py index 81c627bff..d964b65a6 100644 --- a/tests/A6E65782/case.py +++ b/tests/A6E65782/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/A6EEAE2D/case.py b/tests/A6EEAE2D/case.py index 1ab3af561..6747f1615 100644 --- a/tests/A6EEAE2D/case.py +++ b/tests/A6EEAE2D/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/A83CADB5/case.py b/tests/A83CADB5/case.py index 7b5e81ca9..3e7a75f64 100644 --- a/tests/A83CADB5/case.py +++ b/tests/A83CADB5/case.py @@ -138,7 +138,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/AACF1BC5/case.py b/tests/AACF1BC5/case.py index 503a74ad4..ec2d51934 100644 --- a/tests/AACF1BC5/case.py +++ b/tests/AACF1BC5/case.py @@ -157,7 +157,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/AB04C64D/case.py b/tests/AB04C64D/case.py index ce4ca4719..353ff19b0 100644 --- a/tests/AB04C64D/case.py +++ b/tests/AB04C64D/case.py @@ -166,7 +166,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/AB0BE4E4/case.py b/tests/AB0BE4E4/case.py index 559e05d6a..118e9e882 100644 --- a/tests/AB0BE4E4/case.py +++ b/tests/AB0BE4E4/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 2, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/ABAC3AE3/case.py b/tests/ABAC3AE3/case.py index 4340995a9..4ffbcd1d1 100644 --- a/tests/ABAC3AE3/case.py +++ b/tests/ABAC3AE3/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/AD63A4A5/case.py b/tests/AD63A4A5/case.py index a70403e5c..29e20f8b8 100644 --- a/tests/AD63A4A5/case.py +++ b/tests/AD63A4A5/case.py @@ -166,7 +166,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/AE37D842/case.py b/tests/AE37D842/case.py index 88b89bb12..e86ce9507 100644 --- a/tests/AE37D842/case.py +++ b/tests/AE37D842/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/AED93D34/case.py b/tests/AED93D34/case.py index 5ba049edf..2d75b9a62 100644 --- a/tests/AED93D34/case.py +++ b/tests/AED93D34/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/AF0BCEE4/case.py b/tests/AF0BCEE4/case.py index cab940167..4589e493c 100644 --- a/tests/AF0BCEE4/case.py +++ b/tests/AF0BCEE4/case.py @@ -137,7 +137,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/AF46C382/case.py b/tests/AF46C382/case.py index 854fa376e..6638b3dd2 100644 --- a/tests/AF46C382/case.py +++ b/tests/AF46C382/case.py @@ -137,7 +137,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/B33E256A/case.py b/tests/B33E256A/case.py index a876a9553..7b87a579f 100644 --- a/tests/B33E256A/case.py +++ b/tests/B33E256A/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 2, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -157,7 +157,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/B3AAC9C8/case.py b/tests/B3AAC9C8/case.py index d0809f4c7..cdd89c2e6 100644 --- a/tests/B3AAC9C8/case.py +++ b/tests/B3AAC9C8/case.py @@ -150,7 +150,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/B3C85904/case.py b/tests/B3C85904/case.py index a608fb161..4f23aae16 100644 --- a/tests/B3C85904/case.py +++ b/tests/B3C85904/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/B7250A5B/case.py b/tests/B7250A5B/case.py index 92f9808f1..4d1397ca3 100644 --- a/tests/B7250A5B/case.py +++ b/tests/B7250A5B/case.py @@ -163,7 +163,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/B89B8C70/case.py b/tests/B89B8C70/case.py index f0fee1c27..28dd0092f 100644 --- a/tests/B89B8C70/case.py +++ b/tests/B89B8C70/case.py @@ -145,7 +145,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/B8F5F1C8/case.py b/tests/B8F5F1C8/case.py index 284366a22..a390f566d 100644 --- a/tests/B8F5F1C8/case.py +++ b/tests/B8F5F1C8/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 2, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -157,7 +157,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/B96AC58F/case.py b/tests/B96AC58F/case.py index 8bc22fa5d..dfbda89c4 100644 --- a/tests/B96AC58F/case.py +++ b/tests/B96AC58F/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/BD8004FF/case.py b/tests/BD8004FF/case.py index 8deb05209..ebac0c547 100644 --- a/tests/BD8004FF/case.py +++ b/tests/BD8004FF/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 1, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -157,7 +157,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/BDD3411B/case.py b/tests/BDD3411B/case.py index ea31a28c0..a8fa92df1 100644 --- a/tests/BDD3411B/case.py +++ b/tests/BDD3411B/case.py @@ -178,7 +178,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/BF46F657/case.py b/tests/BF46F657/case.py index 10f70341a..dad25df6c 100644 --- a/tests/BF46F657/case.py +++ b/tests/BF46F657/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/C04741B4/case.py b/tests/C04741B4/case.py index 40063fbd1..ae2155beb 100644 --- a/tests/C04741B4/case.py +++ b/tests/C04741B4/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/C06849AD/case.py b/tests/C06849AD/case.py index c4bff2a18..f716a2c11 100644 --- a/tests/C06849AD/case.py +++ b/tests/C06849AD/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/C36F18FB/case.py b/tests/C36F18FB/case.py index 3bfd57531..3c113ea09 100644 --- a/tests/C36F18FB/case.py +++ b/tests/C36F18FB/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 2, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/C4907722/case.py b/tests/C4907722/case.py index 66886e70b..cf2655c1e 100644 --- a/tests/C4907722/case.py +++ b/tests/C4907722/case.py @@ -131,7 +131,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/C4A2FAA3/case.py b/tests/C4A2FAA3/case.py index 6cb049b4a..3612e8eee 100644 --- a/tests/C4A2FAA3/case.py +++ b/tests/C4A2FAA3/case.py @@ -157,7 +157,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/C5B79059/case.py b/tests/C5B79059/case.py index a1dfae831..09e35fab9 100644 --- a/tests/C5B79059/case.py +++ b/tests/C5B79059/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/C79E1D3C/case.py b/tests/C79E1D3C/case.py index 6503e8f9f..3a4612291 100644 --- a/tests/C79E1D3C/case.py +++ b/tests/C79E1D3C/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/C93BE9B5/case.py b/tests/C93BE9B5/case.py index f62b206b9..5e54adb9f 100644 --- a/tests/C93BE9B5/case.py +++ b/tests/C93BE9B5/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/CC4F7C44/case.py b/tests/CC4F7C44/case.py index f40f6fd1f..d60a00f04 100644 --- a/tests/CC4F7C44/case.py +++ b/tests/CC4F7C44/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/CD3D9660/case.py b/tests/CD3D9660/case.py index d7befd63f..7e3e444ec 100644 --- a/tests/CD3D9660/case.py +++ b/tests/CD3D9660/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/CD6DC908/case.py b/tests/CD6DC908/case.py index 352b375ae..217872a8b 100644 --- a/tests/CD6DC908/case.py +++ b/tests/CD6DC908/case.py @@ -138,7 +138,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/CD9D3050/case.py b/tests/CD9D3050/case.py index 94a6869f2..1624492e7 100644 --- a/tests/CD9D3050/case.py +++ b/tests/CD9D3050/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/CE232828/case.py b/tests/CE232828/case.py index 827618017..7c21ce41a 100644 --- a/tests/CE232828/case.py +++ b/tests/CE232828/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/CFE87594/case.py b/tests/CFE87594/case.py index 63c19efe1..752f9d835 100644 --- a/tests/CFE87594/case.py +++ b/tests/CFE87594/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/D0045756/case.py b/tests/D0045756/case.py index 502b66e31..19ec0beb2 100644 --- a/tests/D0045756/case.py +++ b/tests/D0045756/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/D3C860B9/case.py b/tests/D3C860B9/case.py index 32180a2c7..a8bc357ce 100644 --- a/tests/D3C860B9/case.py +++ b/tests/D3C860B9/case.py @@ -162,7 +162,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/D6BAC936/case.py b/tests/D6BAC936/case.py index 492154dff..14810dff6 100644 --- a/tests/D6BAC936/case.py +++ b/tests/D6BAC936/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/D79C3E6F/case.py b/tests/D79C3E6F/case.py index dcaf2c8bf..c69e3bddf 100644 --- a/tests/D79C3E6F/case.py +++ b/tests/D79C3E6F/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/D972BA0F/case.py b/tests/D972BA0F/case.py index 562cdc02b..c25c05602 100644 --- a/tests/D972BA0F/case.py +++ b/tests/D972BA0F/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/DA8AF07E/case.py b/tests/DA8AF07E/case.py index d1f9284fa..578ce17c1 100644 --- a/tests/DA8AF07E/case.py +++ b/tests/DA8AF07E/case.py @@ -151,7 +151,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/DB670E50/case.py b/tests/DB670E50/case.py index 7ab8fe079..f4bd46ffe 100644 --- a/tests/DB670E50/case.py +++ b/tests/DB670E50/case.py @@ -145,7 +145,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/DC46C302/case.py b/tests/DC46C302/case.py index c309a68c6..82d40e364 100644 --- a/tests/DC46C302/case.py +++ b/tests/DC46C302/case.py @@ -137,7 +137,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/DC9CB97E/case.py b/tests/DC9CB97E/case.py index 8afa4dfb8..7b7053306 100644 --- a/tests/DC9CB97E/case.py +++ b/tests/DC9CB97E/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 1, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -144,7 +144,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/DCB3BC6C/case.py b/tests/DCB3BC6C/case.py index c2ed51280..7adb9b4eb 100644 --- a/tests/DCB3BC6C/case.py +++ b/tests/DCB3BC6C/case.py @@ -164,7 +164,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/E09A12D9/case.py b/tests/E09A12D9/case.py index a3eebc00e..deceb6ecb 100644 --- a/tests/E09A12D9/case.py +++ b/tests/E09A12D9/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/E1352143/case.py b/tests/E1352143/case.py index e069020b9..a70a57af1 100644 --- a/tests/E1352143/case.py +++ b/tests/E1352143/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/E4EFEDB2/case.py b/tests/E4EFEDB2/case.py index c1112c6d3..2258e8025 100644 --- a/tests/E4EFEDB2/case.py +++ b/tests/E4EFEDB2/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/E76D41CE/case.py b/tests/E76D41CE/case.py index 12d8f8f72..8236bfffa 100644 --- a/tests/E76D41CE/case.py +++ b/tests/E76D41CE/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/E84967E7/case.py b/tests/E84967E7/case.py index 361d42d19..0aa523703 100644 --- a/tests/E84967E7/case.py +++ b/tests/E84967E7/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/E8C28D5B/case.py b/tests/E8C28D5B/case.py index 1f3f7360e..247355933 100644 --- a/tests/E8C28D5B/case.py +++ b/tests/E8C28D5B/case.py @@ -138,7 +138,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/EAA53889/case.py b/tests/EAA53889/case.py index 0adc10f31..b00de923d 100644 --- a/tests/EAA53889/case.py +++ b/tests/EAA53889/case.py @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/ED728400/case.py b/tests/ED728400/case.py index 251a72abf..5971023cc 100644 --- a/tests/ED728400/case.py +++ b/tests/ED728400/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/EF54219C/case.py b/tests/EF54219C/case.py index 49d42380f..b49d695cc 100644 --- a/tests/EF54219C/case.py +++ b/tests/EF54219C/case.py @@ -137,7 +137,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/F0E6771E/case.py b/tests/F0E6771E/case.py index ed268fb7a..cd3b6cc40 100644 --- a/tests/F0E6771E/case.py +++ b/tests/F0E6771E/case.py @@ -157,7 +157,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/F0F175B2/case.py b/tests/F0F175B2/case.py index 481e459d0..9315c3113 100644 --- a/tests/F0F175B2/case.py +++ b/tests/F0F175B2/case.py @@ -144,7 +144,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/F1457D58/case.py b/tests/F1457D58/case.py index a911bea6f..196513d8a 100644 --- a/tests/F1457D58/case.py +++ b/tests/F1457D58/case.py @@ -166,7 +166,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/F4F6AC27/case.py b/tests/F4F6AC27/case.py index 1887f1ae5..69b3ac72c 100644 --- a/tests/F4F6AC27/case.py +++ b/tests/F4F6AC27/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 2, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/F5890628/case.py b/tests/F5890628/case.py index 67521c744..eb63afdd5 100644 --- a/tests/F5890628/case.py +++ b/tests/F5890628/case.py @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/F97573DB/case.py b/tests/F97573DB/case.py index 92291d55d..29ef59d62 100644 --- a/tests/F97573DB/case.py +++ b/tests/F97573DB/case.py @@ -41,7 +41,7 @@ "mp_weno": "F", "riemann_solver": 2, "wave_speeds": 1, - "avg_state": "1", + "avg_state": 1, "format": 1, "precision": 2, "prim_vars_wrt": "F", @@ -123,7 +123,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/F99FBB36/case.py b/tests/F99FBB36/case.py index c9b26aecd..150c3dfd9 100644 --- a/tests/F99FBB36/case.py +++ b/tests/F99FBB36/case.py @@ -149,7 +149,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/FB822062/case.py b/tests/FB822062/case.py index 62e015e89..b28167598 100644 --- a/tests/FB822062/case.py +++ b/tests/FB822062/case.py @@ -150,7 +150,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/FBF808BE/case.py b/tests/FBF808BE/case.py index bf07cf941..a67fb8aae 100644 --- a/tests/FBF808BE/case.py +++ b/tests/FBF808BE/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 1, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -136,7 +136,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/FC4D07B6/case.py b/tests/FC4D07B6/case.py index d22b342e1..f109ec74e 100644 --- a/tests/FC4D07B6/case.py +++ b/tests/FC4D07B6/case.py @@ -40,7 +40,7 @@ "null_weights": "F", "mp_weno": "F", "riemann_solver": 2, - "wave_speeds": "2", + "wave_speeds": 2, "avg_state": 2, "format": 1, "precision": 2, @@ -144,7 +144,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/FD891191/case.py b/tests/FD891191/case.py index 1e77af27c..b16cd6bce 100644 --- a/tests/FD891191/case.py +++ b/tests/FD891191/case.py @@ -131,7 +131,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/tests/FE3E35C4/case.py b/tests/FE3E35C4/case.py index 961c9716a..164a96b16 100644 --- a/tests/FE3E35C4/case.py +++ b/tests/FE3E35C4/case.py @@ -138,7 +138,7 @@ 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', } - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' diff --git a/toolchain/bootstrap/lint.sh b/toolchain/bootstrap/lint.sh new file mode 100644 index 000000000..ea8934b3b --- /dev/null +++ b/toolchain/bootstrap/lint.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +log "(venv) Running$MAGENTA pylint$COLOR_RESET on$MAGENTA MFC$COLOR_RESET's $MAGENTA""toolchain$COLOR_RESET." + +pylint -d R1722,W0718,C0301,C0116,C0115,C0114,C0410,W0622,W0640,C0103,W1309,C0411,W1514,R0401 "$(pwd)/toolchain/" + +exit $? diff --git a/toolchain/mfc.py b/toolchain/main.py similarity index 91% rename from toolchain/mfc.py rename to toolchain/main.py index c783781b2..d9bdfb9fc 100644 --- a/toolchain/mfc.py +++ b/toolchain/main.py @@ -12,14 +12,13 @@ def __print_greeting(): MFC_LOGO_LINES = MFC_LOGO.splitlines() - max_logo_line_length = max([ len(line) for line in MFC_LOGO_LINES ]) + max_logo_line_length = max(len(line) for line in MFC_LOGO_LINES) host_line = f"{getpass.getuser()}@{platform.node()} [{platform.system()}]" targets_line = f"[bold]--targets {format_list_to_string(ARG('targets'), 'magenta', 'None')}[/bold]" - help_line = "$ ./mfc.sh \[build, run, test, clean, count, packer] --help" + help_line = "$ ./mfc.sh (build, run, test, clean, count, packer) --help" MFC_SIDEBAR_LINES = [ - "", f"[bold]{host_line}[/bold]", '-' * len(host_line), f"[bold]--jobs [magenta]{ARG('jobs')}[/magenta][/bold]" @@ -35,7 +34,7 @@ def __print_greeting(): lhs = a.ljust(max_logo_line_length) rhs = b if b is not None else '' cons.print( - f"[bold] {lhs} [/bold] {rhs}", + f"[bold]{lhs}[/bold] | {rhs}", highlight=False ) @@ -47,7 +46,7 @@ def __checks(): raise MFCException("CMake is required to build MFC but couldn't be located on your system. Please ensure it installed and discoverable (e.g in your system's $PATH).") -def __run(): +def __run(): {"test": test.test, "run": run.run, "build": build.build, "clean": build.clean, "bench": bench.bench, "count": count.count, "packer": packer.packer @@ -60,7 +59,7 @@ def __run(): state.gARG = args.parse(state.gCFG) lock.switch(state.MFCConfig.from_dict(state.gARG)) - + __print_greeting() __checks() __run() diff --git a/toolchain/mfc/args.py b/toolchain/mfc/args.py index 7d7a4ca12..a9984ff2c 100644 --- a/toolchain/mfc/args.py +++ b/toolchain/mfc/args.py @@ -2,16 +2,15 @@ from .build import TARGETS, DEFAULT_TARGETS, DEPENDENCY_TARGETS from .common import MFCException, format_list_to_string -from .test.test import CASES as TEST_CASES -from .packer import packer +from .test.cases import generate_cases +from .run.engines import ENGINES +from .run.mpi_bins import BINARIES +# pylint: disable=too-many-locals, too-many-statements def parse(config): - from .run.engines import ENGINES - from .run.mpi_bins import BINARIES - parser = argparse.ArgumentParser( prog="./mfc.sh", - description=f"""\ + description="""\ Welcome to the MFC master script. This tool automates and manages building, testing, \ running, and cleaning of MFC in various configurations on all supported platforms. \ The README documents this tool and its various commands in more detail. To get \ @@ -19,7 +18,7 @@ def parse(config): formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) - parsers = parser.add_subparsers(dest="command") + parsers = parser.add_subparsers(dest="command") run = parsers.add_parser(name="run", help="Run a case with MFC.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) test = parsers.add_parser(name="test", help="Run MFC's test suite.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) build = parsers.add_parser(name="build", help="Build MFC and its dependencies.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) @@ -27,12 +26,12 @@ def parse(config): bench = parsers.add_parser(name="bench", help="Benchmark MFC (for CI).", formatter_class=argparse.ArgumentDefaultsHelpFormatter) count = parsers.add_parser(name="count", help="Count LOC in MFC.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) packer = parsers.add_parser(name="packer", help="Packer utility (pack/unpack/compare)", formatter_class=argparse.ArgumentDefaultsHelpFormatter) - + packers = packer.add_subparsers(dest="packer") pack = packers.add_parser(name="pack", help="Pack a case into a single file.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) pack.add_argument("input", metavar="INPUT", type=str, default="", help="Input file of case to pack.") pack.add_argument("-o", "--output", metavar="OUTPUT", type=str, default=None, help="Base name of output file.") - + compare = packers.add_parser(name="compare", help="Compare two cases.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) compare.add_argument("input1", metavar="INPUT1", type=str, default=None, help="First pack file.") compare.add_argument("input2", metavar="INPUT2", type=str, default=None, help="Second pack file.") @@ -54,7 +53,7 @@ def add_common_arguments(p, mask = None): p.add_argument(f"--no-{f.name}", action="store_false", dest=f.name, help=f"Turn the {f.name} option OFF.") p.set_defaults(**{ f.name: getattr(config, f.name) for f in dataclasses.fields(config) }) - + if "j" not in mask: p.add_argument("-j", "--jobs", metavar="JOBS", type=int, default=1, help="Allows for JOBS concurrent jobs.") @@ -79,10 +78,12 @@ def add_common_arguments(p, mask = None): binaries = [ b.bin for b in BINARIES ] # === TEST === + test_cases = generate_cases() + add_common_arguments(test, "t") test.add_argument("-l", "--list", action="store_true", help="List all available tests.") - test.add_argument("-f", "--from", default=TEST_CASES[0].get_uuid(), type=str, help="First test UUID to run.") - test.add_argument("-t", "--to", default=TEST_CASES[-1].get_uuid(), type=str, help="Last test UUID to run.") + test.add_argument("-f", "--from", default=test_cases[0].get_uuid(), type=str, help="First test UUID to run.") + test.add_argument("-t", "--to", default=test_cases[-1].get_uuid(), type=str, help="Last test UUID to run.") test.add_argument("-o", "--only", nargs="+", type=str, default=[], metavar="L", help="Only run tests with UUIDs or hashes L.") test.add_argument("-b", "--binary", choices=binaries, type=str, default=None, help="(Serial) Override MPI execution binary") test.add_argument("-r", "--relentless", action="store_true", default=False, help="Run all tests, even if multiple fail.") @@ -91,7 +92,7 @@ def add_common_arguments(p, mask = None): test.add_argument("-m", "--max-attempts", type=int, default=3, help="Maximum number of attempts to run a test.") test.add_argument("--case-optimization", action="store_true", default=False, help="(GPU Optimization) Compile MFC targets with some case parameters hard-coded.") - + test_meg = test.add_mutually_exclusive_group() test_meg.add_argument("--generate", action="store_true", default=False, help="(Test Generation) Generate golden files.") test_meg.add_argument("--add-new-variables", action="store_true", default=False, help="(Test Generation) If new variables are found in D/ when running tests, add them to the golden files.") @@ -135,7 +136,7 @@ def add_common_arguments(p, mask = None): if args["command"] == name: continue - vals, errs = parser.parse_known_args(["-i", "None"]) + vals, _ = parser.parse_known_args(["-i", "None"]) for key, val in vars(vals).items(): if key == "input": args[key] = args.get(key) @@ -152,7 +153,7 @@ def add_common_arguments(p, mask = None): # build's --case-optimization and --input depend on each other if args["command"] == "build": if (args["input"] is not None) ^ args["case_optimization"] : - raise MFCException(f"./mfc.sh build's --case-optimization requires --input") + raise MFCException("./mfc.sh build's --case-optimization requires --input") # Input files to absolute paths for e in ["input", "input1", "input2"]: diff --git a/toolchain/mfc/bench.py b/toolchain/mfc/bench.py index 65bacbe90..5d4ae85dd 100644 --- a/toolchain/mfc/bench.py +++ b/toolchain/mfc/bench.py @@ -1,62 +1,4 @@ -import os, json, time, typing, datetime, subprocess - -import rich.table - -from .printer import cons -from .state import ARG -from .build import PRE_PROCESS, SIMULATION, build_targets -from .common import system, MFC_SUBDIR -from . import sched +from .common import MFCException def bench(): - build_targets([PRE_PROCESS, SIMULATION]) - - cons.print("[bold]Benchmarking [magenta]simulation[/magenta]:[/bold]") - cons.indent() - - CASES = ["1D_bubblescreen", "1D_exercise_WENO", "1D_kapilashocktube"] - RESULTS = [] - - table = rich.table.Table(show_lines=False, show_edge=False) - table.add_column("Case") - table.add_column("(Simulation) Runtime (s)") - - def __worker(case: str, devices: typing.Set[int]): - nonlocal RESULTS - - system(["./mfc.sh", "run", f"examples/{case}/case.py", "--no-build", "-t", "pre_process"], stdout=subprocess.DEVNULL) - start = time.monotonic() - system(["./mfc.sh", "run", f"examples/{case}/case.py", "--no-build", "-t", "simulation"], stdout=subprocess.DEVNULL) - end = time.monotonic() - runtime = datetime.timedelta(seconds=end - start).total_seconds() - - RESULTS.append({ - "name": f"Simulation: {case}", - "unit": "seconds", - "value": runtime - }) - - table.add_row(case, str(runtime)) - - tasks: typing.List[sched.Task] = [ - sched.Task(1, __worker, [ case ], 1) for case in CASES - ] - - cons.print() - nThreads = min(ARG('jobs'), len(ARG('gpus'))) if ARG("gpu") else ARG('jobs') - if ARG('case_optimization'): - nThreads = 1 - - sched.sched(tasks, nThreads, ARG("gpus")) - cons.print() - cons.unindent() - cons.print("[bold]Benchmark Results:[/bold]") - cons.print() - cons.raw.print(table) - cons.print() - - filepath = os.path.join(MFC_SUBDIR, "bench.json") - with open(filepath, "w") as f: - json.dump(RESULTS, f) - - cons.print(f"[bold green]✓[/bold green] Saved results to [magenta]{filepath}[/magenta].") + raise MFCException("Benchmarks are currently disabled.") diff --git a/toolchain/mfc/build.py b/toolchain/mfc/build.py index 3f0f17679..2458a9a35 100644 --- a/toolchain/mfc/build.py +++ b/toolchain/mfc/build.py @@ -1,9 +1,8 @@ -import re, os, typing, hashlib, dataclasses +import os, typing, hashlib, dataclasses -from .common import MFCException, system, delete_directory, create_directory -from .state import ARG, CFG -from .printer import cons -from .run import input +from .common import MFCException, system, delete_directory, create_directory +from .state import ARG, CFG +from .run import input @dataclasses.dataclass class MFCTarget: @@ -26,10 +25,10 @@ def compute(self) -> typing.Set: isRequired: bool # Should it always be built? (no matter what -t | --targets is) requires: Dependencies # Build dependencies of the target runOrder: int # For MFC Targets: Order in which targets should logically run - + def __hash__(self) -> int: return hash(self.name) - + # Get path to directory that will store the build files def get_build_dirpath(self) -> str: subdir = 'dependencies' if self.isDependency else CFG().make_slug() @@ -66,7 +65,7 @@ def get_install_dirpath(self) -> str: "install", 'dependencies' if self.isDependency else CFG().make_slug() ]) - + def get_install_binpath(self) -> str: # /install//bin/ return os.sep.join([self.get_install_dirpath(), "bin", self.name]) @@ -104,17 +103,21 @@ def configure(self): build_dirpath = self.get_build_dirpath() cmake_dirpath = self.get_cmake_dirpath() install_dirpath = self.get_install_dirpath() - + install_prefixes = ';'.join([install_dirpath, get_dependency_install_dirpath()]) flags: list = self.flags.copy() + [ # Disable CMake warnings intended for developers (us). # See: https://cmake.org/cmake/help/latest/manual/cmake.1.html. - f"-Wno-dev", + "-Wno-dev", + # Disable warnings about unused command line arguments. This is + # useful for passing arguments to CMake that are not used by the + # current target. + "--no-warn-unused-cli", # Save a compile_commands.json file with the compile commands used to # build the configured targets. This is mostly useful for debugging. # See: https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html. - f"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", + "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", # Set build type (e.g Debug, Release, etc.). # See: https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html f"-DCMAKE_BUILD_TYPE={'Debug' if ARG('debug') else 'Release'}", @@ -135,45 +138,44 @@ def configure(self): flags.append(f"-DMFC_MPI={ 'ON' if ARG('mpi') else 'OFF'}") flags.append(f"-DMFC_OpenACC={'ON' if ARG('gpu') else 'OFF'}") - configure = ["cmake"] + flags + ["-S", cmake_dirpath, "-B", build_dirpath] + command = ["cmake"] + flags + ["-S", cmake_dirpath, "-B", build_dirpath] delete_directory(build_dirpath) create_directory(build_dirpath) - if system(configure, no_exception=True) != 0: + if system(command, no_exception=True) != 0: raise MFCException(f"Failed to configure the [bold magenta]{self.name}[/bold magenta] target.") - def build(self): input.load({}).generate_fpp(self) - build = ["cmake", "--build", self.get_build_dirpath(), - "--target", self.name, - "-j", ARG("jobs"), - "--config", 'Debug' if ARG('debug') else 'Release'] + command = ["cmake", "--build", self.get_build_dirpath(), + "--target", self.name, + "--parallel", ARG("jobs"), + "--config", 'Debug' if ARG('debug') else 'Release'] if ARG('verbose'): - build.append("--verbose") + command.append("--verbose") - system(build, exception_text=f"Failed to build the [bold magenta]{self.name}[/bold magenta] target.") + system(command, exception_text=f"Failed to build the [bold magenta]{self.name}[/bold magenta] target.") def install(self): - install = ["cmake", "--install", self.get_build_dirpath()] + command = ["cmake", "--install", self.get_build_dirpath()] + + system(command, exception_text=f"Failed to install the [bold magenta]{self.name}[/bold magenta] target.") - system(install, exception_text=f"Failed to install the [bold magenta]{self.name}[/bold magenta] target.") - def clean(self): build_dirpath = self.get_build_dirpath() if not os.path.isdir(build_dirpath): return - clean = ["cmake", "--build", build_dirpath, "--target", "clean", - "--config", "Debug" if ARG("debug") else "Release" ] + command = ["cmake", "--build", build_dirpath, "--target", "clean", + "--config", "Debug" if ARG("debug") else "Release" ] if ARG("verbose"): - clean.append("--verbose") + command.append("--verbose") - system(clean, exception_text=f"Failed to clean the [bold magenta]{self.name}[/bold magenta] target.") + system(command, exception_text=f"Failed to clean the [bold magenta]{self.name}[/bold magenta] target.") FFTW = MFCTarget('fftw', ['-DMFC_FFTW=ON'], True, False, False, MFCTarget.Dependencies([], [], []), -1) @@ -196,7 +198,7 @@ def clean(self): def get_target(target: typing.Union[str, MFCTarget]) -> MFCTarget: if isinstance(target, MFCTarget): return target - + if target in TARGET_MAP: return TARGET_MAP[target] @@ -218,7 +220,7 @@ def build_target(target: typing.Union[MFCTarget, str], history: typing.Set[str] history = set() t = get_target(target) - + if t.name in history or not t.is_buildable(): return @@ -235,7 +237,7 @@ def build_target(target: typing.Union[MFCTarget, str], history: typing.Set[str] def build_targets(targets: typing.Iterable[typing.Union[MFCTarget, str]], history: typing.Set[str] = None): if history is None: history = set() - + for target in list(REQUIRED_TARGETS) + targets: build_target(target, history) @@ -245,7 +247,7 @@ def clean_target(target: typing.Union[MFCTarget, str], history: typing.Set[str] history = set() t = get_target(target) - + if t.name in history or not t.is_buildable(): return @@ -274,4 +276,3 @@ def build(): def clean(): clean_targets(ARG("targets")) - diff --git a/toolchain/mfc/case.py b/toolchain/mfc/case.py index d6a11c74a..1b342c86e 100644 --- a/toolchain/mfc/case.py +++ b/toolchain/mfc/case.py @@ -6,12 +6,12 @@ class Case: def __init__(self, params: dict) -> None: self.params = copy.deepcopy(params) - + def get_parameters(self) -> str: return self.params.keys() def get_cell_count(self) -> int: - return math.prod([max(1, int(self.params.get(dir, 0))) for dir in {"m", "n", "p"}]) + return math.prod([max(1, int(self.params.get(dir, 0))) for dir in ["m", "n", "p"]]) def has_parameter(self, key: str)-> bool: return key in self.get_parameters() diff --git a/toolchain/mfc/common.py b/toolchain/mfc/common.py index b6a475fe7..4c4347802 100644 --- a/toolchain/mfc/common.py +++ b/toolchain/mfc/common.py @@ -1,20 +1,17 @@ -import os, yaml, typing, shutil, subprocess, dataclasses +import os, yaml, typing, shutil, subprocess -from datetime import datetime +from os.path import abspath, normpath, dirname, realpath from .printer import cons -from os.path import abspath, normpath, dirname, realpath - -MFC_ROOTDIR = normpath(f"{dirname(realpath(__file__))}/../..") -MFC_TESTDIR = abspath(f"{MFC_ROOTDIR}/tests") -MFC_SUBDIR = abspath(f"{MFC_ROOTDIR}/build") -MFC_DEV_FILEPATH = abspath(f"{MFC_ROOTDIR}/toolchain/mfc.dev.yaml") -MFC_USER_FILEPATH = abspath(f"{MFC_ROOTDIR}/defaults.yaml") -MFC_LOCK_FILEPATH = abspath(f"{MFC_SUBDIR}/lock.yaml") +MFC_ROOTDIR = normpath(f"{dirname(realpath(__file__))}/../..") +MFC_TESTDIR = abspath(f"{MFC_ROOTDIR}/tests") +MFC_SUBDIR = abspath(f"{MFC_ROOTDIR}/build") +MFC_LOCK_FILEPATH = abspath(f"{MFC_SUBDIR}/lock.yaml") +MFC_BENCH_FILEPATH = abspath(f"{MFC_ROOTDIR}/toolchain/bench.yaml") -MFC_LOGO = f""" +MFC_LOGO = """\ .=++*: -+*+=. :+ -*- == =* . :*+ == ++ .+- @@ -23,7 +20,7 @@ .:++=----------====+*= ==..:%..... .:-=++++===--==+=-+= +. := +#=::::::::=%=. -+: =+ *: -.*=-=*=.. :=+*+: -...-- +.*=-=*=.. :=+*+: -...--\ """ @@ -31,6 +28,7 @@ class MFCException(Exception): pass +# pylint: disable=too-many-arguments def system(command: typing.List[str], no_exception: bool = False, exception_text=None, on_error=lambda: None, cwd=None, stdout=None, stderr=None, env: dict = None) -> int: cmd = [ str(x) for x in command if not isspace(str(x)) ] @@ -41,16 +39,16 @@ def system(command: typing.List[str], no_exception: bool = False, exception_text cons.print(no_indent=True) cons.print(f"$ {' '.join(cmd)}") - + if stdout != subprocess.DEVNULL: cons.print(no_indent=True) - r = subprocess.run(cmd, cwd=cwd, stdout=stdout, stderr=stderr, env=env) + r = subprocess.run(cmd, cwd=cwd, stdout=stdout, stderr=stderr, env=env, check=False) if r.returncode != 0: on_error() - if not(no_exception): + if not no_exception: if exception_text is None: exception_text = f'Failed to execute command "{command}".' @@ -64,7 +62,7 @@ def file_write(filepath: str, content: str): with open(filepath, "w") as f: f.write(content) except IOError as exc: - raise MFCException(f'Failed to write to "{filepath}": {exc}') + raise MFCException(f'Failed to write to "{filepath}": {exc}') from exc def file_read(filepath: str): @@ -72,7 +70,7 @@ def file_read(filepath: str): with open(filepath, "r") as f: return f.read() except IOError as exc: - raise MFCException(f'Failed to read from "{filepath}": {exc}') + raise MFCException(f'Failed to read from "{filepath}": {exc}') from exc def file_load_yaml(filepath: str): @@ -80,7 +78,7 @@ def file_load_yaml(filepath: str): with open(filepath, "r") as f: return yaml.safe_load(f) except (IOError, yaml.YAMLError) as exc: - raise MFCException(f'Failed to load YAML from "{filepath}": {exc}') + raise MFCException(f'Failed to load YAML from "{filepath}": {exc}') from exc def file_dump_yaml(filepath: str, data) -> None: @@ -88,7 +86,7 @@ def file_dump_yaml(filepath: str, data) -> None: with open(filepath, "w") as f: yaml.dump(data, f) except (IOError, yaml.YAMLError) as exc: - raise MFCException(f'Failed to dump YAML to "{filepath}": {exc}.') + raise MFCException(f'Failed to dump YAML to "{filepath}": {exc}.') from exc def delete_file(filepath: str) -> None: @@ -99,9 +97,10 @@ def delete_file(filepath: str) -> None: def create_file(filepath: str) -> None: if not os.path.exists(filepath): try: - open(filepath, "w").close() + with open(filepath, "w"): + pass except IOError as exc: - raise MFCException(f"Failed to create file {filepath}: {exc}") + raise MFCException(f"Failed to create file {filepath}: {exc}") from exc def create_directory(dirpath: str) -> None: @@ -114,15 +113,11 @@ def delete_directory(dirpath: str) -> None: def get_program_output(arguments: typing.List[str] = None, cwd=None): - if arguments is None: - arguments = [] - - proc = subprocess.Popen(arguments, cwd=cwd, stdout=subprocess.PIPE) - - return (proc.communicate()[0].decode(), proc.returncode) + with subprocess.Popen(arguments or [], cwd=cwd, stdout=subprocess.PIPE) as proc: + return (proc.communicate()[0].decode(), proc.returncode) -def get_py_program_output(filepath: str, arguments: typing.List[str] = None): +def get_py_program_output(filepath: str, arguments: typing.List[str] = None): dirpath = os.path.abspath (os.path.dirname(filepath)) filename = os.path.basename(filepath) @@ -134,7 +129,7 @@ def isspace(s: str) -> bool: Returns whether a string, s, is empty, whitespace, or None. """ - if s == None: + if s is None: return True return len(s.strip()) == 0 @@ -151,18 +146,18 @@ def does_command_exist(s: str) -> bool: # command -v is useful because it allows for finding much more # than with "which". Checkout "man command" - return 0 == os.system(f"command -v {s} > /dev/null 2>&1") + return 0 == os.system(f"command -v '{s}' > /dev/null 2>&1") def format_list_to_string(arr: list, item_style=None, empty=None): if empty is None: empty = "nothing" - + pre, post = "", "" if item_style is not None: pre = f"[{item_style}]" post = f"[/{item_style}]" - + if len(arr) == 0: return f"{pre}{empty}{post}" @@ -190,6 +185,7 @@ def find(predicate, arr: list): return None, None +# pylint: disable=redefined-builtin def quit(sig): os.kill(os.getpid(), sig) @@ -213,30 +209,31 @@ def get_loaded_modules() -> typing.List[str]: def is_number(x: str) -> bool: if x is None: return False - - if isinstance(x, int) or isinstance(x, float): + + if isinstance(x, (int, float)): return True - + try: float(x) return True except ValueError: return False + def get_cpuinfo(): - if (does_command_exist("lscpu")): + if does_command_exist("lscpu"): # Linux - proc1 = subprocess.Popen(['lscpu'], stdout=subprocess.PIPE,universal_newlines=True) - proc, err = proc1.communicate() - proc = "From lscpu \n" + proc - elif (does_command_exist("sysctl")): + with subprocess.Popen(['lscpu'], stdout=subprocess.PIPE, universal_newlines=True) as proc: + output = f"From lscpu\n{proc.communicate()[0]}" + elif does_command_exist("sysctl"): # MacOS - proc1 = subprocess.Popen(['sysctl', '-a'], stdout=subprocess.PIPE) - proc2 = subprocess.Popen(['grep', 'machdep.cpu'], stdin=proc1.stdout, - stdout=subprocess.PIPE, stderr=subprocess.PIPE,universal_newlines=True) - proc1.stdout.close() # Allow proc1 to receive a SIGPIPE if proc2 exits. - proc, err = proc2.communicate() - proc = "From sysctl -a \n" + proc + with subprocess.Popen(['sysctl', '-a'], stdout=subprocess.PIPE) as proc1: + with subprocess.Popen(['grep', 'machdep.cpu'], stdin=proc1.stdout, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True) as proc2: + proc1.stdout.close() # Allow proc1 to receive a SIGPIPE if proc2 exits. + output = f"From sysctl -a \n{proc2.communicate()[0]}" else: - proc = "No CPU info found" - return "CPU Info: \n" + proc + output = "No CPU info found" + + return f"CPU Info:\n{output}" diff --git a/toolchain/mfc/count.py b/toolchain/mfc/count.py index 4ffabdf28..b21962e65 100644 --- a/toolchain/mfc/count.py +++ b/toolchain/mfc/count.py @@ -1,20 +1,19 @@ import os, glob, typing, typing +import rich.table from .state import ARG from .common import MFC_ROOTDIR, format_list_to_string from .printer import cons -import rich.table - def handle_dir(dirpath: str) -> typing.Tuple[typing.List[typing.Tuple[str, int]], int]: files = [] total = 0 for filepath in glob.glob(os.path.join(dirpath, '*.*f*')): with open(filepath) as f: - count = sum(1 if not l.isspace() else 0 for l in f.read().split('\n')) + n = sum(1 if not l.isspace() else 0 for l in f.read().split('\n')) files.append((filepath, count)) - total += count + total += n files.sort(key=lambda x: x[1], reverse=True) @@ -25,17 +24,17 @@ def count(): cons.print(f"[bold]Counting lines of code in {target_str_list}[/bold] (excluding whitespace lines)") cons.indent() - + total = 0 for codedir in ['common'] + ARG("targets"): - dirfiles, dircount = handle_dir(os.path.join(MFC_ROOTDIR, 'src', codedir)) + dirfiles, dircount = handle_dir(os.path.join(MFC_ROOTDIR, 'src', codedir)) table = rich.table.Table(show_header=True, box=rich.table.box.SIMPLE) table.add_column(f"File (in [magenta]{codedir}[/magenta])", justify="left") table.add_column(f"Lines ([cyan]{dircount}[/cyan])", justify="right") - - for filepath, count in dirfiles: - table.add_row(f"{os.path.basename(filepath)}", f"[bold cyan]{count}[/bold cyan]") - + + for filepath, n in dirfiles: + table.add_row(f"{os.path.basename(filepath)}", f"[bold cyan]{n}[/bold cyan]") + total += dircount cons.raw.print(table) @@ -43,4 +42,3 @@ def count(): cons.print(f"[bold]Total {target_str_list} lines: [bold cyan]{total}[/bold cyan].[/bold]") cons.print() cons.unindent() - diff --git a/toolchain/mfc/lock.py b/toolchain/mfc/lock.py index f60890250..1513a8a43 100644 --- a/toolchain/mfc/lock.py +++ b/toolchain/mfc/lock.py @@ -18,8 +18,9 @@ class MFCLockData: def init(): + # pylint: disable=global-statement global data - + if not os.path.exists(common.MFC_LOCK_FILEPATH): config = MFCConfig() data = MFCLockData(config, MFC_LOCK_CURRENT_VERSION) @@ -32,10 +33,11 @@ def init(): def load(): + # pylint: disable=global-statement global data - + d = common.file_load_yaml(common.MFC_LOCK_FILEPATH) - + # 0 is the default version in order to accommodate versions of mfc.sh # prior to the introduction of the "version" attribute to the lock file. @@ -51,14 +53,16 @@ def load(): def write(): + # pylint: disable=global-statement, global-variable-not-assigned global data - + common.file_dump_yaml(common.MFC_LOCK_FILEPATH, dataclasses.asdict(data)) def switch(to: MFCConfig): + # pylint: disable=global-statement, global-variable-not-assigned global data - + if to == data.config: return diff --git a/toolchain/mfc/packer/errors.py b/toolchain/mfc/packer/errors.py index 63a68e98d..66ab8d446 100644 --- a/toolchain/mfc/packer/errors.py +++ b/toolchain/mfc/packer/errors.py @@ -49,4 +49,4 @@ def push(self, error: Error) -> None: self.count += 1 def __repr__(self) -> str: - return self.get().__repr__() \ No newline at end of file + return self.get().__repr__() diff --git a/toolchain/mfc/packer/pack.py b/toolchain/mfc/packer/pack.py index 6e232854b..30f602670 100644 --- a/toolchain/mfc/packer/pack.py +++ b/toolchain/mfc/packer/pack.py @@ -1,12 +1,13 @@ import dataclasses, typing, sys, os, re, math +from datetime import datetime +from pathlib import Path from .. import common from ..build import get_configured_targets from ..state import CFG -from ..common import MFCException -from datetime import datetime -from pathlib import Path + + # This class maps to the data contained in one file in D/ @dataclasses.dataclass(repr=False) @@ -23,12 +24,10 @@ def __repr__(self) -> str: class Pack: entries: typing.Dict[str, PackEntry] - def __init__(self): + def __init__(self, entries: typing.List[PackEntry] = None): self.entries = {} - def __init__(self, entries: typing.List[PackEntry]): - self.entries = {} - for entry in entries: + for entry in entries or []: self.set(entry) def find(self, filepath: str) -> PackEntry: @@ -40,13 +39,13 @@ def set(self, entry: PackEntry): def save(self, filepath: str): if filepath.endswith(".py"): filepath = os.path.dirname(filepath) - + if os.path.isdir(filepath): filepath = os.path.join(filepath, "pack.txt") - + if not filepath.endswith(".txt"): filepath += ".txt" - + common.file_write(filepath, '\n'.join([ str(e) for e in sorted(self.entries.values(), key=lambda x: x.filepath) ])) metadata = f"""\ @@ -91,7 +90,7 @@ def has_NaNs(self) -> bool: def load(filepath: str) -> Pack: if not os.path.isfile(filepath): filepath = os.path.join(filepath, "pack.txt") - + entries: typing.List[PackEntry] = [] for line in common.file_read(filepath).splitlines(): @@ -120,7 +119,7 @@ def compile(casepath: str) -> typing.Tuple[Pack, str]: try: doubles = [ float(e) for e in re.sub(r"[\n\t\s]+", " ", common.file_read(filepath)).strip().split(' ') ] except ValueError: - None, f"Failed to interpret the content of [magenta]{filepath}[/magenta] as a list of floating point numbers." + return None, f"Failed to interpret the content of [magenta]{filepath}[/magenta] as a list of floating point numbers." entries.append(PackEntry(short_filepath,doubles)) diff --git a/toolchain/mfc/packer/packer.py b/toolchain/mfc/packer/packer.py index 1ac1bc108..98555d847 100644 --- a/toolchain/mfc/packer/packer.py +++ b/toolchain/mfc/packer/packer.py @@ -13,12 +13,12 @@ def load(packpath: str) -> _pack.Pack: def pack(casepath: str, packpath: str = None) -> typing.Tuple[_pack.Pack, str]: if packpath is None: packpath = casepath - + p, err = _pack.compile(casepath) - + if err is not None: return None, err - + p.save(packpath) return p, None @@ -35,19 +35,19 @@ def packer(): if ARG("packer") == "pack": if not os.path.isdir(ARG("input")): ARGS()["input"] = os.path.dirname(ARG("input")) - + out_dir = os.path.sep.join([ARG("input"), ARG("output")]) if ARG("output") is not None else None - p, err = pack(ARG("input"), out_dir) + _, err = pack(ARG("input"), out_dir) if err is not None: raise MFCException(err) - elif ARG("packer") == "compare": - cons.print(f"Comparing [magenta]{os.path.relpath(ARG('input1'), os.getcwd())}[/magenta] to [magenta]{os.path.relpath(ARG('input1'), os.getcwd())}[/magenta]:") - + elif ARG("packer") == "compare": + cons.print(f"Comparing [magenta]{os.path.relpath(ARG('input1'))}[/magenta] to [magenta]{os.path.relpath(ARG('input1'))}[/magenta]:") + cons.indent() cons.print() - + tol = packtol.Tolerance(ARG("abstol"), ARG("reltol")) - + err, msg = compare(ARG("input1"), ARG("input2"), tol) if msg is not None: cons.print(f"[bold red]ERROR[/bold red]: The two packs are not within tolerance ({tol}).") @@ -58,6 +58,5 @@ def packer(): cons.print() cons.unindent() - else: raise MFCException(f"Unknown packer command: {ARG('packer')}") diff --git a/toolchain/mfc/packer/tol.py b/toolchain/mfc/packer/tol.py index 20b6a7ec4..a8a827a10 100644 --- a/toolchain/mfc/packer/tol.py +++ b/toolchain/mfc/packer/tol.py @@ -1,13 +1,9 @@ import math, typing -from ..common import MFCException - from .pack import Pack from .errors import compute_error, AverageError, Error -class Tolerance(Error): - pass - +Tolerance = Error def is_close(error: Error, tolerance: Tolerance) -> bool: if error.absolute <= tolerance.absolute: @@ -22,6 +18,7 @@ def is_close(error: Error, tolerance: Tolerance) -> bool: return False +# pylint: disable=too-many-return-statements def compare(candidate: Pack, golden: Pack, tol: Tolerance) -> typing.Tuple[Error, str]: # Keep track of the average error avg_err = AverageError() @@ -35,7 +32,7 @@ def compare(candidate: Pack, golden: Pack, tol: Tolerance) -> typing.Tuple[Error # Find the corresponding entry in the candidate's pack cEntry = candidate.find(gFilepath) - if cEntry == None: + if cEntry is None: return None, f"No reference to {gFilepath} in the candidate's pack." # Compare variable-count diff --git a/toolchain/mfc/printer.py b/toolchain/mfc/printer.py index 91eda7f1e..dbbd0267b 100644 --- a/toolchain/mfc/printer.py +++ b/toolchain/mfc/printer.py @@ -13,20 +13,20 @@ def reset(self): def indent(self, msg: str = None): msg = msg if msg is not None else " " - + self.stack.append(msg) def unindent(self, times: int = None): - if times == None: + if times is None: times = 1 - + for _ in range(times): self.stack.pop() - def print(self, msg: typing.Any = None, no_indent: bool = False, *args, **kwargs): + def print(self, *args, msg: typing.Any = None, no_indent: bool = False, **kwargs): if msg is None: msg = "" - + if no_indent: self.raw.print(str(msg), *args, **kwargs) else: diff --git a/toolchain/mfc/run/case_dicts.py b/toolchain/mfc/run/case_dicts.py index 9fe45b782..7d9c465f0 100644 --- a/toolchain/mfc/run/case_dicts.py +++ b/toolchain/mfc/run/case_dicts.py @@ -151,14 +151,17 @@ def get_input_dict_keys(target_name: str) -> list: result = None - if target_name == "pre_process": result = PRE_PROCESS.copy() - if target_name == "simulation": result = SIMULATION.copy() - if target_name == "post_process": result = POST_PROCESS.copy() - - if result == None: + if target_name == "pre_process": + result = PRE_PROCESS.copy() + if target_name == "simulation": + result = SIMULATION.copy() + if target_name == "post_process": + result = POST_PROCESS.copy() + + if result is None: raise common.MFCException(f"[INPUT DICTS] Target {target_name} doesn't have an input dict.") if not ARG("case_optimization") or target_name != "simulation": return result - + return [ x for x in result if x not in CASE_OPTIMIZATION ] diff --git a/toolchain/mfc/run/engines.py b/toolchain/mfc/run/engines.py index d7a6dbe53..7ca4c67e5 100644 --- a/toolchain/mfc/run/engines.py +++ b/toolchain/mfc/run/engines.py @@ -1,4 +1,4 @@ -import re, os, time, copy, queue, typing, datetime, subprocess, dataclasses, multiprocessing +import re, os, time, copy, typing, datetime, subprocess, dataclasses, multiprocessing from ..state import ARG, ARGS from ..printer import cons @@ -27,13 +27,18 @@ def profiler_prepend(): return [] -@dataclasses.dataclass +@dataclasses.dataclass(init=False) class Engine: - name: str - slug: str + name: str + slug: str + input: MFCInputFile - def init(self, input: MFCInputFile) -> None: - self.input = input + def __init__(self, name: str, slug: str) -> None: + self.name = name + self.slug = slug + + def init(self, _input: MFCInputFile) -> None: + self.input = _input self._init() @@ -52,13 +57,14 @@ def _interactive_working_worker(cmd: typing.List[str], q: multiprocessing.Queue) cmd = [ str(_) for _ in cmd ] cons.print(f"$ {' '.join(cmd)}") result = subprocess.run( - cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) + cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False) q.put(result) class InteractiveEngine(Engine): def __init__(self) -> None: super().__init__("Interactive", "interactive") + # pylint: disable=attribute-defined-outside-init def _init(self) -> None: self.mpibin = mpi_bins.get_binary() @@ -119,7 +125,7 @@ def run(self, targets: typing.List[MFCTarget]) -> None: self.bKnowWorks = result.returncode == 0 if not self.bKnowWorks: - error_txt = f"""\ + error_txt = """\ MFC's [bold magenta]syscheck[/bold magenta] (system check) failed to run successfully. Please review the output bellow and ensure that your system is configured correctly: @@ -147,13 +153,12 @@ def run(self, targets: typing.List[MFCTarget]) -> None: if not ARG("dry_run"): start_time = time.monotonic() - env = os.environ.copy() if ARG('gpus') is not None: env['CUDA_VISIBLE_DEVICES'] = ','.join([str(_) for _ in ARG('gpus')]) system( - self.get_exec_cmd(target), cwd=self.input.case_dirpath, + self.get_exec_cmd(target), cwd=self.input.case_dirpath, env=env ) end_time = time.monotonic() @@ -180,18 +185,18 @@ def get_args(self) -> str: """ def run(self, targets: typing.List[MFCTarget]) -> None: - system = queues.get_system() - cons.print(f"Detected the [bold magenta]{system.name}[/bold magenta] queue system.") + qsystem = queues.get_system() + cons.print(f"Detected the [bold magenta]{qsystem.name}[/bold magenta] queue system.") targets = [SYSCHECK] + targets cons.print(f"Running {format_list_to_string([_.name for _ in targets], 'bold magenta')}:") cons.indent() - self.__create_batch_file(system, targets) + self.__create_batch_file(qsystem, targets) if not ARG("dry_run"): - self.__execute_batch_file(system) + self.__execute_batch_file(qsystem) cons.print("[bold yellow]INFO:[/bold yellow] Batch file submitted! Please check your queue system for the job status.") cons.print("[bold yellow]INFO:[/bold yellow] If an error occurs, please check the generated batch file and error logs for more information.") @@ -211,7 +216,7 @@ def __get_batch_filepath(self): self.__get_batch_filename() ])) - def __generate_prologue(self, system: queues.QueueSystem) -> str: + def __generate_prologue(self, qsystem: queues.QueueSystem) -> str: modules = f"" if does_system_use_modules(): @@ -232,7 +237,7 @@ def __generate_prologue(self, system: queues.QueueSystem) -> str: $(printf "$TABLE_FORMAT_LINE" "Partition:" "{ARG("partition")}" "Walltime:" "{ARG("walltime")}") $(printf "$TABLE_FORMAT_LINE" "Account:" "{ARG("account")}" "Nodes:" "{ARG("nodes")}") $(printf "$TABLE_FORMAT_LINE" "Job Name:" "{ARG("name")}" "Engine" "{ARG("engine")}") -$(printf "$TABLE_FORMAT_LINE" "Queue System:" "{system.name}" "Email:" "{ARG("email")}") +$(printf "$TABLE_FORMAT_LINE" "Queue System:" "{qsystem.name}" "Email:" "{ARG("email")}") END ) @@ -267,14 +272,15 @@ def __evaluate_expression(self, expr: str) -> str: # See if it computable try: # We assume eval is safe because we control the expression. + # pylint: disable=eval-used r = str(eval(expr, ARGS())) return r if not isspace(r) else None except Exception as exc: - raise MFCException(f"BatchEngine: '{expr}' is not a valid expression in the template file. Please check your spelling.") + raise MFCException(f"BatchEngine: '{expr}' is not a valid expression in the template file. Please check your spelling.") from exc - def __batch_evaluate(self, s: str, system: queues.QueueSystem, targets: typing.List[MFCTarget]): + def __batch_evaluate(self, s: str, qsystem: queues.QueueSystem, targets: typing.List[MFCTarget]): replace_list = [ - ("{MFC::PROLOGUE}", self.__generate_prologue(system)), + ("{MFC::PROLOGUE}", self.__generate_prologue(qsystem)), ("{MFC::PROFILER}", ' '.join(profiler_prepend())), ("{MFC::EPILOGUE}", self.__generate_epilogue()), ("{MFC::BINARIES}", ' '.join([f"'{target.get_install_binpath()}'" for target in targets])), @@ -295,29 +301,29 @@ def __batch_evaluate(self, s: str, system: queues.QueueSystem, targets: typing.L s = s.replace(match, repl) else: # If not specified, then remove the line it appears on - s = re.sub(f"^.*\{match}.*$\n", "", s, flags=re.MULTILINE) + s = re.sub(rf"^.*{match}.*$\n", "", s, flags=re.MULTILINE) cons.print(f"> > [bold yellow]Warning:[/bold yellow] [magenta]{match[1:-1]}[/magenta] was not specified. Thus, any line it appears on will be discarded.") return s - def __create_batch_file(self, system: queues.QueueSystem, targets: typing.List[MFCTarget]): + def __create_batch_file(self, qsystem: queues.QueueSystem, targets: typing.List[MFCTarget]): cons.print("> Generating batch file...") filepath = self.__get_batch_filepath() cons.print("> Evaluating template file...") - content = self.__batch_evaluate(system.template, system, targets) + content = self.__batch_evaluate(qsystem.template, qsystem, targets) cons.print("> Writing batch file...") file_write(filepath, content) - def __execute_batch_file(self, queue: queues.QueueSystem): + def __execute_batch_file(self, qsystem: queues.QueueSystem): # We CD to the case directory before executing the batch file so that # any files the queue system generates (like .err and .out) are created # in the correct directory. - cmd = queue.gen_submit_cmd(self.__get_batch_filename()) + cmd = qsystem.gen_submit_cmd(self.__get_batch_filename()) if system(cmd, cwd=self.__get_batch_dirpath()) != 0: - raise MFCException(f"Submitting batch file for {system.name} failed. It can be found here: {self.__get_batch_filepath()}. Please check the file for errors.") + raise MFCException(f"Submitting batch file for {qsystem.name} failed. It can be found here: {self.__get_batch_filepath()}. Please check the file for errors.") ENGINES = [ InteractiveEngine(), BatchEngine() ] @@ -331,7 +337,7 @@ def get_engine(slug: str) -> Engine: engine = candidate break - if engine == None: + if engine is None: raise MFCException(f"Unsupported engine {slug}.") return engine diff --git a/toolchain/mfc/run/input.py b/toolchain/mfc/run/input.py index 2037998f1..2a2cf8fa0 100644 --- a/toolchain/mfc/run/input.py +++ b/toolchain/mfc/run/input.py @@ -15,24 +15,24 @@ class MFCInputFile: filename: str case_dirpath: str case_dict: dict - + def __get_ndims(self) -> int: return 1 + min(int(self.case_dict.get("n", 0)), 1) + min(int(self.case_dict.get("p", 0)), 1) - + def __is_ic_analytical(self, key: str, val: str) -> bool: if common.is_number(val) or not isinstance(val, str): return False - - for array in QPVF_IDX_VARS.keys(): + + for array in QPVF_IDX_VARS: if re.match(fr'^patch_icpp\([0-9]+\)%{array}', key): return True - + return False def generate_inp(self, target) -> None: - cons.print(f"Generating [magenta]{target.name}.inp[/magenta].") + cons.print(f"Generating [magenta]{target.name}.inp[/magenta]:") cons.indent() - + MASTER_KEYS: list = case_dicts.get_input_dict_keys(target.name) ignored = [] @@ -45,12 +45,11 @@ def generate_inp(self, target) -> None: dict_str += f" {key} = 0d0\n" ignored.append(key) continue - + if not isinstance(val, str) or len(val) == 1: dict_str += f"{key} = {val}\n" else: dict_str += f"{key} = '{val}'\n" - continue else: ignored.append(key) @@ -58,12 +57,12 @@ def generate_inp(self, target) -> None: raise common.MFCException(f"MFCInputFile::dump: Case parameter '{key}' is not used by any MFC code. Please check your spelling or add it as a new parameter.") cons.print(f"[yellow]INFO:[/yellow] Forwarded {len(self.case_dict)-len(ignored)}/{len(self.case_dict)} parameters.") - + contents = f"&user_inputs\n{dict_str}&end/\n" # Save .inp input file common.file_write(f"{self.case_dirpath}/{target.name}.inp", contents) - + cons.unindent() def __save_fpp(self, target, contents: str) -> None: @@ -75,55 +74,56 @@ def __contents_equal(str_a: str, str_b: str) -> bool: inc_dir = os.path.join(target.get_build_dirpath(), "include") common.create_directory(inc_dir) - + fpp_path = os.path.join(inc_dir, f"case.fpp") - opt_fpp = open(fpp_path).read() if os.path.exists(fpp_path) else "" + opt_fpp = common.file_read(fpp_path) if os.path.exists(fpp_path) else "" if __contents_equal(contents, opt_fpp): cons.print("[yellow]INFO:[/yellow] Custom case.fpp file is up to date.") return cons.print("[yellow]INFO:[/yellow] Writing a custom case.fpp file: --case-optimization configuration has changed.") - common.file_write(fpp_path, contents) + common.file_write(fpp_path, contents) + # pylint: disable=too-many-locals def __get_pre_fpp(self) -> str: DATA = { 1: {'ptypes': [1, 15, 16], 'sf_idx': 'i, 0, 0'}, 2: {'ptypes': [2, 3, 4, 5, 6, 7, 17, 18, 21], 'sf_idx': 'i, j, 0'}, 3: {'ptypes': [8, 9, 10, 11, 12, 13, 14, 19, 21], 'sf_idx': 'i, j, k'} }[self.__get_ndims()] - + patches = {} - for key, val in self.case_dict.items(): + for key, val in self.case_dict.items(): if not self.__is_ic_analytical(key, val): continue - + patch_id = re.search(r'[0-9]+', key).group(0) - + if patch_id not in patches: patches[patch_id] = [] - + patches[patch_id].append((key, val)) srcs = [] - + for pid, items in patches.items(): ptype = self.case_dict[f"patch_icpp({pid})%geometry"] - + if ptype not in DATA['ptypes']: raise common.MFCException(f"Patch #{pid} of type {ptype} cannot be analytically defined.") def rhs_replace(match): return { 'x': 'x_cc(i)', 'y': 'y_cc(j)', 'z': 'z_cc(k)', - + 'xc': f'patch_icpp({pid})%x_centroid', 'yc': f'patch_icpp({pid})%y_centroid', 'zc': f'patch_icpp({pid})%z_centroid', 'lx': f'patch_icpp({pid})%length_x', 'ly': f'patch_icpp({pid})%length_y', 'lz': f'patch_icpp({pid})%length_z', - + 'r': f'patch_icpp({pid})%radius', 'eps': f'patch_icpp({pid})%epsilon', 'beta': f'patch_icpp({pid})%beta', 'tau_e': f'patch_icpp({pid})%tau_e', 'radii': f'patch_icpp({pid})%radii', - + 'e' : f'{math.e}', 'pi': f'{math.pi}', }.get(match.group(), match.group()) @@ -132,12 +132,12 @@ def rhs_replace(match): varname = re.findall(r"[a-zA-Z][a-zA-Z0-9_]*", attribute)[1] qpvf_idx_var = QPVF_IDX_VARS[varname] qpvf_idx_offset = "" - + if len(re.findall(r"[0-9]+", attribute)) == 2: idx = int(re.findall(r'[0-9]+', attribute)[1]) - 1 if idx != 0: qpvf_idx_offset = f" + {idx}" - + sf_idx = DATA['sf_idx'] cons.print(f"[yellow]INFO:[/yellow] {self.__get_ndims()}D Analytical Patch #{pid}: Code generation for [magenta]{varname}[/magenta]...") @@ -168,7 +168,7 @@ def rhs_replace(match): def __get_sim_fpp(self) -> str: if ARG("case_optimization"): cons.print("[yellow]INFO:[/yellow] Case optimization is enabled.") - + nterms = -100 bubble_model = int(self.case_dict.get("bubble_model", "-100")) @@ -221,7 +221,7 @@ def generate_fpp(self, target) -> None: def generate(self, target) -> None: self.generate_inp(target) cons.print() - self.generate_fpp(target) + self.generate_fpp(target) # Load the input file @@ -232,8 +232,8 @@ def load(empty_data: dict = None) -> MFCInputFile: if not ARG("input"): if empty_data is None: raise common.MFCException("Please provide an input file.") - else: - load.CACHED_MFCInputFile = MFCInputFile("empty.py", "empty.py", empty_data) + + load.CACHED_MFCInputFile = MFCInputFile("empty.py", "empty.py", empty_data) else: filename: str = ARG("input").strip() @@ -261,7 +261,7 @@ def load(empty_data: dict = None) -> MFCInputFile: raise common.MFCException(f"Input file {filename} did not produce valid JSON. It should only print the case dictionary.\n\n{exc}\n") load.CACHED_MFCInputFile = MFCInputFile(filename, dirpath, dictionary) - + return load.CACHED_MFCInputFile diff --git a/toolchain/mfc/run/queues.py b/toolchain/mfc/run/queues.py index f9e23c211..acb833888 100644 --- a/toolchain/mfc/run/queues.py +++ b/toolchain/mfc/run/queues.py @@ -1,6 +1,6 @@ import os, typing, dataclasses -from .. import common +from mfc import common from ..state import ARG @dataclasses.dataclass @@ -26,11 +26,11 @@ def __init__(self) -> None: def is_active(self) -> bool: return common.does_command_exist("qsub") - def gen_submit_cmd(self, filename: str) -> typing.List[str]: + def gen_submit_cmd(self, filepath: str) -> typing.List[str]: if ARG("wait"): raise common.MFCException("PBS Queue: Sorry, --wait is unimplemented.") - return ["qsub", filename] + return ["qsub", filepath] class LSFSystem(QueueSystem): @@ -40,13 +40,13 @@ def __init__(self) -> None: def is_active(self) -> bool: return common.does_command_exist("bsub") and common.does_command_exist("bqueues") - def gen_submit_cmd(self, filename: str) -> None: + def gen_submit_cmd(self, filepath: str) -> None: cmd = ["bsub"] if ARG("wait"): - cmd += ["--wait"] + cmd += ["--wait"] - return cmd + [filename] + return cmd + [filepath] class SLURMSystem(QueueSystem): @@ -56,13 +56,13 @@ def __init__(self) -> None: def is_active(self) -> bool: return common.does_command_exist("sbatch") - def gen_submit_cmd(self, filename: str) -> None: + def gen_submit_cmd(self, filepath: str) -> None: cmd = ["sbatch"] - + if ARG("wait"): cmd += ["--wait"] - return cmd + [filename] + return cmd + [filepath] QUEUE_SYSTEMS = [ LSFSystem(), SLURMSystem(), PBSSystem() ] @@ -72,4 +72,4 @@ def get_system() -> QueueSystem: if system.is_active(): return system - raise common.MFCException(f"Failed to detect a queue system.") + raise common.MFCException("Failed to detect a queue system.") diff --git a/toolchain/mfc/run/run.py b/toolchain/mfc/run/run.py index ac0d86803..10a86b675 100644 --- a/toolchain/mfc/run/run.py +++ b/toolchain/mfc/run/run.py @@ -24,7 +24,7 @@ def validate_job_options() -> None: raise MFCException(f'RUN: {ARG("email")} is not a valid e-mail address.') -def run_targets(targets: typing.List[MFCTarget]): +def run_targets(targets: typing.List[MFCTarget]): cons.print("[bold]Run[/bold]") cons.indent() @@ -67,12 +67,3 @@ def run_target(target: MFCTarget): def run() -> None: run_targets([ get_target(_) for _ in ARG("targets")]) - - -def run_targets_with(targets: typing.List[MFCTarget]): - pass - - -def run_target_with(target: MFCTarget): - run_targets_with([target]) - diff --git a/toolchain/mfc/sched.py b/toolchain/mfc/sched.py index f1258ddab..39ae78ea5 100644 --- a/toolchain/mfc/sched.py +++ b/toolchain/mfc/sched.py @@ -1,8 +1,9 @@ import time, typing, threading, dataclasses +import rich, rich.progress from .printer import cons -import rich, rich.progress + class WorkerThread(threading.Thread): @@ -43,10 +44,10 @@ def sched(tasks: typing.List[Task], nThreads: int, devices: typing.Set[int] = No def join_first_dead_thread(progress, complete_tracker) -> None: nonlocal threads, nAvailable - + for threadID, threadHolder in enumerate(threads): if not threadHolder.thread.is_alive(): - if threadHolder.thread.exc != None: + if threadHolder.thread.exc is not None: raise threadHolder.thread.exc nAvailable += threadHolder.ppn @@ -90,7 +91,7 @@ def join_first_dead_thread(progress, complete_tracker) -> None: device = min(sched.LOAD.items(), key=lambda x: x[1])[0] sched.LOAD[device] += task.load / task.ppn use_devices.add(device) - + nAvailable -= task.ppn thread = WorkerThread(target=task.func, args=tuple(task.args) + (use_devices,)) diff --git a/toolchain/mfc/state.py b/toolchain/mfc/state.py index 6768329a4..aacf4fc0e 100644 --- a/toolchain/mfc/state.py +++ b/toolchain/mfc/state.py @@ -7,6 +7,7 @@ class MFCConfig: gpu: bool = False debug: bool = False + @staticmethod def from_dict(d: dict): """ Create a MFCConfig object from a dictionary with the same keys as the fields of MFCConfig """ @@ -40,7 +41,7 @@ def __eq__(self, other) -> bool: def __str__(self) -> str: """ Returns a string like "mpi=No & gpu=No & debug=No" """ - + return ' & '.join([ f"{k}={'Yes' if v else 'No'}" for k, v in self.items() ]) @@ -49,13 +50,16 @@ def __str__(self) -> str: def ARG(arg: str) -> typing.Any: + # pylint: disable=global-variable-not-assigned global gARG return gARG[arg] def ARGS() -> dict: + # pylint: disable=global-variable-not-assigned global gARG return gARG def CFG() -> MFCConfig: + # pylint: disable=global-variable-not-assigned global gCFG return gCFG diff --git a/toolchain/mfc/test/case.py b/toolchain/mfc/test/case.py index 851339bf8..aca9cebbd 100644 --- a/toolchain/mfc/test/case.py +++ b/toolchain/mfc/test/case.py @@ -109,15 +109,15 @@ def run(self, targets: typing.List[typing.Union[str, MFCTarget]], gpus: typing.S gpus_select = f"--gpus {' '.join([str(_) for _ in gpus])}" else: gpus_select = "" - + filepath = f'"{self.get_dirpath()}/case.py"' tasks = f"-n {self.ppn}" jobs = f"-j {ARG('jobs')}" if ARG("case_optimization") else "" binary_option = f"-b {ARG('binary')}" if ARG("binary") is not None else "" case_optimization = "--case-optimization" if ARG("case_optimization") or self.opt else "--no-build" - - mfc_script = ".\mfc.bat" if os.name == 'nt' else "./mfc.sh" - + + mfc_script = ".\\mfc.bat" if os.name == 'nt' else "./mfc.sh" + target_names = [ get_target(t).name for t in targets ] command: str = f'''\ @@ -128,7 +128,7 @@ def run(self, targets: typing.List[typing.Union[str, MFCTarget]], gpus: typing.S return subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, - shell=True) + shell=True, check=False) def get_uuid(self) -> str: return hex(binascii.crc32(hashlib.sha1(str(self.trace).encode()).digest())).upper()[2:].zfill(8) @@ -190,7 +190,7 @@ def create_directory(self): 'pi_inf_wrt' : 'T', 'pres_inf_wrt' : 'T', 'c_wrt' : 'T', }} - + if case['p'] != 0: mods['fd_order'] = 1 mods['omega_wrt(1)'] = 'T' @@ -209,6 +209,21 @@ def create_directory(self): def __str__(self) -> str: return f"tests/[bold magenta]{self.get_uuid()}[/bold magenta]: {self.trace}" + def compute_tolerance(self) -> float: + if self.params.get("qbmm", 'F') == 'T': + return 1e-10 + + if self.params.get("bubbles", 'F') == 'T': + return 1e-10 + + if self.params.get("hypoelasticity", 'F') == 'T': + return 1e-7 + + if self.params.get("relax", 'F') == 'T': + return 1e-10 + + return 1e-12 + @dataclasses.dataclass class CaseGeneratorStack: @@ -232,8 +247,9 @@ def pop(self) -> None: def create_case(stack: CaseGeneratorStack, newTrace: str, newMods: dict, ppn: int = None) -> TestCase: mods: dict = {} - for dict in stack.mods: - mods.update(dict) + for mod in stack.mods: + mods.update(mod) + mods.update(newMods) if isinstance(newTrace, str): diff --git a/toolchain/mfc/test/cases.py b/toolchain/mfc/test/cases.py index bd89a0706..29329e613 100644 --- a/toolchain/mfc/test/cases.py +++ b/toolchain/mfc/test/cases.py @@ -1,14 +1,13 @@ import typing -from .. import common +from mfc import common from .case import TestCase, create_case, CaseGeneratorStack -from ..printer import cons def get_bc_mods(bc: int, dimInfo): params = {} for dimCmp in dimInfo[0]: params.update({f'bc_{dimCmp}%beg': bc, f'bc_{dimCmp}%end': bc}) - + return params @@ -67,14 +66,15 @@ def get_dimensions(): return r +# pylint: disable=too-many-locals, too-many-statements def generate_cases() -> typing.List[TestCase]: stack, cases = CaseGeneratorStack(), [] - def alter_bcs(dimInfo, dimParams): + def alter_bcs(dimInfo): for bc in [ -1, -2, -4, -5, -6, -7, -8, -9, -10, -11, -12, -3, -15, -16 ]: cases.append(create_case(stack, f"bc={bc}", get_bc_mods(bc, dimInfo))) - def alter_weno(dimInfo, dimParams): + def alter_weno(): for weno_order in [3, 5]: stack.push(f"weno_order={weno_order}", {'weno_order': weno_order}) @@ -101,9 +101,9 @@ def alter_riemann_solvers(num_fluids): stack.push(f"riemann_solver={riemann_solver}", {'riemann_solver': riemann_solver}) cases.append(create_case(stack, "mixture_err", {'mixture_err': 'T'})) - cases.append(create_case(stack, "avg_state=1", {'avg_state': '1'})) - cases.append(create_case(stack, "wave_speeds=2", {'wave_speeds': '2'})) - + cases.append(create_case(stack, "avg_state=1", {'avg_state': 1})) + cases.append(create_case(stack, "wave_speeds=2", {'wave_speeds': 2})) + if riemann_solver == 2: cases.append(create_case(stack, "model_eqns=3", {'model_eqns': 3})) @@ -115,7 +115,7 @@ def alter_riemann_solvers(num_fluids): stack.pop() - def alter_num_fluids(dimInfo, dimParams): + def alter_num_fluids(): for num_fluids in [1, 2]: stack.push(f"{num_fluids} Fluid(s)", {"num_fluids": num_fluids}) @@ -131,37 +131,37 @@ def alter_num_fluids(dimInfo, dimParams): alter_riemann_solvers(num_fluids) if num_fluids == 1: - stack.push(f"Viscous", { + stack.push("Viscous", { 'fluid_pp(1)%Re(1)' : 0.0001, 'dt' : 1e-11, 'patch_icpp(1)%vel(1)': 1.0}) - cases.append(create_case(stack, "", {'weno_Re_flux': 'F'})) + cases.append(create_case(stack, "", {'weno_Re_flux': 'F'})) cases.append(create_case(stack, "weno_Re_flux", {'weno_Re_flux': 'T'})) for weno_Re_flux in ['T']: - stack.push(f"weno_Re_flux" if weno_Re_flux == 'T' else '', {'weno_Re_flux' : 'T'}) + stack.push("weno_Re_flux" if weno_Re_flux == 'T' else '', {'weno_Re_flux' : 'T'}) cases.append(create_case(stack, "weno_avg", {'weno_avg': 'T'})) stack.pop() stack.pop() if num_fluids == 2: - stack.push(f"Viscous", { + stack.push("Viscous", { 'fluid_pp(1)%Re(1)' : 0.001, 'fluid_pp(1)%Re(2)' : 0.001, 'fluid_pp(2)%Re(1)' : 0.001, 'fluid_pp(2)%Re(2)' : 0.001, 'dt' : 1e-11, 'patch_icpp(1)%vel(1)': 1.0}) - cases.append(create_case(stack, "", {'weno_Re_flux': 'F'})) + cases.append(create_case(stack, "", {'weno_Re_flux': 'F'})) cases.append(create_case(stack, "weno_Re_flux", {'weno_Re_flux': 'T'})) for weno_Re_flux in ['T']: - stack.push(f"weno_Re_flux" if weno_Re_flux == 'T' else '', {'weno_Re_flux' : 'T'}) + stack.push("weno_Re_flux" if weno_Re_flux == 'T' else '', {'weno_Re_flux' : 'T'}) cases.append(create_case(stack, "weno_avg", {'weno_avg': 'T'})) stack.pop() stack.pop() stack.pop() - stack.pop() + stack.pop() - def alter_2d(dimInfo, dimParams): + def alter_2d(): stack.push("Axisymmetric", { 'num_fluids' : 2, 'bc_y%beg': -2, 'cyl_coord': 'T', 'fluid_pp(2)%gamma': 2.5, 'fluid_pp(2)%pi_inf': 0.0, 'patch_icpp(1)%alpha_rho(1)': 0.81, @@ -174,22 +174,22 @@ def alter_2d(dimInfo, dimParams): cases.append(create_case(stack, "model_eqns=2", {'model_eqns': 2})) cases.append(create_case(stack, "model_eqns=3", {'model_eqns': 3})) - stack.push(f"Viscous", { + stack.push("Viscous", { 'fluid_pp(1)%Re(1)' : 0.0001, 'fluid_pp(1)%Re(2)' : 0.0001, 'fluid_pp(2)%Re(1)' : 0.0001, 'fluid_pp(2)%Re(2)' : 0.0001, 'dt' : 1e-11}) - cases.append(create_case(stack, "", {'weno_Re_flux': 'F'})) + cases.append(create_case(stack, "", {'weno_Re_flux': 'F'})) cases.append(create_case(stack, "weno_Re_flux", {'weno_Re_flux': 'T'})) for weno_Re_flux in ['T']: - stack.push(f"weno_Re_flux" if weno_Re_flux == 'T' else '', {'weno_Re_flux' : 'T'}) + stack.push("weno_Re_flux" if weno_Re_flux == 'T' else '', {'weno_Re_flux' : 'T'}) cases.append(create_case(stack, "weno_avg", {'weno_avg': 'T'})) stack.pop() stack.pop() stack.pop() - def alter_3d(dimInfo, dimParams): - stack.push(f"Cylindrical", { + def alter_3d(): + stack.push("Cylindrical", { 'bc_y%beg': -14, 'bc_z%beg': -1, 'bc_z%end': -1, 'cyl_coord': 'T', 'x_domain%beg': 0.E+00, 'x_domain%end': 5.E+00, 'y_domain%beg': 0.E+00, 'y_domain%end': 1.E+00, 'z_domain%beg': 0.E+00, 'z_domain%end' : 2.0*3.141592653589793E+00, 'm': 29, 'n': 29, 'p': 29, @@ -212,32 +212,32 @@ def alter_3d(dimInfo, dimParams): cases.append(create_case(stack, "model_eqns=2", {'model_eqns': 2})) - stack.push(f"Viscous", { + stack.push("Viscous", { 'fluid_pp(1)%Re(1)' : 0.0001, 'fluid_pp(1)%Re(2)' : 0.0001, 'fluid_pp(2)%Re(1)' : 0.0001, 'fluid_pp(2)%Re(2)' : 0.0001, 'dt' : 1e-11 - }) + }) - cases.append(create_case(stack, "", {'weno_Re_flux': 'F'})) + cases.append(create_case(stack, "", {'weno_Re_flux': 'F'})) cases.append(create_case(stack, "weno_Re_flux", {'weno_Re_flux': 'T'})) for weno_Re_flux in ['T']: - stack.push(f"weno_Re_flux" if weno_Re_flux == 'T' else '', {'weno_Re_flux' : 'T'}) + stack.push("weno_Re_flux" if weno_Re_flux == 'T' else '', {'weno_Re_flux' : 'T'}) cases.append(create_case(stack, "weno_avg", {'weno_avg': 'T'})) stack.pop() stack.pop() stack.pop() - def alter_ppn(dimInfo, dimParams): + def alter_ppn(dimInfo): if len(dimInfo[0]) == 3: - cases.append(create_case(stack, f'2 MPI Ranks', {'m': 29, 'n': 29, 'p': 49}, ppn=2)) + cases.append(create_case(stack, '2 MPI Ranks', {'m': 29, 'n': 29, 'p': 49}, ppn=2)) else: - cases.append(create_case(stack, f'2 MPI Ranks', {}, ppn=2)) + cases.append(create_case(stack, '2 MPI Ranks', {}, ppn=2)) - def alter_bubbles(dimInfo, dimParams): + def alter_bubbles(dimInfo): if len(dimInfo[0]) > 0: - stack.push(f"Bubbles", {"bubbles": 'T'}) + stack.push("Bubbles", {"bubbles": 'T'}) - stack.push(f'', { + stack.push('', { 'nb' : 3, 'fluid_pp(1)%gamma' : 0.16, 'fluid_pp(1)%pi_inf': 3515.0, 'fluid_pp(2)%gamma': 2.5, 'fluid_pp(2)%pi_inf': 0.0, 'fluid_pp(1)%mul0' : 0.001002, 'fluid_pp(1)%ss' : 0.07275,'fluid_pp(1)%pv' : 2338.8,'fluid_pp(1)%gamma_v' : 1.33, @@ -249,7 +249,7 @@ def alter_bubbles(dimInfo, dimParams): 'patch_icpp(3)%pres': 1.0 }) - stack.push(f"Monopole", {"Monopole": 'T'}) + stack.push("Monopole", {"Monopole": 'T'}) if len(dimInfo[0]) >= 2: stack.push("", {'Mono(1)%loc(2)': 0.5}) @@ -258,7 +258,7 @@ def alter_bubbles(dimInfo, dimParams): stack.push("", {'Mono(1)%loc(3)': 0.5, 'Mono(1)%support': 3}) for polytropic in ['T', 'F']: - stack.push(f"Polytropic" if polytropic == 'T' else '', {'polytropic' : polytropic}) + stack.push("Polytropic" if polytropic == 'T' else '', {'polytropic' : polytropic}) for bubble_model in [3, 2]: stack.push(f"bubble_model={bubble_model}", {'bubble_model' : bubble_model}) @@ -273,11 +273,11 @@ def alter_bubbles(dimInfo, dimParams): stack.push('', {'polytropic': 'T', 'bubble_model': 2}) cases.append(create_case(stack, 'nb=1', {'nb': 1})) - stack.push(f"QBMM", {'qbmm': 'T'}) + stack.push("QBMM", {'qbmm': 'T'}) cases.append(create_case(stack, '', {})) - stack.push(f"Non-polytropic", {'polytropic': 'F'}) + stack.push("Non-polytropic", {'polytropic': 'F'}) cases.append(create_case(stack, '', {})) stack.pop() @@ -285,10 +285,10 @@ def alter_bubbles(dimInfo, dimParams): stack.push('bubble_model=3', {'bubble_model': 3, 'polytropic': 'T'}) cases.append(create_case(stack, '', {})) - stack.push(f'Non-polytropic', { 'polytropic': 'F'}) + stack.push('Non-polytropic', { 'polytropic': 'F'}) cases.append(create_case(stack, '', {})) - for i in range(7): + for _ in range(7): stack.pop() if len(dimInfo[0]) >= 2: @@ -297,7 +297,7 @@ def alter_bubbles(dimInfo, dimParams): if len(dimInfo[0]) >= 3: stack.pop() - def alter_hypoelasticity(dimInfo, dimParams): + def alter_hypoelasticity(dimInfo): # Hypoelasticity checks for num_fluids in [1,2]: stack.push(f"Hypoelasticity -> {num_fluids} Fluid(s)", { @@ -346,10 +346,10 @@ def alter_hypoelasticity(dimInfo, dimParams): stack.pop() if len(dimInfo[0]) == 3: - for i in range(2): + for _ in range(2): stack.pop() - def alter_phasechange(dimInfo, dimParams): + def alter_phasechange(dimInfo): ndims = len(dimInfo[0]) # Phase Change checks @@ -417,13 +417,13 @@ def alter_phasechange(dimInfo, dimParams): if num_fluids == 3: stack.pop() - def alter_viscosity(dimInfo, dimParams): + def alter_viscosity(dimInfo): # Viscosity & bubbles checks if len(dimInfo[0]) > 0: - stack.push(f"Viscosity -> Bubbles", + stack.push("Viscosity -> Bubbles", {"fluid_pp(1)%Re(1)": 50, "bubbles": 'T'}) - stack.push(f'', { + stack.push('', { 'nb' : 1, 'fluid_pp(1)%gamma' : 0.16, 'fluid_pp(1)%pi_inf': 3515.0, 'fluid_pp(2)%gamma': 2.5, 'fluid_pp(2)%pi_inf': 0.0, 'fluid_pp(1)%mul0' : 0.001002, 'fluid_pp(1)%ss' : 0.07275,'fluid_pp(1)%pv' : 2338.8,'fluid_pp(1)%gamma_v' : 1.33, @@ -436,7 +436,7 @@ def alter_viscosity(dimInfo, dimParams): }) for polytropic in ['T', 'F']: - stack.push(f"Polytropic" if polytropic == 'T' else '', {'polytropic' : polytropic}) + stack.push("Polytropic" if polytropic == 'T' else '', {'polytropic' : polytropic}) for bubble_model in [3, 2]: stack.push(f"bubble_model={bubble_model}", {'bubble_model' : bubble_model}) @@ -451,34 +451,34 @@ def alter_viscosity(dimInfo, dimParams): stack.push('', {'polytropic': 'T', 'bubble_model': 2}) cases.append(create_case(stack, 'nb=1', {'nb': 1})) - stack.push(f"QBMM", {'qbmm': 'T'}) + stack.push("QBMM", {'qbmm': 'T'}) cases.append(create_case(stack, '', {})) stack.push('bubble_model=3', {'bubble_model': 3}) cases.append(create_case(stack, '', {})) - for i in range(5): + for _ in range(5): stack.pop() def foreach_dimension(): for dimInfo, dimParams in get_dimensions(): stack.push(f"{len(dimInfo[0])}D", dimParams) - alter_bcs (dimInfo, dimParams) - alter_weno(dimInfo, dimParams) - alter_num_fluids(dimInfo, dimParams) + alter_bcs(dimInfo) + alter_weno() + alter_num_fluids() if len(dimInfo[0]) == 2: - alter_2d(dimInfo, dimParams) + alter_2d() if len(dimInfo[0]) == 3: - alter_3d(dimInfo, dimParams) - alter_ppn(dimInfo, dimParams) + alter_3d() + alter_ppn(dimInfo) stack.push('', {'dt': [1e-07, 1e-06, 1e-06][len(dimInfo[0])-1]}) - alter_bubbles(dimInfo, dimParams) - alter_hypoelasticity(dimInfo, dimParams) - alter_phasechange(dimInfo, dimParams) - alter_viscosity(dimInfo, dimParams) + alter_bubbles(dimInfo) + alter_hypoelasticity(dimInfo) + alter_phasechange(dimInfo) + alter_viscosity(dimInfo) stack.pop() stack.pop() - + foreach_dimension() # Sanity Check 1 diff --git a/toolchain/mfc/test/test.py b/toolchain/mfc/test/test.py index 6a90e7f62..73986da83 100644 --- a/toolchain/mfc/test/test.py +++ b/toolchain/mfc/test/test.py @@ -1,6 +1,8 @@ import os, math, typing, shutil, time +from random import sample + +import rich, rich.table -from random import sample from ..printer import cons from .. import common from ..state import ARG @@ -13,25 +15,22 @@ from ..packer import tol as packtol from ..packer import packer -import rich, rich.table - -CASES = generate_cases() nFAIL = 0 -def __filter(): - global CASES - +def __filter(cases_): + cases = cases_[:] + # Check "--from" and "--to" exist and are in the right order bFoundFrom, bFoundTo = (False, False) from_i = -1 - for i, case in enumerate(CASES): + for i, case in enumerate(cases): if case.get_uuid() == ARG("from"): from_i = i bFoundFrom = True # Do not "continue" because "--to" might be the same as "--from" if bFoundFrom and case.get_uuid() == ARG("to"): - CASES = CASES[from_i:i+1] + cases = cases[from_i:i+1] bFoundTo = True break @@ -39,7 +38,7 @@ def __filter(): raise MFCException("Testing: Your specified range [--from,--to] is incorrect. Please ensure both IDs exist and are in the correct order.") if len(ARG("only")) > 0: - for i, case in enumerate(CASES[:]): + for i, case in enumerate(cases[:]): case: TestCase doKeep = False @@ -49,34 +48,36 @@ def __filter(): break if not doKeep: - CASES.remove(case) + cases.remove(case) - if not ARG("mpi"): - for case in CASES[:]: - if case.ppn > 1: - CASES.remove(case) + for case in cases[:]: + if case.ppn > 1 and not ARG("mpi"): + cases.remove(case) if ARG("percent") == 100: - return + return cases - CASES = sample(CASES, k=int(len(CASES)*ARG("percent")/100.0)) + return sample(cases, k=int(len(cases)*ARG("percent")/100.0)) def test(): - global CASES, nFAIL - - # Delete UUIDs that are not in the list of CASES from tests/ + # pylint: disable=global-statement, global-variable-not-assigned + global nFAIL + + cases = generate_cases() + + # Delete UUIDs that are not in the list of cases from tests/ if ARG("remove_old_tests"): dir_uuids = set(os.listdir(common.MFC_TESTDIR)) - new_uuids = set([case.get_uuid() for case in CASES]) + new_uuids = { case.get_uuid() for case in cases } for old_uuid in dir_uuids - new_uuids: cons.print(f"[bold red]Deleting:[/bold red] {old_uuid}") common.delete_directory(f"{common.MFC_TESTDIR}/{old_uuid}") - + return - __filter() + cases = __filter(cases) if ARG("list"): table = rich.table.Table(title="MFC Test Cases", box=rich.table.box.SIMPLE) @@ -84,7 +85,7 @@ def test(): table.add_column("UUID", style="bold magenta", justify="center") table.add_column("Trace") - for case in CASES: + for case in cases: table.add_row(case.get_uuid(), case.trace) rich.print(table) @@ -101,78 +102,66 @@ def test(): if len(ARG("only")) > 0: range_str = "Only " + format_list_to_string(ARG("only"), "bold magenta", "Nothing to run") - - cons.print(f"[bold]Test {format_list_to_string([ x.name for x in codes ], 'magenta')}[/bold] | {range_str} ({len(CASES)} test{'s' if len(CASES) != 1 else ''})") + + cons.print(f"[bold]Test {format_list_to_string([ x.name for x in codes ], 'magenta')}[/bold] | {range_str} ({len(cases)} test{'s' if len(cases) != 1 else ''})") cons.indent() - # Run CASES with multiple threads (if available) + # Run cases with multiple threads (if available) cons.print() - cons.print(f" tests/[bold magenta]UUID[/bold magenta] (s) Summary") + cons.print(" tests/[bold magenta]UUID[/bold magenta] (s) Summary") cons.print() - - # Select the correct number of threads to use to launch test CASES + + # Select the correct number of threads to use to launch test cases # We can't use ARG("jobs") when the --case-optimization option is set # because running a test case may cause it to rebuild, and thus - # interfere with the other test CASES. It is a niche feature so we won't + # interfere with the other test cases. It is a niche feature so we won't # engineer around this issue (for now). sched.sched( - [ sched.Task(ppn=case.ppn, func=handle_case, args=[case], load=case.get_cell_count()) for case in CASES ], + [ sched.Task(ppn=case.ppn, func=handle_case, args=[case], load=case.get_cell_count()) for case in cases ], ARG("jobs"), ARG("gpus")) cons.print() if nFAIL == 0: - cons.print(f"Tested Simulation [bold green]✓[/bold green]") + cons.print("Tested Simulation [bold green]✓[/bold green]") else: - if nFAIL == 1: - raise MFCException(f"Testing: There was [bold red]1[/bold red] failure.") - else: - raise MFCException(f"Testing: There were [bold red]{nFAIL}[/bold red] failures.") + raise MFCException(f"Testing: Encountered [bold red]{nFAIL}[/bold red] failure(s).") cons.unindent() -def _handle_case(test: TestCase, devices: typing.Set[int]): +# pylint: disable=too-many-locals, too-many-branches, too-many-statements +def _handle_case(case: TestCase, devices: typing.Set[int]): start_time = time.time() - if test.params.get("qbmm", 'F') == 'T': - tol = 1e-10 - elif test.params.get("bubbles", 'F') == 'T': - tol = 1e-10 - elif test.params.get("hypoelasticity", 'F') == 'T': - tol = 1e-7 - elif test.params.get("relax", 'F') == 'T': - tol = 1e-10 - else: - tol = 1e-12 + tol = case.compute_tolerance() - test.delete_output() - test.create_directory() + case.delete_output() + case.create_directory() - cmd = test.run([PRE_PROCESS, SIMULATION], gpus=devices) + cmd = case.run([PRE_PROCESS, SIMULATION], gpus=devices) - out_filepath = os.path.join(test.get_dirpath(), "out_pre_sim.txt") + out_filepath = os.path.join(case.get_dirpath(), "out_pre_sim.txt") common.file_write(out_filepath, cmd.stdout) if cmd.returncode != 0: cons.print(cmd.stdout) - raise MFCException(f"Test {test}: Failed to execute MFC.") + raise MFCException(f"Test {case}: Failed to execute MFC.") - pack, err = packer.pack(test.get_dirpath()) + pack, err = packer.pack(case.get_dirpath()) if err is not None: - raise MFCException(f"Test {test}: {err}") + raise MFCException(f"Test {case}: {err}") if pack.has_NaNs(): - raise MFCException(f"Test {test}: NaNs detected in the case.") + raise MFCException(f"Test {case}: NaNs detected in the case.") - golden_filepath = os.path.join(test.get_dirpath(), "golden.txt") - golden_meta_filepath = os.path.join(test.get_dirpath(), "golden-metadata.txt") + golden_filepath = os.path.join(case.get_dirpath(), "golden.txt") if ARG("generate"): common.delete_file(golden_filepath) pack.save(golden_filepath) else: if not os.path.isfile(golden_filepath): - raise MFCException(f"Test {test}: The golden file does not exist! To generate golden files, use the '--generate' flag.") + raise MFCException(f"Test {case}: The golden file does not exist! To generate golden files, use the '--generate' flag.") golden = packer.load(golden_filepath) @@ -185,64 +174,65 @@ def _handle_case(test: TestCase, devices: typing.Set[int]): else: err, msg = packtol.compare(pack, packer.load(golden_filepath), packtol.Tolerance(tol, tol)) if msg is not None: - raise MFCException(f"Test {test}: {msg}") + raise MFCException(f"Test {case}: {msg}") if ARG("test_all"): - test.delete_output() - cmd = test.run([PRE_PROCESS, SIMULATION, POST_PROCESS], gpus=devices) - out_filepath = os.path.join(test.get_dirpath(), "out_post.txt") + case.delete_output() + cmd = case.run([PRE_PROCESS, SIMULATION, POST_PROCESS], gpus=devices) + out_filepath = os.path.join(case.get_dirpath(), "out_post.txt") common.file_write(out_filepath, cmd.stdout) - for t_step in [ i*test["t_step_save"] for i in range(0, math.floor(test["t_step_stop"] / test["t_step_save"]) + 1) ]: - silo_filepath = os.path.join(test.get_dirpath(), 'silo_hdf5', 'p0', f'{t_step}.silo') + for t_step in [ i*case["t_step_save"] for i in range(0, math.floor(case["t_step_stop"] / case["t_step_save"]) + 1) ]: + silo_filepath = os.path.join(case.get_dirpath(), 'silo_hdf5', 'p0', f'{t_step}.silo') if not os.path.exists(silo_filepath): - silo_filepath = os.path.join(test.get_dirpath(), 'silo_hdf5', 'p_all', 'p0', f'{t_step}.silo') - + silo_filepath = os.path.join(case.get_dirpath(), 'silo_hdf5', 'p_all', 'p0', f'{t_step}.silo') + h5dump = f"{HDF5.get_install_dirpath()}/bin/h5dump" if ARG("no_hdf5"): if not does_command_exist("h5dump"): raise MFCException("--no-hdf5 was specified and h5dump couldn't be found.") - + h5dump = shutil.which("h5dump") output, err = get_program_output([h5dump, silo_filepath]) if err != 0: - raise MFCException(f"""Test {test}: Failed to run h5dump. You can find the run's output in {out_filepath}, and the case dictionary in {os.path.join(test.get_dirpath(), "case.py")}.""") + raise MFCException(f"""Test {case}: Failed to run h5dump. You can find the run's output in {out_filepath}, and the case dictionary in {os.path.join(test.get_dirpath(), "case.py")}.""") if "nan," in output: - raise MFCException(f"""Test {test}: Post Process has detected a NaN. You can find the run's output in {out_filepath}, and the case dictionary in {os.path.join(test.get_dirpath(), "case.py")}.""") + raise MFCException(f"""Test {case}: Post Process has detected a NaN. You can find the run's output in {out_filepath}, and the case dictionary in {os.path.join(test.get_dirpath(), "case.py")}.""") if "inf," in output: - raise MFCException(f"""Test {test}: Post Process has detected an Infinity. You can find the run's output in {out_filepath}, and the case dictionary in {os.path.join(test.get_dirpath(), "case.py")}.""") + raise MFCException(f"""Test {case}: Post Process has detected an Infinity. You can find the run's output in {out_filepath}, and the case dictionary in {os.path.join(test.get_dirpath(), "case.py")}.""") - test.delete_output() + case.delete_output() end_time = time.time() duration = end_time - start_time - cons.print(f" [bold magenta]{test.get_uuid()}[/bold magenta] {duration:6.2f} {test.trace}") + cons.print(f" [bold magenta]{case.get_uuid()}[/bold magenta] {duration:6.2f} {case.trace}") -def handle_case(test: TestCase, devices: typing.Set[int]): +def handle_case(case: TestCase, devices: typing.Set[int]): + # pylint: disable=global-statement global nFAIL - + nAttempts = 0 while True: nAttempts += 1 try: - _handle_case(test, devices) + _handle_case(case, devices) except Exception as exc: if nAttempts < ARG("max_attempts"): - cons.print(f"[bold yellow] Attempt {nAttempts}: Failed test {test.get_uuid()}. Retrying...[/bold yellow]") + cons.print(f"[bold yellow] Attempt {nAttempts}: Failed test {case.get_uuid()}. Retrying...[/bold yellow]") continue nFAIL += 1 - cons.print(f"[bold red]Failed test {test} after {nAttempts} attempt(s).[/bold red]") + cons.print(f"[bold red]Failed test {case} after {nAttempts} attempt(s).[/bold red]") if ARG("relentless"): cons.print(f"{exc}") diff --git a/toolchain/requirements.txt b/toolchain/requirements.txt index f1be68d20..b3495c7d5 100644 --- a/toolchain/requirements.txt +++ b/toolchain/requirements.txt @@ -3,6 +3,7 @@ fypp wheel typing PyYAML +pylint argparse fprettify dataclasses