diff --git a/data/get_nndc_data.py b/data/get_nndc_data.py index ec031b95f6..7e964bff88 100755 --- a/data/get_nndc_data.py +++ b/data/get_nndc_data.py @@ -32,7 +32,10 @@ for f in files: req = urlopen(url) # Get file size from header - file_size = int(req.info().getheaders('Content-Length')[0]) + if sys.version_info[0] < 3: + file_size = int(req.info().getheaders('Content-Length')[0]) + else: + file_size = req.length downloaded = 0 # Check if file already downloaded @@ -126,14 +129,14 @@ if not response or response.lower().startswith('y'): # loop around ace directories for d in ace_dirs: - print('Coverting {0}...'.format(d)) + print('Converting {0}...'.format(d)) # get a list of files to convert ace_files = glob.glob(os.path.join(d, '*.ace*')) # convert files for f in ace_files: - print(' Coverting {0}...'.format(os.path.split(f)[1])) + print(' Converting {0}...'.format(os.path.split(f)[1])) ascii_to_binary(f, f) # Change cross_sections.xml file diff --git a/src/utils/abundances.txt b/src/utils/abundances.txt deleted file mode 100644 index c3d066a18f..0000000000 --- a/src/utils/abundances.txt +++ /dev/null @@ -1,291 +0,0 @@ -# IUPAC Isotopic Compositions of the Element 2009 -# Pure. Appl. Chem., Vol 83, No. 2, pp. 397-410 (2011) -# doi:10.1351/PAC-REP-10-06-02 -1 H 1 0.999885 -1 H 2 0.000115 -2 He 3 1.34e-06 -2 He 4 0.99999866 -3 Li 6 0.0759 -3 Li 7 0.9241 -4 Be 9 1.0 -5 B 10 0.199 -5 B 11 0.801 -6 C 12 0.9893 -6 C 13 0.0107 -7 N 14 0.99636 -7 N 15 0.00364 -8 O 16 0.99757 -8 O 17 0.00038 -8 O 18 0.00205 -9 F 19 1.0 -10 Ne 20 0.9048 -10 Ne 21 0.0027 -10 Ne 22 0.0925 -11 Na 23 1.0 -12 Mg 24 0.7899 -12 Mg 25 0.1 -12 Mg 26 0.1101 -13 Al 27 1.0 -14 Si 28 0.92223 -14 Si 29 0.04685 -14 Si 30 0.03092 -15 P 31 1.0 -16 S 32 0.9499 -16 S 33 0.0075 -16 S 34 0.0425 -16 S 36 0.0001 -17 Cl 35 0.7576 -17 Cl 37 0.2424 -18 Ar 36 0.003336 -18 Ar 38 0.000629 -18 Ar 40 0.996035 -19 K 39 0.932581 -19 K 40 0.000117 -19 K 41 0.067302 -20 Ca 40 0.96941 -20 Ca 42 0.00647 -20 Ca 43 0.00135 -20 Ca 44 0.02086 -20 Ca 46 4e-05 -20 Ca 48 0.00187 -21 Sc 45 1.0 -22 Ti 46 0.0825 -22 Ti 47 0.0744 -22 Ti 48 0.7372 -22 Ti 49 0.0541 -22 Ti 50 0.0518 -23 V 50 0.0025 -23 V 51 0.9975 -24 Cr 50 0.04345 -24 Cr 52 0.83789 -24 Cr 53 0.09501 -24 Cr 54 0.02365 -25 Mn 55 1.0 -26 Fe 54 0.05845 -26 Fe 56 0.91754 -26 Fe 57 0.02119 -26 Fe 58 0.00282 -27 Co 59 1.0 -28 Ni 58 0.68077 -28 Ni 60 0.26223 -28 Ni 61 0.011399 -28 Ni 62 0.036346 -28 Ni 64 0.009255 -29 Cu 63 0.6915 -29 Cu 65 0.3085 -30 Zn 64 0.4917 -30 Zn 66 0.2773 -30 Zn 67 0.0404 -30 Zn 68 0.1845 -30 Zn 70 0.0061 -31 Ga 69 0.60108 -31 Ga 71 0.39892 -32 Ge 70 0.2057 -32 Ge 72 0.2745 -32 Ge 73 0.0775 -32 Ge 74 0.3650 -32 Ge 76 0.0773 -33 As 75 1.0 -34 Se 74 0.0089 -34 Se 76 0.0937 -34 Se 77 0.0763 -34 Se 78 0.2377 -34 Se 80 0.4961 -34 Se 82 0.0873 -35 Br 79 0.5069 -35 Br 81 0.4931 -36 Kr 78 0.00355 -36 Kr 80 0.02286 -36 Kr 82 0.11593 -36 Kr 83 0.11500 -36 Kr 84 0.56987 -36 Kr 86 0.17279 -37 Rb 85 0.7217 -37 Rb 87 0.2783 -38 Sr 84 0.0056 -38 Sr 86 0.0986 -38 Sr 87 0.07 -38 Sr 88 0.8258 -39 Y 89 1.0 -40 Zr 90 0.5145 -40 Zr 91 0.1122 -40 Zr 92 0.1715 -40 Zr 94 0.1738 -40 Zr 96 0.028 -41 Nb 93 1.0 -42 Mo 92 0.1453 -42 Mo 94 0.0915 -42 Mo 95 0.1584 -42 Mo 96 0.1667 -42 Mo 97 0.0960 -42 Mo 98 0.2439 -42 Mo 100 0.0982 -44 Ru 96 0.0554 -44 Ru 98 0.0187 -44 Ru 99 0.1276 -44 Ru 100 0.126 -44 Ru 101 0.1706 -44 Ru 102 0.3155 -44 Ru 104 0.1862 -45 Rh 103 1.0 -46 Pd 102 0.0102 -46 Pd 104 0.1114 -46 Pd 105 0.2233 -46 Pd 106 0.2733 -46 Pd 108 0.2646 -46 Pd 110 0.1172 -47 Ag 107 0.51839 -47 Ag 109 0.48161 -48 Cd 106 0.0125 -48 Cd 108 0.0089 -48 Cd 110 0.1249 -48 Cd 111 0.128 -48 Cd 112 0.2413 -48 Cd 113 0.1222 -48 Cd 114 0.2873 -48 Cd 116 0.0749 -49 In 113 0.0429 -49 In 115 0.9571 -50 Sn 112 0.0097 -50 Sn 114 0.0066 -50 Sn 115 0.0034 -50 Sn 116 0.1454 -50 Sn 117 0.0768 -50 Sn 118 0.2422 -50 Sn 119 0.0859 -50 Sn 120 0.3258 -50 Sn 122 0.0463 -50 Sn 124 0.0579 -51 Sb 121 0.5721 -51 Sb 123 0.4279 -52 Te 120 0.0009 -52 Te 122 0.0255 -52 Te 123 0.0089 -52 Te 124 0.0474 -52 Te 125 0.0707 -52 Te 126 0.1884 -52 Te 128 0.3174 -52 Te 130 0.3408 -53 I 127 1.0 -54 Xe 124 0.000952 -54 Xe 126 0.000890 -54 Xe 128 0.019102 -54 Xe 129 0.264006 -54 Xe 130 0.040710 -54 Xe 131 0.212324 -54 Xe 132 0.269086 -54 Xe 134 0.104357 -54 Xe 136 0.088573 -55 Cs 133 1.0 -56 Ba 130 0.00106 -56 Ba 132 0.00101 -56 Ba 134 0.02417 -56 Ba 135 0.06592 -56 Ba 136 0.07854 -56 Ba 137 0.11232 -56 Ba 138 0.71698 -57 La 138 0.0008881 -57 La 139 0.9991119 -58 Ce 136 0.00185 -58 Ce 138 0.00251 -58 Ce 140 0.8845 -58 Ce 142 0.11114 -59 Pr 141 1.0 -60 Nd 142 0.27152 -60 Nd 143 0.12174 -60 Nd 144 0.23798 -60 Nd 145 0.08293 -60 Nd 146 0.17189 -60 Nd 148 0.05756 -60 Nd 150 0.05638 -62 Sm 144 0.0307 -62 Sm 147 0.1499 -62 Sm 148 0.1124 -62 Sm 149 0.1382 -62 Sm 150 0.0738 -62 Sm 152 0.2675 -62 Sm 154 0.2275 -63 Eu 151 0.4781 -63 Eu 153 0.5219 -64 Gd 152 0.002 -64 Gd 154 0.0218 -64 Gd 155 0.148 -64 Gd 156 0.2047 -64 Gd 157 0.1565 -64 Gd 158 0.2484 -64 Gd 160 0.2186 -65 Tb 159 1.0 -66 Dy 156 0.00056 -66 Dy 158 0.00095 -66 Dy 160 0.02329 -66 Dy 161 0.18889 -66 Dy 162 0.25475 -66 Dy 163 0.24896 -66 Dy 164 0.28260 -67 Ho 165 1.0 -68 Er 162 0.00139 -68 Er 164 0.01601 -68 Er 166 0.33503 -68 Er 167 0.22869 -68 Er 168 0.26978 -68 Er 170 0.14910 -69 Tm 169 1.0 -70 Yb 168 0.00123 -70 Yb 170 0.02982 -70 Yb 171 0.1409 -70 Yb 172 0.2168 -70 Yb 173 0.16103 -70 Yb 174 0.32026 -70 Yb 176 0.12996 -71 Lu 175 0.97401 -71 Lu 176 0.02599 -72 Hf 174 0.0016 -72 Hf 176 0.0526 -72 Hf 177 0.186 -72 Hf 178 0.2728 -72 Hf 179 0.1362 -72 Hf 180 0.3508 -73 Ta 180 0.0001201 -73 Ta 181 0.9998799 -74 W 180 0.0012 -74 W 182 0.265 -74 W 183 0.1431 -74 W 184 0.3064 -74 W 186 0.2843 -75 Re 185 0.374 -75 Re 187 0.626 -76 Os 184 0.0002 -76 Os 186 0.0159 -76 Os 187 0.0196 -76 Os 188 0.1324 -76 Os 189 0.1615 -76 Os 190 0.2626 -76 Os 192 0.4078 -77 Ir 191 0.373 -77 Ir 193 0.627 -78 Pt 190 0.00012 -78 Pt 192 0.00782 -78 Pt 194 0.3286 -78 Pt 195 0.3378 -78 Pt 196 0.2521 -78 Pt 198 0.07356 -79 Au 197 1.0 -80 Hg 196 0.0015 -80 Hg 198 0.0997 -80 Hg 199 0.1687 -80 Hg 200 0.231 -80 Hg 201 0.1318 -80 Hg 202 0.2986 -80 Hg 204 0.0687 -81 Tl 203 0.2952 -81 Tl 205 0.7048 -82 Pb 204 0.014 -82 Pb 206 0.241 -82 Pb 207 0.221 -82 Pb 208 0.524 -83 Bi 209 1.0 -90 Th 232 1.0 -91 Pa 231 1.0 -92 U 234 5.4e-05 -92 U 235 0.007204 -92 U 238 0.992742 diff --git a/src/utils/abundances_modified.txt b/src/utils/abundances_modified.txt deleted file mode 100644 index 3fb611a02b..0000000000 --- a/src/utils/abundances_modified.txt +++ /dev/null @@ -1,286 +0,0 @@ -# IUPAC Isotopic Compositions of the Element 2009 -# Pure. Appl. Chem., Vol 83, No. 2, pp. 397-410 (2011) -# doi:10.1351/PAC-REP-10-06-02 -# Modified to use only nuclides which exist in ENDF/B-VII.1 -1 H 1 0.999885 -1 H 2 0.000115 -2 He 3 1.34e-06 -2 He 4 0.99999866 -3 Li 6 0.0759 -3 Li 7 0.9241 -4 Be 9 1.0 -5 B 10 0.199 -5 B 11 0.801 -6 C Nat 1.0 -7 N 14 0.99636 -7 N 15 0.00364 -8 O 16 0.99757 -8 O 17 0.00038 -8 O 18 0.00205 -9 F 19 1.0 -10 Ne 20 0.9048 -10 Ne 21 0.0027 -10 Ne 22 0.0925 -11 Na 23 1.0 -12 Mg 24 0.7899 -12 Mg 25 0.1 -12 Mg 26 0.1101 -13 Al 27 1.0 -14 Si 28 0.92223 -14 Si 29 0.04685 -14 Si 30 0.03092 -15 P 31 1.0 -16 S 32 0.9499 -16 S 33 0.0075 -16 S 34 0.0425 -16 S 36 0.0001 -17 Cl 35 0.7576 -17 Cl 37 0.2424 -18 Ar 36 0.003336 -18 Ar 38 0.000629 -18 Ar 40 0.996035 -19 K 39 0.932581 -19 K 40 0.000117 -19 K 41 0.067302 -20 Ca 40 0.96941 -20 Ca 42 0.00647 -20 Ca 43 0.00135 -20 Ca 44 0.02086 -20 Ca 46 4e-05 -20 Ca 48 0.00187 -21 Sc 45 1.0 -22 Ti 46 0.0825 -22 Ti 47 0.0744 -22 Ti 48 0.7372 -22 Ti 49 0.0541 -22 Ti 50 0.0518 -23 V Nat 1.0 -24 Cr 50 0.04345 -24 Cr 52 0.83789 -24 Cr 53 0.09501 -24 Cr 54 0.02365 -25 Mn 55 1.0 -26 Fe 54 0.05845 -26 Fe 56 0.91754 -26 Fe 57 0.02119 -26 Fe 58 0.00282 -27 Co 59 1.0 -28 Ni 58 0.68077 -28 Ni 60 0.26223 -28 Ni 61 0.011399 -28 Ni 62 0.036346 -28 Ni 64 0.009255 -29 Cu 63 0.6915 -29 Cu 65 0.3085 -30 Zn Nat 1.0 -31 Ga 69 0.60108 -31 Ga 71 0.39892 -32 Ge 70 0.2057 -32 Ge 72 0.2745 -32 Ge 73 0.0775 -32 Ge 74 0.3650 -32 Ge 76 0.0773 -33 As 75 1.0 -34 Se 74 0.0089 -34 Se 76 0.0937 -34 Se 77 0.0763 -34 Se 78 0.2377 -34 Se 80 0.4961 -34 Se 82 0.0873 -35 Br 79 0.5069 -35 Br 81 0.4931 -36 Kr 78 0.00355 -36 Kr 80 0.02286 -36 Kr 82 0.11593 -36 Kr 83 0.11500 -36 Kr 84 0.56987 -36 Kr 86 0.17279 -37 Rb 85 0.7217 -37 Rb 87 0.2783 -38 Sr 84 0.0056 -38 Sr 86 0.0986 -38 Sr 87 0.07 -38 Sr 88 0.8258 -39 Y 89 1.0 -40 Zr 90 0.5145 -40 Zr 91 0.1122 -40 Zr 92 0.1715 -40 Zr 94 0.1738 -40 Zr 96 0.028 -41 Nb 93 1.0 -42 Mo 92 0.1453 -42 Mo 94 0.0915 -42 Mo 95 0.1584 -42 Mo 96 0.1667 -42 Mo 97 0.0960 -42 Mo 98 0.2439 -42 Mo 100 0.0982 -44 Ru 96 0.0554 -44 Ru 98 0.0187 -44 Ru 99 0.1276 -44 Ru 100 0.126 -44 Ru 101 0.1706 -44 Ru 102 0.3155 -44 Ru 104 0.1862 -45 Rh 103 1.0 -46 Pd 102 0.0102 -46 Pd 104 0.1114 -46 Pd 105 0.2233 -46 Pd 106 0.2733 -46 Pd 108 0.2646 -46 Pd 110 0.1172 -47 Ag 107 0.51839 -47 Ag 109 0.48161 -48 Cd 106 0.0125 -48 Cd 108 0.0089 -48 Cd 110 0.1249 -48 Cd 111 0.128 -48 Cd 112 0.2413 -48 Cd 113 0.1222 -48 Cd 114 0.2873 -48 Cd 116 0.0749 -49 In 113 0.0429 -49 In 115 0.9571 -50 Sn 112 0.0097 -50 Sn 114 0.0066 -50 Sn 115 0.0034 -50 Sn 116 0.1454 -50 Sn 117 0.0768 -50 Sn 118 0.2422 -50 Sn 119 0.0859 -50 Sn 120 0.3258 -50 Sn 122 0.0463 -50 Sn 124 0.0579 -51 Sb 121 0.5721 -51 Sb 123 0.4279 -52 Te 120 0.0009 -52 Te 122 0.0255 -52 Te 123 0.0089 -52 Te 124 0.0474 -52 Te 125 0.0707 -52 Te 126 0.1884 -52 Te 128 0.3174 -52 Te 130 0.3408 -53 I 127 1.0 -54 Xe 124 0.000952 -54 Xe 126 0.000890 -54 Xe 128 0.019102 -54 Xe 129 0.264006 -54 Xe 130 0.040710 -54 Xe 131 0.212324 -54 Xe 132 0.269086 -54 Xe 134 0.104357 -54 Xe 136 0.088573 -55 Cs 133 1.0 -56 Ba 130 0.00106 -56 Ba 132 0.00101 -56 Ba 134 0.02417 -56 Ba 135 0.06592 -56 Ba 136 0.07854 -56 Ba 137 0.11232 -56 Ba 138 0.71698 -57 La 138 0.0008881 -57 La 139 0.9991119 -58 Ce 136 0.00185 -58 Ce 138 0.00251 -58 Ce 140 0.8845 -58 Ce 142 0.11114 -59 Pr 141 1.0 -60 Nd 142 0.27152 -60 Nd 143 0.12174 -60 Nd 144 0.23798 -60 Nd 145 0.08293 -60 Nd 146 0.17189 -60 Nd 148 0.05756 -60 Nd 150 0.05638 -62 Sm 144 0.0307 -62 Sm 147 0.1499 -62 Sm 148 0.1124 -62 Sm 149 0.1382 -62 Sm 150 0.0738 -62 Sm 152 0.2675 -62 Sm 154 0.2275 -63 Eu 151 0.4781 -63 Eu 153 0.5219 -64 Gd 152 0.002 -64 Gd 154 0.0218 -64 Gd 155 0.148 -64 Gd 156 0.2047 -64 Gd 157 0.1565 -64 Gd 158 0.2484 -64 Gd 160 0.2186 -65 Tb 159 1.0 -66 Dy 156 0.00056 -66 Dy 158 0.00095 -66 Dy 160 0.02329 -66 Dy 161 0.18889 -66 Dy 162 0.25475 -66 Dy 163 0.24896 -66 Dy 164 0.28260 -67 Ho 165 1.0 -68 Er 162 0.00139 -68 Er 164 0.01601 -68 Er 166 0.33503 -68 Er 167 0.22869 -68 Er 168 0.26978 -68 Er 170 0.14910 -69 Tm 169 1.0 -70 Yb 168 0.00123 -70 Yb 170 0.02982 -70 Yb 171 0.1409 -70 Yb 172 0.2168 -70 Yb 173 0.16103 -70 Yb 174 0.32026 -70 Yb 176 0.12996 -71 Lu 175 0.97401 -71 Lu 176 0.02599 -72 Hf 174 0.0016 -72 Hf 176 0.0526 -72 Hf 177 0.186 -72 Hf 178 0.2728 -72 Hf 179 0.1362 -72 Hf 180 0.3508 -73 Ta 180 0.0001201 -73 Ta 181 0.9998799 -74 W 180 0.0012 -74 W 182 0.265 -74 W 183 0.1431 -74 W 184 0.3064 -74 W 186 0.2843 -75 Re 185 0.374 -75 Re 187 0.626 -76 Os 184 0.0002 -76 Os 186 0.0159 -76 Os 187 0.0196 -76 Os 188 0.1324 -76 Os 189 0.1615 -76 Os 190 0.2626 -76 Os 192 0.4078 -77 Ir 191 0.373 -77 Ir 193 0.627 -78 Pt 190 0.00012 -78 Pt 192 0.00782 -78 Pt 194 0.3286 -78 Pt 195 0.3378 -78 Pt 196 0.2521 -78 Pt 198 0.07356 -79 Au 197 1.0 -80 Hg 196 0.0015 -80 Hg 198 0.0997 -80 Hg 199 0.1687 -80 Hg 200 0.231 -80 Hg 201 0.1318 -80 Hg 202 0.2986 -80 Hg 204 0.0687 -81 Tl 203 0.2952 -81 Tl 205 0.7048 -82 Pb 204 0.014 -82 Pb 206 0.241 -82 Pb 207 0.221 -82 Pb 208 0.524 -83 Bi 209 1.0 -90 Th 232 1.0 -91 Pa 231 1.0 -92 U 234 5.4e-05 -92 U 235 0.007204 -92 U 238 0.992742 diff --git a/src/utils/analyze_source.py b/src/utils/analyze_source.py deleted file mode 100755 index 0209bfd51a..0000000000 --- a/src/utils/analyze_source.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python2 - -import sys -import os - -# Add color for posix systems -if os.name == 'posix': - colorOn = '\x1b[34m' - colorOff = '\x1b[0m' -else: - colorOn = '' - colorOff = '' - -if len(sys.argv) <= 1: - print("Usage:") - sys.exit() - -source = sys.argv[1:] -source.sort() - -totalCode = 0 -totalComment = 0 -totalSpace = 0 - -for sourceFile in source: - code = 0 - comment = 0 - space = 0 - - ending = sourceFile[sourceFile.rindex('.') + 1:] - if ending == 'c': - commentChar = '/*' - elif ending == 'f': - commentChar = '!' - elif ending == 'f90': - commentChar = '!' - elif ending == 'F90': - commentChar = '!' - - for line in open(sourceFile, 'r'): - line = line.strip() - if line.startswith(commentChar): - comment += 1 - elif line == '': - space += 1 - else: - code += 1 - - total = comment + space + code - totalCode += code - totalComment += comment - totalSpace += space - - print(colorOn + sourceFile + colorOff) - print("Code: {0} ({1:4.1f}%)".format(code, 100.0*float(code)/total)) - print("Comments: {0} ({1:4.1f}%)".format(comment, 100.0*float(comment)/total)) - print("Spaces: {0} ({1:4.1f}%)\n".format(space, 100.0*float(space)/total)) - -total = totalCode + totalComment + totalSpace - -print(colorOn + "TOTAL COUNT" + colorOff) -print("Code: {0} ({1:4.1f}%)".format(totalCode, 100.0*float(totalCode)/total)) -print("Comments: {0} ({1:4.1f}%)".format(totalComment, 100.0*float(totalComment)/total)) -print("Spaces: {0} ({1:4.1f}%)".format(totalSpace, 100.0*float(totalSpace)/total)) -print("Total: {0}\n".format(total)) diff --git a/src/utils/build_dependencies.py b/src/utils/build_dependencies.py deleted file mode 100755 index 2a42b07456..0000000000 --- a/src/utils/build_dependencies.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python2 - -import glob -import re - -dependencies = {} - -for src in glob.iglob('*.F90'): - module = src.strip('.F90') - deps = set() - d = re.findall(r'\n\s*use\s+(\w+)', - open(src, 'r').read()) - for name in d: - if name in ['mpi', 'hdf5', 'h5lt', 'petscsys', 'petscmat', 'petscksp', - 'petscsnes', 'petscvec', 'omp_lib', 'fox_dom']: - continue - deps.add(name) - if deps: - dependencies[module] = sorted(list(deps)) - - -for module in sorted(dependencies.keys()): - for dep in dependencies[module]: - print("{0}.o: {1}.o".format(module, dep)) - print('') diff --git a/src/utils/convert_xsdata.py b/src/utils/convert_xsdata.py index 215b9256a7..708a196f97 100755 --- a/src/utils/convert_xsdata.py +++ b/src/utils/convert_xsdata.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import os import sys diff --git a/src/utils/convert_xsdir.py b/src/utils/convert_xsdir.py index edee1a66c7..7e1606fc4c 100755 --- a/src/utils/convert_xsdir.py +++ b/src/utils/convert_xsdir.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import os import sys diff --git a/src/utils/eigenfunction_rms.py b/src/utils/eigenfunction_rms.py deleted file mode 100644 index 568d173f40..0000000000 --- a/src/utils/eigenfunction_rms.py +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/python2 -# Filename: eigenfunction_rms.py - -# import packages -import statepoint -import numpy as np -import os -import sys - -def main(tally_id, score_id, batch_start, batch_end, name): - - # read in statepoint header data - sp = statepoint.StatePoint('statepoint.ref.binary') - - # read in results - sp.read_results() - - # extract reference mean - mean_ref = extract_mean(sp, tally_id, score_id) - - # write gnuplot file - write_src_gnuplot('testsrc_pin','Pin mesh',mean_ref,np.size(mean_ref,0)) - - # preallocate arrays - hists = np.zeros(batch_end - batch_start + 1) - norms = np.zeros(batch_end - batch_start + 1) - - i = batch_start - while i <= batch_end: - - # process statepoint - sp = statepoint.StatePoint('statepoint.'+str(i)+'.binary') - sp.read_results() - - # extract mean - mean = extract_mean(sp, tally_id, score_id) - - # calculate L2 norm - norm = np.linalg.norm(mean - mean_ref) - - # get history information - n_inactive = sp.n_inactive - current_batch = sp.current_batch - n_particles = sp.n_particles - gen_per_batch = sp.gen_per_batch - n_histories = (current_batch - n_inactive)*n_particles*gen_per_batch - - # batch in vectors - hists[i - batch_start] = n_histories - norms[i - batch_start] = norm - - # print - print 'Batch: '+str(i)+' Histories: '+str(n_histories)+' Norm: '+str(norm) - - i += 1 - - # write out gnuplot file - write_norm_gnuplot(name,hists,norms,np.size(hists)) - -def extract_mean(sp, tally_id,score_id): - - # extract results - results = sp.extract_results(tally_id,score_id) - - # extract means and copy - mean = results['mean'].copy() - - # reshape and integrate over energy - mean = mean.reshape(results['bin_max'],order='F') - mean = np.sum(mean,0) - mean = np.sum(mean,0) - mean = mean/mean.sum()*(mean > 1.e-8).sum() - - return mean - -def write_norm_gnuplot(path,xdat,ydat,size): - - # Header String for GNUPLOT - headerstr = """#!/usr/bin/env gnuplot - -set terminal pdf enhanced -set output '{output}' -set ylabel 'L-2 norm' -set xlabel 'Histories' -set log x -set log y -""".format(output=path+'.pdf') - - # Write out the plot string - pltstr = "plot '-' using 1:2 with lines" - - # Write out the data string - i = 0 - datastr = '' - while i < size: - datastr = datastr + '{0} {1}\n'.format(xdat[i],ydat[i]) - i += 1 - - # Concatenate all - outstr = headerstr + '\n' + pltstr + '\n' + datastr - - # Write File - with open(path+".plot",'w') as f: - f.write(outstr) - - # Run GNUPLOT - os.system('gnuplot ' + path+".plot") - -def write_src_gnuplot(path,name,src,size): - - # Header String for GNUPLOT - headerstr = """#!/usr/bin/env gnuplot - -set terminal pdf enhanced -set output '{output}' -set palette defined (0 '#000090', 1 '#000fff', 2 '#0090ff', 3 '#0fffee', 4 '#90ff70', 5 '#ffee00', 6 '#ff7000', 7 '#ee0000', 8 '#7f0000') -set view map -set size ratio -1 -set lmargin at screen 0.10 -set rmargin at screen 0.90 -set bmargin at screen 0.15 -set tmargin at screen 0.90 -unset xtics -unset ytics -set title '{title}'""".format(output=path+'.pdf',title=name) - - # Write out the plot string - pltstr = "splot '-' matrix with image " - - # Write out the data string - i = 0 - datastr = '' - while i < size: - j = 0 - while j < size: - datastr = datastr + '{0} '.format(src[i,j][0]) - j += 1 - datastr = datastr + '\n' - i += 1 - - # replace all nan with zero - datastr = datastr.replace('nan','0.0') - - # Concatenate all - outstr = headerstr + '\n' + pltstr + '\n' + datastr - - # Write File - with open(path+".plot",'w') as f: - f.write(outstr) - - # Run GNUPLOT - os.system('gnuplot ' + path+".plot") - -if __name__ == "__main__": - tally_id = int(sys.argv[1]) - score_id = sys.argv[2] - batch_start = int(sys.argv[3]) - batch_end = int(sys.argv[4]) - name = sys.argv[5] - main(tally_id, score_id, batch_start, batch_end, name) diff --git a/src/utils/memory_usage.py b/src/utils/memory_usage.py index bf3cc1efd7..32655c62c7 100755 --- a/src/utils/memory_usage.py +++ b/src/utils/memory_usage.py @@ -1,7 +1,12 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python -# This script reads a cross_sections.out file, adds up the memory usage for -# each nuclide and S(a,b) table, and displays the total memory usage +""" +This script reads a cross_sections.out file, adds up the memory usage for each +nuclide and S(a,b) table, and displays the total memory usage. + +""" + +from __future__ import print_function import sys import os diff --git a/src/utils/particle_restart.py b/src/utils/particle_restart.py index 92d28910c6..c547234b06 100644 --- a/src/utils/particle_restart.py +++ b/src/utils/particle_restart.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import struct @@ -50,9 +50,9 @@ class Particle(object): def _get_long(self, n=1, path=None): if self._hdf5: - return [long(v) for v in self._f[path].value] + return [int(v) for v in self._f[path].value] else: - return [long(v) for v in self._get_data(n, 'q', 8)] + return [int(v) for v in self._get_data(n, 'q', 8)] def _get_float(self, n=1, path=None): if self._hdf5: diff --git a/src/utils/plot_mesh_tally.py b/src/utils/plot_mesh_tally.py index fb5b8cb839..b78305ebb6 100755 --- a/src/utils/plot_mesh_tally.py +++ b/src/utils/plot_mesh_tally.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python """Python script to plot tally data generated by OpenMC.""" @@ -15,12 +15,16 @@ from statepoint import * if sys.version_info[0] < 3: import Tkinter as tk + import tkFileDialog as filedialog + import tkFont as font + import tkMessageBox as messagebox + import ttk as ttk else: import tkinter as tk -import tkFileDialog -import tkFont -import tkMessageBox -import ttk + import tkinter.filedialog as filedialog + import tkinter.font as font + import tkinter.messagebox as messagebox + import tkinter.ttk as ttk class MeshPlotter(tk.Frame): @@ -111,8 +115,9 @@ class MeshPlotter(tk.Frame): self.scoreBox.bind('<>', self.redraw) # Filter label - font = tkFont.Font(weight='bold') - labelFilters = tk.Label(self.selectFrame, text='Filters:', font=font) + boldfont = font.Font(weight='bold') + labelFilters = tk.Label(self.selectFrame, text='Filters:', + font=boldfont) labelFilters.grid(row=5, column=0, sticky=tk.W) def update(self, event=None): @@ -296,8 +301,8 @@ class MeshPlotter(tk.Frame): self.meshTallies.append(itally) if not self.meshTallies: - tkMessageBox.showerror("Invalid StatePoint File", - "File does not contain mesh tallies!") + messagebox.showerror("Invalid StatePoint File", + "File does not contain mesh tallies!") sys.exit(1) @@ -308,16 +313,16 @@ if __name__ == '__main__': # If no filename given as command-line argument, open file dialog if len(sys.argv) < 2: - filename = tkFileDialog.askopenfilename(title='Select statepoint file', - initialdir='.') + filename = filedialog.askopenfilename(title='Select statepoint file', + initialdir='.') else: filename = sys.argv[1] if filename: # Check to make sure file exists if not os.path.isfile(filename): - tkMessageBox.showerror("File not found", - "Could not find regular file: " + filename) + messagebox.showerror("File not found", + "Could not find regular file: " + filename) sys.exit(1) app = MeshPlotter(root, filename) diff --git a/src/utils/split_nuclide.py b/src/utils/split_nuclide.py deleted file mode 100755 index 2a816ac69d..0000000000 --- a/src/utils/split_nuclide.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python2 - -import sys - -if len(sys.argv) != 3: - print("Must supply element and atom/b-cm") - sys.exit(1) - -element = sys.argv[1] -ao = float(sys.argv[2]) - -for line in open('abundances_modified.txt', 'r'): - words = line.split() - if words[1] == element: - print(''.format( - element, words[2], float(words[3])*ao)) diff --git a/src/utils/statepoint.py b/src/utils/statepoint.py index 3799aa7253..5a9764d92b 100644 --- a/src/utils/statepoint.py +++ b/src/utils/statepoint.py @@ -302,7 +302,7 @@ class StatePoint(object): # Set up stride stride = 1 - for f in t.filters.values()[::-1]: + for f in list(t.filters.values())[::-1]: f.stride = stride stride *= f.length @@ -501,15 +501,15 @@ class StatePoint(object): try: tally = self.tallies[tally_id-1] except: - print 'Tally does not exist' + print('Tally does not exist') return # get the score index if it is present try: idx = tally.scores.index(score_str) except ValueError: - print 'Score does not exist' - print tally.scores + print('Score does not exist') + print(tally.scores) return # create numpy array for mean and 95% CI @@ -543,7 +543,7 @@ class StatePoint(object): # get bounds of filter bins for akey in tally.filters.keys(): - idx = tally.filters.keys().index(akey) + idx = list(tally.filters.keys()).index(akey) filtmax[n_filters - idx] = tally.filters[akey].length # compute bin info @@ -554,11 +554,11 @@ class StatePoint(object): np.prod(filtmax[0:i+2]))/(np.prod(filtmax[0:i+1]))) + 1 # append in dictionary bin with filter - data.update({tally.filters.keys()[n_filters - i - 1]: - filters[:,n_filters - i - 1]}) + data.update({list(tally.filters.keys())[n_filters - i - 1]: + filters[:,n_filters - i - 1]}) # check for mesh - if tally.filters.keys()[n_filters - i - 1] == 'mesh': + if list(tally.filters.keys())[n_filters - i - 1] == 'mesh': dims = list(self.meshes[tally.filters['mesh'].bins[0] - 1].dimension) dims.reverse() dims = np.asarray(dims) @@ -572,12 +572,12 @@ class StatePoint(object): np.prod(meshmax[0:3]))/(np.prod(meshmax[0:2]))) + 1 mesh_bins[:,0] = np.floor(((filters[:,n_filters - i - 1] - 1) % np.prod(meshmax[0:4]))/(np.prod(meshmax[0:3]))) + 1 - data.update({'mesh':zip(mesh_bins[:,0],mesh_bins[:,1], - mesh_bins[:,2])}) + data.update({'mesh': list(zip(mesh_bins[:,0], mesh_bins[:,1], + mesh_bins[:,2]))}) i += 1 # add in maximum bin filters and order - b = tally.filters.keys() + b = list(tally.filters.keys()) b.reverse() filtmax = list(filtmax[1:]) try: @@ -604,9 +604,9 @@ class StatePoint(object): def _get_long(self, n=1, path=None): if self._hdf5: - return [long(v) for v in self._f[path].value] + return [int(v) for v in self._f[path].value] else: - return [long(v) for v in self._get_data(n, 'q', 8)] + return [int(v) for v in self._get_data(n, 'q', 8)] def _get_float(self, n=1, path=None): if self._hdf5: diff --git a/src/utils/statepoint_3d.py b/src/utils/statepoint_3d.py index 904148cd35..df550782e2 100755 --- a/src/utils/statepoint_3d.py +++ b/src/utils/statepoint_3d.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2 -from __future__ import division +from __future__ import division, print_function import sys import itertools @@ -17,7 +17,7 @@ err = False def parse_options(): """Process command line arguments""" - + def tallies_callback(option, opt, value, parser): """Option parser function for list of tallies""" @@ -42,7 +42,7 @@ def parse_options(): except: p.print_help() err = True - + def filters_callback(option, opt, value, parser): """Option parser function for list of filters""" global err @@ -59,7 +59,7 @@ def parse_options(): except: p.print_help() err = True - + from optparse import OptionParser usage = r"""%prog [options] @@ -98,12 +98,12 @@ You can list the available tallies, scores, and filters with the -l option: p.add_option('-o', '--output', action='store', dest='output', default='tally', help='path to output SILO file.') p.add_option('-e', '--error', dest='valerr', default=False, - action='store_true', + action='store_true', help='Flag to extract errors instead of values.') p.add_option('-v', '--vtk', action='store_true', dest='vtk', default=False, help='Flag to convert to VTK instead of SILO.') parsed = p.parse_args() - + if not parsed[1]: p.print_help() return parsed, err @@ -118,35 +118,35 @@ You can list the available tallies, scores, and filters with the -l option: ################################################################################ def main(file_, o): """Main program""" - + sp = StatePoint(file_) sp.read_results() validate_options(sp, o) - + if o.list: print_available(sp) return - + if o.vtk: if not o.output[-4:] == ".vtm": o.output += ".vtm" else: if not o.output[-5:] == ".silo": o.output += ".silo" - + if o.vtk: try: import vtk except: - print 'The vtk python bindings do not appear to be installed properly.\n'+\ - 'On Ubuntu: sudo apt-get install python-vtk\n'+\ - 'See: http://www.vtk.org/' + print('The vtk python bindings do not appear to be installed properly.\n' + 'On Ubuntu: sudo apt-get install python-vtk\n' + 'See: http://www.vtk.org/') return else: try: import silomesh except: - print 'The silomesh package does not appear to be installed properly.\n'+\ - 'See: https://github.com/nhorelik/silomesh/' + print('The silomesh package does not appear to be installed properly.\n' + 'See: https://github.com/nhorelik/silomesh/') return if o.vtk: @@ -158,20 +158,20 @@ def main(file_, o): # Tally loop ################################################################# for tally in sp.tallies: - + # skip non-mesh tallies or non-user-specified tallies if o.tallies and not tally.id in o.tallies: continue if not 'mesh' in tally.filters: continue - - print "Processing Tally {}...".format(tally.id) - + + print("Processing Tally {}...".format(tally.id)) + # extract filter options and mesh parameters for this tally filtercombos = get_filter_combos(tally) meshparms = get_mesh_parms(sp, tally) nx,ny,nz = meshparms[:3] ll = meshparms[3:6] ur = meshparms[6:9] - + if o.vtk: ww = [(u-l)/n for u,l,n in zip(ur,ll,(nx,ny,nz))] grid = grid = vtk.vtkImageData() @@ -180,17 +180,17 @@ def main(file_, o): grid.SetSpacing(*ww) else: silomesh.init_mesh('Tally_{}'.format(tally.id), *meshparms) - + # Score loop ############################################################### for sid,score in enumerate(tally.scores): - + # skip non-user-specified scrores for this tally if o.scores and tally.id in o.scores and not sid in o.scores[tally.id]: continue - + # Filter loop ############################################################ for filterspec in filtercombos: - + # skip non-user-specified filter bins skip = False if o.filters and tally.id in o.filters: @@ -200,7 +200,7 @@ def main(file_, o): skip = True break if skip: continue - + # find and sanitize the variable name for this score varname = get_sanitized_filterspec_name(tally, score, filterspec) if o.vtk: @@ -209,9 +209,9 @@ def main(file_, o): dataforvtk = {} else: silomesh.init_var(varname) - + lbl = "\t Score {}.{} {}:\t\t{}".format(tally.id, sid+1, score, varname) - + # Mesh fill loop ####################################################### for x in range(1,nx+1): sys.stdout.write(lbl+" {0}%\r".format(int(x/nx*100))) @@ -226,27 +226,27 @@ def main(file_, o): dataforvtk[i] = float(val) else: silomesh.set_value(float(val), x, y, z) - + # end mesh fill loop - print + print() if o.vtk: for i in range(nx*ny*nz): vtkdata.InsertNextValue(dataforvtk[i]) grid.GetCellData().AddArray(vtkdata) del vtkdata - + else: silomesh.finalize_var() - + # end filter loop - + # end score loop if o.vtk: blocks.SetBlock(block_idx, grid) block_idx += 1 else: silomesh.finalize_mesh() - + # end tally loop if o.vtk: writer = vtk.vtkXMLMultiBlockDataWriter() @@ -259,7 +259,7 @@ def main(file_, o): ################################################################################ def get_sanitized_filterspec_name(tally, score, filterspec): """Returns a name fit for silo vars for a given filterspec, tally and score""" - + comboname = "_"+" ".join(["{}_{}".format(filter_, bin) for filter_, bin in filterspec[1:]]) if len(filterspec[1:]) == 0: comboname = '' @@ -274,16 +274,16 @@ def get_filter_combos(tally): Each combo has the mesh spec as the first element, to be set later. These filter specs correspond with the second argument to StatePoint.get_value """ - + specs = [] if len(tally.filters) == 1: return [[['mesh', [1, 1, 1]]]] - - filters = tally.filters.keys() + + filters = list(tally.filters.keys()) filters.pop(filters.index('mesh')) nbins = [tally.filters[f].length for f in filters] - + combos = [ [b] for b in range(nbins[0])] for i,b in enumerate(nbins[1:]): prod = list(itertools.product(combos, range(b))) @@ -311,25 +311,25 @@ def get_mesh_parms(sp, tally): ################################################################################ def print_available(sp): """Prints available tallies/scores in a statepoint""" - - print "Available tally and score indices:" + + print("Available tally and score indices:") for tally in sp.tallies: mesh = "" if not 'mesh' in tally.filters: mesh = "(no mesh)" - print "\tTally {} {}".format(tally.id, mesh) - scores = ["{}.{}: {}".format(tally.id, sid, score) + print("\tTally {} {}".format(tally.id, mesh)) + scores = ["{}.{}: {}".format(tally.id, sid, score) for sid, score in enumerate(tally.scores)] for score in scores: - print "\t\tScore {}".format(score) + print("\t\tScore {}".format(score)) for filter_ in tally.filters: if filter_ == 'mesh': continue for bin in range(tally.filters[filter_].length): - print "\t\t\tFilters: {}.{}.{}".format(tally.id, filter_, bin) + print("\t\t\tFilters: {}.{}.{}".format(tally.id, filter_, bin)) ################################################################################ def validate_options(sp,o): """Validates specified tally/score options for the current statepoint""" - + available_tallies = [t.id for t in sp.tallies] if o.tallies: for otally in o.tallies: @@ -345,7 +345,7 @@ def validate_options(sp,o): for oscore in o.scores[otally]: if oscore > len(tally.scores): warnings.warn('No score {} in tally {}'.format(oscore, otally)) - + if o.scores: for otally in o.scores.keys(): if not otally in available_tallies: @@ -355,7 +355,7 @@ def validate_options(sp,o): warnings.warn( 'Skipping scores for tally {}, excluded by tally list'.format(otally)) continue - + if o.filters: for otally in o.filters.keys(): if not otally in available_tallies: @@ -380,7 +380,7 @@ def validate_options(sp,o): warnings.warn( 'No bin {} in tally {} filter {}'.format(bin, otally, filter_)) -################################################################################ +################################################################################ # monkeypatch to suppress the source echo produced by warnings def formatwarning(message, category, filename, lineno, line): return "{}:{}: {}: {}\n".format(filename, lineno, category.__name__, message) diff --git a/src/utils/statepoint_cmp.py b/src/utils/statepoint_cmp.py index d1108a7bd5..0e3d8a94f6 100755 --- a/src/utils/statepoint_cmp.py +++ b/src/utils/statepoint_cmp.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import sys diff --git a/src/utils/statepoint_histogram.py b/src/utils/statepoint_histogram.py index 6276fde056..e16d368dfb 100755 --- a/src/utils/statepoint_histogram.py +++ b/src/utils/statepoint_histogram.py @@ -1,5 +1,6 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python +from __future__ import print_function from sys import argv from math import sqrt diff --git a/src/utils/statepoint_meshplot.py b/src/utils/statepoint_meshplot.py index 23ed910e70..f557a256e6 100755 --- a/src/utils/statepoint_meshplot.py +++ b/src/utils/statepoint_meshplot.py @@ -1,4 +1,6 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python + +from __future__ import print_function, division from sys import argv from math import sqrt @@ -56,7 +58,7 @@ for t in sp.tallies: nx, ny, nz = m.dimension # Calculate number of score bins - ns = t.total_score_bins * t.total_filter_bins / (nx*ny*nz) + ns = t.total_score_bins * t.total_filter_bins // (nx*ny*nz) assert n_bins == nx*ny*nz*ns # Create lists for tallies diff --git a/src/utils/tally_conv.py b/src/utils/tally_conv.py index 99574bbb91..8f60dd2067 100755 --- a/src/utils/tally_conv.py +++ b/src/utils/tally_conv.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # This program takes OpenMC statepoint binary files and creates a variety of # outputs from them which should provide the user with an idea of the @@ -15,6 +15,7 @@ # fileType, printxs, showImg, and savetoCSV. See the options block for more # information. +from __future__ import print_function from math import sqrt, pow from glob import glob diff --git a/src/utils/voxel.py b/src/utils/voxel.py index 89041f8027..18488e1c0e 100755 --- a/src/utils/voxel.py +++ b/src/utils/voxel.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2 -from __future__ import division +from __future__ import division, print_function import struct import sys @@ -25,7 +25,7 @@ def parse_options(): ################################################################################ def main(file_, o): - print file_ + print(file_) fh = open(file_,'rb') header = get_header(fh) meshparms = header['dimension'] + header['lower_left'] + header['upper_right'] @@ -36,18 +36,18 @@ def main(file_, o): try: import vtk except: - print 'The vtk python bindings do not appear to be installed properly.\n'+\ - 'On Ubuntu: sudo apt-get install python-vtk\n'+\ - 'See: http://www.vtk.org/' + print('The vtk python bindings do not appear to be installed properly.\n' + 'On Ubuntu: sudo apt-get install python-vtk\n' + 'See: http://www.vtk.org/') return - + origin = [(l+w*n/2.) for n,l,w in zip((nx,ny,nz),ll,header['width'])] - + grid = vtk.vtkImageData() grid.SetDimensions(nx+1,ny+1,nz+1) grid.SetOrigin(*ll) grid.SetSpacing(*header['width']) - + data = vtk.vtkDoubleArray() data.SetName("id") data.SetNumberOfTuples(nx*ny*nz) @@ -60,7 +60,7 @@ def main(file_, o): id_ = get_int(fh)[0] data.SetValue(i, id_) grid.GetCellData().AddArray(data) - + writer = vtk.vtkXMLImageDataWriter() writer.SetInput(grid) if not o.output[-4:] == ".vti": o.output += ".vti" @@ -72,8 +72,8 @@ def main(file_, o): try: import silomesh except: - print 'The silomesh package does not appear to be installed properly.\n'+\ - 'See: https://github.com/nhorelik/silomesh/' + print('The silomesh package does not appear to be installed properly.\n' + 'See: https://github.com/nhorelik/silomesh/') return if not o.output[-5:] == ".silo": o.output += ".silo" silomesh.init_silo(o.output) @@ -86,10 +86,10 @@ def main(file_, o): for z in range(1,nz+1): id_ = get_int(fh)[0] silomesh.set_value(float(id_), x, y, z) - print + print() silomesh.finalize_var() silomesh.finalize_mesh() - silomesh.finalize_silo() + silomesh.finalize_silo() ################################################################################ def get_header(file_): diff --git a/tests/run_tests.py b/tests/run_tests.py index 12e6632cee..cad3731e2a 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -8,7 +8,7 @@ import shutil import re import glob import socket -from subprocess import call +from subprocess import call from collections import OrderedDict from optparse import OptionParser @@ -25,7 +25,7 @@ parser.add_option('-C', '--build-config', dest='build_config', Specific build configurations can be printed out with \ optional argument -p, --print. This uses standard \ regex syntax to select build configurations.") -parser.add_option('-l', '--list', action="store_true", +parser.add_option('-l', '--list', action="store_true", dest="list_build_configs", default=False, help="List out build configurations.") parser.add_option("-p", "--project", dest="project", default="", @@ -117,7 +117,7 @@ class Test(object): self.success = True self.msg = None self.skipped = False - self.valgrind_cmd = "" + self.valgrind_cmd = "" self.gcov_cmd = "" self.cmake = ['cmake', '-H../src', '-Bbuild'] @@ -263,7 +263,7 @@ class Test(object): # Simple function to add a test to the global tests dictionary def add_test(name, debug=False, optimize=False, mpi=False, openmp=False,\ hdf5=False, petsc=False, valgrind=False, coverage=False): - tests.update({name:Test(name, debug, optimize, mpi, openmp, hdf5, petsc, + tests.update({name:Test(name, debug, optimize, mpi, openmp, hdf5, petsc, valgrind, coverage)}) # List of all tests that may be run. User can add -C to command line to specify @@ -330,7 +330,7 @@ if options.build_config is not None: del tests[key] # Check for dashboard and determine whether to push results to server -# Note that there are only 3 basic dashboards: +# Note that there are only 3 basic dashboards: # Experimental, Nightly, Continuous. On the CDash end, these can be # reorganized into groups when a hostname, dashboard and build name # are matched. @@ -349,7 +349,7 @@ else: update = '' # Check for CTest scipts mode -# Sets up whether we should use just the basic ctest command or use +# Sets up whether we should use just the basic ctest command or use # CTest scripting to perform tests. if not options.dash is None or options.script: script_mode = True @@ -394,7 +394,7 @@ if not script_mode: del tests[key] # Check if tests empty -if len(tests.keys()) == 0: +if len(list(tests.keys())) == 0: print('No tests to run.') exit() @@ -416,7 +416,7 @@ for key in iter(tests): if not test.success: continue - # Get valgrind command + # Get valgrind command if test.valgrind: test.find_valgrind() if not test.success: @@ -427,7 +427,7 @@ for key in iter(tests): test.find_coverage() if not test.success: continue - + # Set test specific CTest script vars. Not used in non-script mode ctest_vars.update({'build_name' : test.get_build_name()}) ctest_vars.update({'build_opts' : test.get_build_opts()}) diff --git a/tests/test_tally_assumesep/results.py b/tests/test_tally_assumesep/results.py index 4890ea4951..3cba794205 100644 --- a/tests/test_tally_assumesep/results.py +++ b/tests/test_tally_assumesep/results.py @@ -23,7 +23,7 @@ results2 = sp.tallies[1].results shape2 = results2.shape size2 = (np.product(shape2)) results2 = np.reshape(results2, size2) -results3 = sp.tallies[1].results +results3 = sp.tallies[2].results shape3 = results3.shape size3 = (np.product(shape3)) results3 = np.reshape(results3, size3) diff --git a/tests/test_tally_assumesep/results_true.dat b/tests/test_tally_assumesep/results_true.dat index eb3c57a421..5fae2a1eb9 100644 --- a/tests/test_tally_assumesep/results_true.dat +++ b/tests/test_tally_assumesep/results_true.dat @@ -7,5 +7,5 @@ tally 2: 3.372300E+00 2.331937E+00 tally 3: -3.372300E+00 -2.331937E+00 +4.802737E+01 +4.730991E+02