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
fd12b279
Commit
fd12b279
authored
3 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for seed option in jobcard
parent
2a4a7fa0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
Random Generator Seed
Pipeline
#22415
canceled
3 years ago
Stage: test
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3buu/tests/test_jobcard.py
+23
-1
23 additions, 1 deletion
km3buu/tests/test_jobcard.py
with
23 additions
and
1 deletion
km3buu/tests/test_jobcard.py
+
23
−
1
View file @
fd12b279
...
...
@@ -12,8 +12,11 @@ __status__ = "Development"
import
unittest
import
numpy
as
np
from
itertools
import
combinations
from
km3buu.jobcard
import
*
from
tempfile
import
TemporaryFile
from
km3buu.ctrl
import
run_jobcard
from
km3buu.output
import
GiBUUOutput
from
tempfile
import
TemporaryFile
,
TemporaryDirectory
class
TestJobcard
(
unittest
.
TestCase
):
...
...
@@ -127,3 +130,22 @@ class TestNeutrinoSingleEnergyJobcard(unittest.TestCase):
def
test_photon_propagation_flag
(
self
):
self
.
assertEqual
(
self
.
test_jobcard
[
"
insertion
"
][
"
propagateNoPhoton
"
],
not
self
.
photon_propagation_flag
)
class
TestJobcardSeed
(
unittest
.
TestCase
):
def
setUp
(
self
):
jc
=
generate_neutrino_jobcard
(
100
,
"
CC
"
,
"
electron
"
,
(
1.0
,
2.0
),
(
1
,
1
),
do_decay
=
False
,
photon_propagation
=
False
,
seed
=
1234
)
self
.
dfs
=
[]
for
i
in
range
(
2
):
output_dir
=
TemporaryDirectory
()
run_jobcard
(
jc
,
output_dir
.
name
,
container
=
True
)
self
.
dfs
.
append
(
GiBUUOutput
(
output_dir
.
name
).
df
)
def
test_output
(
self
):
for
a
,
b
in
combinations
(
self
.
dfs
,
2
):
assert
all
((
a
==
b
).
all
(
1
))
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