-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
257c730
commit fa0e241
Showing
6 changed files
with
179 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import unittest | ||
|
||
from . import c12e | ||
from ._crosssectiontest import CrossSectionTest | ||
|
||
|
||
class C12ETest(CrossSectionTest): | ||
c = c12e # ensure we can access interaction channel module as self.c | ||
|
||
# iterable with tuples (eNu, eE, dSigma_dE(eNu, eE)) | ||
test_dSigma_dE_values = ( | ||
(25, 7.662, 3.3139319366555277e-18), | ||
(25, 7.6629, 3.3139319366555277e-18), | ||
(50, 32.662, 7.669220668928699e-17), | ||
(75, 57.662, 4.196362653200819e-16), | ||
(100, 82.662, 1.2581902241845584e-15), | ||
) | ||
|
||
# iterable with tuples (eNu, eE, dSigma_dE(eNu, eE)) | ||
test_dSigma_dE_edgecases_values = ( | ||
(17.337, 0, 0), # eNu too small | ||
(25, 7.6609, 0), # eE too small | ||
(25, 7.6631, 0), # eE too large | ||
) | ||
|
||
# iterable with tuples (eNu, cosT, dSigma_dE(eNu, cosT)) | ||
test_dSigma_dCosT_values = ( | ||
(20, -0.99, 0.5), | ||
(20, 0.00, 0.5), | ||
(20, 0.99, 0.5), | ||
(50, -0.50, 0.5), | ||
(50, 0.00, 0.5), | ||
(50, 0.50, 0.5), | ||
) | ||
|
||
# iterable with tuples (eNu, cosT, get_eE(eNu, cosT)) | ||
test_get_eE_values = ( | ||
(20, -0.99, 2.662), | ||
(20, 0.00, 2.662), | ||
(20, 0.99, 2.662), | ||
# testing higher energies is more complicated, since there are multiple possible return values | ||
) | ||
|
||
# iterable with tuples (eNu, bounds_eE(eNu)[0], bounds_eE(eNu)[1]) | ||
test_bounds_eE_values = ( | ||
(20, 2.661, 2.663), | ||
(50, 32.661, 32.663), | ||
) | ||
|
||
# value of bounds_eNu[0] | ||
test_bounds_eNu_minvalue = 18.138 | ||
|
||
# ensure that unittest doesn't run tests in the base class, via https://stackoverflow.com/a/22836015 | ||
del(CrossSectionTest) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import unittest | ||
|
||
from . import c12eb | ||
from ._crosssectiontest import CrossSectionTest | ||
|
||
|
||
class C12EBTest(CrossSectionTest): | ||
c = c12eb # ensure we can access interaction channel module as self.c | ||
|
||
# iterable with tuples (eNu, eE, dSigma_dE(eNu, eE)) | ||
test_dSigma_dE_values = ( | ||
(25, 10.61, 2.63032746305625e-18), | ||
(25, 10.6109, 2.63032746305625e-18), | ||
(50, 35.61, 5.493977104481186e-17), | ||
(75, 60.61, 2.0634285413474464e-16), | ||
(100, 85.61, 4.993427358604262e-16), | ||
) | ||
|
||
# iterable with tuples (eNu, eE, dSigma_dE(eNu, eE)) | ||
test_dSigma_dE_edgecases_values = ( | ||
(14.389, 0, 0), # eNu too small | ||
(25, 10.6089, 0), # eE too small | ||
(25, 10.6111, 0), # eE too large | ||
) | ||
|
||
# iterable with tuples (eNu, cosT, dSigma_dE(eNu, cosT)) | ||
test_dSigma_dCosT_values = ( | ||
(20, -0.99, 0.5), | ||
(20, 0.00, 0.5), | ||
(20, 0.99, 0.5), | ||
(50, -0.50, 0.5), | ||
(50, 0.00, 0.5), | ||
(50, 0.50, 0.5), | ||
) | ||
|
||
# iterable with tuples (eNu, cosT, get_eE(eNu, cosT)) | ||
test_get_eE_values = ( | ||
(20, -0.99, 5.61), | ||
(20, 0.00, 5.61), | ||
(20, 0.99, 5.61), | ||
# testing higher energies is more complicated, since there are multiple possible return values | ||
) | ||
|
||
# iterable with tuples (eNu, bounds_eE(eNu)[0], bounds_eE(eNu)[1]) | ||
test_bounds_eE_values = ( | ||
(20, 5.609, 5.611), | ||
(50, 35.609, 35.611), | ||
) | ||
|
||
# value of bounds_eNu[0] | ||
test_bounds_eNu_minvalue = 15.19 | ||
|
||
# ensure that unittest doesn't run tests in the base class, via https://stackoverflow.com/a/22836015 | ||
del(CrossSectionTest) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import unittest | ||
|
||
from . import c12nc | ||
from ._crosssectiontest import CrossSectionTest | ||
|
||
|
||
class C12NCTest(CrossSectionTest): | ||
c = c12nc # ensure we can access interaction channel module as self.c | ||
|
||
# iterable with tuples (eNu, eE, dSigma_dE(eNu, eE)) | ||
test_dSigma_dE_values = ( | ||
(25, 15.11, 1.895519358671657e-18), | ||
(25, 15.1109, 1.895519358671657e-18), | ||
(50, 15.11, 2.3590523576277865e-17), | ||
(75, 15.11, 6.950951642452967e-17), | ||
(100, 15.11, 1.396524979034271e-16), | ||
) | ||
|
||
# iterable with tuples (eNu, eE, dSigma_dE(eNu, eE)) | ||
test_dSigma_dE_edgecases_values = ( | ||
(15.1, 15.11, 0), # eNu too small | ||
(25, 15.1089, 0), # eE too small | ||
(25, 15.1111, 0), # eE too large | ||
) | ||
|
||
# iterable with tuples (eNu, cosT, dSigma_dE(eNu, cosT)) | ||
test_dSigma_dCosT_values = ( | ||
(20, -0.99, 0.5), | ||
(20, 0.00, 0.5), | ||
(20, 0.99, 0.5), | ||
(50, -0.50, 0.5), | ||
(50, 0.00, 0.5), | ||
(50, 0.50, 0.5), | ||
) | ||
|
||
# iterable with tuples (eNu, cosT, get_eE(eNu, cosT)) | ||
test_get_eE_values = ( | ||
(20, -0.99, 15.11), | ||
(20, 0.00, 15.11), | ||
(20, 0.99, 15.11), | ||
# testing higher energies is more complicated, since there are multiple possible return values | ||
) | ||
|
||
# iterable with tuples (eNu, bounds_eE(eNu)[0], bounds_eE(eNu)[1]) | ||
test_bounds_eE_values = ( | ||
(20, 15.109, 15.111), | ||
(50, 15.109, 15.111), | ||
) | ||
|
||
# value of bounds_eNu[0] | ||
test_bounds_eNu_minvalue = 15.11 | ||
|
||
# ensure that unittest doesn't run tests in the base class, via https://stackoverflow.com/a/22836015 | ||
del(CrossSectionTest) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |