Commit 256eb549da5075fdf0d6d6f6eca2e972e2cd0593
1 parent
ecaf3bd8
Try reduce unit test execution time for cscripts
Showing
2 changed files
with
20 additions
and
20 deletions
test/test_cspull.py
| ... | ... | @@ -76,10 +76,10 @@ class Test(test): |
| 76 | 76 | # Setup cspull command |
| 77 | 77 | cmd = cspull+' inmodel="'+self._model+'"'+ \ |
| 78 | 78 | ' outfile="cspull_cmd1.dat"'+ \ |
| 79 | - ' ntrials=3'+ \ | |
| 79 | + ' ntrials=2'+ \ | |
| 80 | 80 | ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ |
| 81 | 81 | ' ra=83.6331 dec=22.0145 emin=0.1 emax=100.0'+ \ |
| 82 | - ' enumbins=0 tmax=1800.0 deadc=0.95 rad=5.0'+ \ | |
| 82 | + ' enumbins=0 tmax=100.0 deadc=0.95 rad=5.0'+ \ | |
| 83 | 83 | ' npix=200 binsz=0.05'+ \ |
| 84 | 84 | ' logfile="cspull_cmd1.log" chatter=1' |
| 85 | 85 | |
| ... | ... | @@ -97,10 +97,10 @@ class Test(test): |
| 97 | 97 | # Setup cspull command |
| 98 | 98 | cmd = cspull+' inmodel="model_that_does_not_exist.xml"'+ \ |
| 99 | 99 | ' outfile="cspull_cmd1.dat"'+ \ |
| 100 | - ' ntrials=3'+ \ | |
| 100 | + ' ntrials=2'+ \ | |
| 101 | 101 | ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ |
| 102 | 102 | ' ra=83.6331 dec=22.0145 emin=0.1 emax=100.0'+ \ |
| 103 | - ' enumbins=0 tmax=1800.0 deadc=0.95 rad=5.0'+ \ | |
| 103 | + ' enumbins=0 tmax=100.0 deadc=0.95 rad=5.0'+ \ | |
| 104 | 104 | ' npix=200 binsz=0.05'+ \ |
| 105 | 105 | ' logfile="cspull_cmd2.log"' |
| 106 | 106 | |
| ... | ... | @@ -120,7 +120,7 @@ class Test(test): |
| 120 | 120 | pull = cscripts.cspull() |
| 121 | 121 | pull['inmodel'] = self._model |
| 122 | 122 | pull['outfile'] = 'cspull_py1.dat' |
| 123 | - pull['ntrials'] = 3 | |
| 123 | + pull['ntrials'] = 2 | |
| 124 | 124 | pull['caldb'] = self._caldb |
| 125 | 125 | pull['irf'] = self._irf |
| 126 | 126 | pull['ra'] = 83.6331 |
| ... | ... | @@ -128,7 +128,7 @@ class Test(test): |
| 128 | 128 | pull['emin'] = 0.1 |
| 129 | 129 | pull['emax'] = 100.0 |
| 130 | 130 | pull['enumbins'] = 0 |
| 131 | - pull['tmax'] = 1800.0 | |
| 131 | + pull['tmax'] = 100.0 | |
| 132 | 132 | pull['deadc'] = 0.95 |
| 133 | 133 | pull['rad'] = 5.0 |
| 134 | 134 | pull['logfile'] = 'cspull_py1.log' |
| ... | ... | @@ -146,7 +146,7 @@ class Test(test): |
| 146 | 146 | pull = cscripts.cspull() |
| 147 | 147 | pull['inmodel'] = self._model |
| 148 | 148 | pull['outfile'] = 'cspull_py2.dat' |
| 149 | - pull['ntrials'] = 3 | |
| 149 | + pull['ntrials'] = 2 | |
| 150 | 150 | pull['caldb'] = self._caldb |
| 151 | 151 | pull['irf'] = self._irf |
| 152 | 152 | pull['ra'] = 83.6331 |
| ... | ... | @@ -154,7 +154,7 @@ class Test(test): |
| 154 | 154 | pull['emin'] = 0.1 |
| 155 | 155 | pull['emax'] = 100.0 |
| 156 | 156 | pull['enumbins'] = 10 |
| 157 | - pull['tmax'] = 1800.0 | |
| 157 | + pull['tmax'] = 100.0 | |
| 158 | 158 | pull['deadc'] = 0.95 |
| 159 | 159 | pull['rad'] = 5.0 |
| 160 | 160 | pull['npix'] = 100 |
| ... | ... | @@ -175,7 +175,7 @@ class Test(test): |
| 175 | 175 | pull['inobs'] = self._events |
| 176 | 176 | pull['inmodel'] = self._model |
| 177 | 177 | pull['outfile'] = 'cspull_py3.dat' |
| 178 | - pull['ntrials'] = 3 | |
| 178 | + pull['ntrials'] = 2 | |
| 179 | 179 | pull['caldb'] = self._caldb |
| 180 | 180 | pull['irf'] = self._irf |
| 181 | 181 | pull['enumbins'] = 0 |
| ... | ... | @@ -197,7 +197,7 @@ class Test(test): |
| 197 | 197 | pull = cscripts.cspull(obs) |
| 198 | 198 | pull['inmodel'] = self._model |
| 199 | 199 | pull['outfile'] = 'cspull_py4.dat' |
| 200 | - pull['ntrials'] = 3 | |
| 200 | + pull['ntrials'] = 2 | |
| 201 | 201 | pull['caldb'] = self._caldb |
| 202 | 202 | pull['irf'] = self._irf |
| 203 | 203 | pull['enumbins'] = 0 |
| ... | ... | @@ -216,7 +216,7 @@ class Test(test): |
| 216 | 216 | pull['inobs'] = self._inobs |
| 217 | 217 | pull['inmodel'] = self._stacked_model |
| 218 | 218 | pull['outfile'] = 'cspull_py5.dat' |
| 219 | - pull['ntrials'] = 3 | |
| 219 | + pull['ntrials'] = 2 | |
| 220 | 220 | pull['enumbins'] = 0 |
| 221 | 221 | pull['logfile'] = 'cspull_py5.log' |
| 222 | 222 | pull['chatter'] = 4 |
| ... | ... | @@ -235,7 +235,7 @@ class Test(test): |
| 235 | 235 | pull['inobs'] = self._inobs_two |
| 236 | 236 | pull['inmodel'] = self._model |
| 237 | 237 | pull['outfile'] = 'cspull_py6.dat' |
| 238 | - pull['ntrials'] = 3 | |
| 238 | + pull['ntrials'] = 2 | |
| 239 | 239 | pull['emin'] = 0.02 |
| 240 | 240 | pull['emax'] = 100.0 |
| 241 | 241 | pull['enumbins'] = 10 |
| ... | ... | @@ -264,8 +264,8 @@ class Test(test): |
| 264 | 264 | pulls = gammalib.GCsv(filename) |
| 265 | 265 | |
| 266 | 266 | # Check dimensions |
| 267 | - self.test_value(pulls.nrows(), 4, | |
| 268 | - 'Check for 4 rows in pull file') | |
| 267 | + self.test_value(pulls.nrows(), 3, | |
| 268 | + 'Check for 3 rows in pull file') | |
| 269 | 269 | |
| 270 | 270 | # Return |
| 271 | 271 | return | ... | ... |
test/test_cssens.py
| 1 | 1 | #! /usr/bin/env python |
| 2 | 2 | # ========================================================================== |
| 3 | -# This scripts performs unit tests for the cssens script. | |
| 3 | +# This scripts performs unit tests for the cssens script | |
| 4 | 4 | # |
| 5 | 5 | # Copyright (C) 2016 Juergen Knoedlseder |
| 6 | 6 | # |
| ... | ... | @@ -72,7 +72,7 @@ class Test(test): |
| 72 | 72 | cmd = cssens+' inmodel="'+self._model+'"'+ \ |
| 73 | 73 | ' srcname="Crab"'+ \ |
| 74 | 74 | ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ |
| 75 | - ' duration=1800.0 rad=3.0 emin=1.0 emax=10.0 bins=1'+ \ | |
| 75 | + ' duration=500.0 rad=3.0 emin=1.0 emax=10.0 bins=1'+ \ | |
| 76 | 76 | ' outfile="cssens_cmd1.dat"'+ \ |
| 77 | 77 | ' logfile="cssens_cmd1.log" chatter=1' |
| 78 | 78 | |
| ... | ... | @@ -91,7 +91,7 @@ class Test(test): |
| 91 | 91 | cmd = cssens+' inmodel="model_that_does_not_exist.xml"'+ \ |
| 92 | 92 | ' srcname="Crab"'+ \ |
| 93 | 93 | ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ |
| 94 | - ' duration=1800.0 rad=3.0 emin=1.0 emax=10.0 bins=1'+ \ | |
| 94 | + ' duration=500.0 rad=3.0 emin=1.0 emax=10.0 bins=1'+ \ | |
| 95 | 95 | ' outfile="cssens_cmd2.dat"'+ \ |
| 96 | 96 | ' logfile="cssens_cmd2.log" chatter=2' |
| 97 | 97 | |
| ... | ... | @@ -115,7 +115,7 @@ class Test(test): |
| 115 | 115 | sens['caldb'] = self._caldb |
| 116 | 116 | sens['irf'] = self._irf |
| 117 | 117 | sens['outfile'] = 'cssens_py1.dat' |
| 118 | - sens['duration'] = 1800.0 | |
| 118 | + sens['duration'] = 500.0 | |
| 119 | 119 | sens['rad'] = 3.0 |
| 120 | 120 | sens['emin'] = 1.0 |
| 121 | 121 | sens['emax'] = 10.0 |
| ... | ... | @@ -144,9 +144,9 @@ class Test(test): |
| 144 | 144 | |
| 145 | 145 | # Check dimensions |
| 146 | 146 | self.test_value(results.nrows(), 2, |
| 147 | - 'Check for 2 rows in sensitivity file') | |
| 147 | + 'Check number of rows in sensitivity file') | |
| 148 | 148 | self.test_value(results.ncols(), 7, |
| 149 | - 'Check for 7 columns in sensitivity file') | |
| 149 | + 'Check number of columns in sensitivity file') | |
| 150 | 150 | |
| 151 | 151 | # Return |
| 152 | 152 | return | ... | ... |