Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3BUU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simulation
KM3BUU
Commits
1573888e
Commit
1573888e
authored
4 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Updated tests
parent
1f53cedb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Merge python environment
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
km3buu/tests/test_ctrl.py
+4
-1
4 additions, 1 deletion
km3buu/tests/test_ctrl.py
km3buu/tests/test_jobcard.py
+4
-3
4 additions, 3 deletions
km3buu/tests/test_jobcard.py
km3buu/tests/test_output.py
+3
-3
3 additions, 3 deletions
km3buu/tests/test_output.py
with
11 additions
and
7 deletions
km3buu/tests/test_ctrl.py
+
4
−
1
View file @
1573888e
...
...
@@ -21,6 +21,9 @@ from thepipe.logger import get_logger
JOBCARD_FOLDER
=
abspath
(
join
(
dirname
(
__file__
),
"
../../jobcards
"
))
# class TestCTRLmisc(unittest.TestCase):
# def test_invalid_jobcard(self):
class
TestCTRLbyJobcardFile
(
unittest
.
TestCase
):
def
setUp
(
self
):
...
...
@@ -50,7 +53,7 @@ class TestCTRLbyJobcardObject(unittest.TestCase):
XSECTIONMODE_LOOKUP
[
"
dSigmaMC
"
])
self
.
test_jobcard
.
set_property
(
"
neutrino_induced
"
,
"
includeDIS
"
,
True
)
self
.
test_jobcard
.
set_property
(
"
neutrino_induced
"
,
"
printAbsorptionXS
"
,
"
T
"
)
True
)
self
.
test_jobcard
.
set_property
(
"
nl_SigmaMC
"
,
"
enu
"
,
1
)
# INPUT
self
.
test_jobcard
.
set_property
(
"
input
"
,
"
numTimeSteps
"
,
0
)
...
...
This diff is collapsed.
Click to expand it.
km3buu/tests/test_jobcard.py
+
4
−
3
View file @
1573888e
...
...
@@ -25,14 +25,15 @@ class TestJobcard(unittest.TestCase):
expected_line
=
"
path_to_input =
'
%s
'"
%
INPUT_PATH
ctnt
=
str
(
self
.
test_jobcard
)
group_start
=
ctnt
.
find
(
"
&input
"
)
group_end
=
ctnt
.
find
(
"
/
\n
\n
"
,
group_start
)
group_end
=
ctnt
.
find
(
"
/
\n
"
,
group_start
)
assert
ctnt
[
group_start
:
group_end
].
find
(
expected_line
)
!=
-
1
def
test_elements
(
self
):
ctnt
=
str
(
self
.
test_jobcard
)
expected_line
=
"
def = 42
"
group_start
=
ctnt
.
find
(
"
&ABC
"
)
group_end
=
ctnt
.
find
(
"
/
\n\n
"
,
group_start
)
group_start
=
ctnt
.
find
(
"
&abc
"
)
group_end
=
ctnt
.
find
(
"
/
"
,
group_start
)
print
(
ctnt
)
assert
ctnt
[
group_start
:
group_end
].
find
(
expected_line
)
!=
-
1
def
test_remove_elements
(
self
):
...
...
This diff is collapsed.
Click to expand it.
km3buu/tests/test_output.py
+
3
−
3
View file @
1573888e
...
...
@@ -22,7 +22,7 @@ TESTDATA_DIR = abspath(join(dirname(__file__), "../data/test-data/"))
class
TestXSection
(
unittest
.
TestCase
):
def
test_xsection_all
(
self
):
filename
=
join
(
TESTDATA_DIR
,
XSECTION_FILENAMES
[
"
all
"
])
xsection
=
NeutrinoAbsorptionXS
ection
(
filename
)
xsection
=
read_nu_abs_xs
ection
(
filename
)
self
.
assertAlmostEqual
(
xsection
[
'
var
'
],
1.0
)
self
.
assertAlmostEqual
(
xsection
[
'
sum
'
],
0.61548
)
self
.
assertAlmostEqual
(
xsection
[
'
Delta
'
],
0.61537
)
...
...
@@ -43,7 +43,7 @@ class TestFinalEvents(unittest.TestCase):
self
.
assertAlmostEqual
(
self
.
final_events
[
0
][
"
p_x
"
],
2.619802e-2
)
self
.
assertAlmostEqual
(
self
.
final_events
[
0
][
"
p_y
"
],
3.290991e-1
)
self
.
assertAlmostEqual
(
self
.
final_events
[
0
][
"
p_z
"
],
3.821936e-1
)
self
.
assertAlmostEqual
(
self
.
final_events
[
0
][
"
energy
"
],
1.0
)
self
.
assertAlmostEqual
(
self
.
final_events
[
0
][
"
nu_
energy
"
],
1.0
)
assert
self
.
final_events
[
3
][
"
id
"
]
==
1
assert
self
.
final_events
[
3
][
"
charge
"
]
==
1
self
.
assertAlmostEqual
(
self
.
final_events
[
3
][
"
perweight
"
],
6.154773e-1
)
...
...
@@ -55,7 +55,7 @@ class TestFinalEvents(unittest.TestCase):
assert
self
.
final_events
[
0
:
2
]
is
not
None
def
test_length
(
self
):
assert
len
(
self
.
final_events
)
==
5
assert
len
(
self
.
final_events
)
==
4
class
TestGiBUUOutput
(
unittest
.
TestCase
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment