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
5a91019b
Commit
5a91019b
authored
2 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Tests for NoVolume
parent
1071622a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#31046
passed with warnings
2 years ago
Stage: test
Stage: coverage
Stage: doc
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3buu/tests/test_output.py
+22
-1
22 additions, 1 deletion
km3buu/tests/test_output.py
with
22 additions
and
1 deletion
km3buu/tests/test_output.py
+
22
−
1
View file @
5a91019b
...
...
@@ -21,6 +21,7 @@ from km3net_testdata import data_path
from
tempfile
import
NamedTemporaryFile
,
TemporaryDirectory
from
km3buu.output
import
*
from
km3buu.geometry
import
NoVolume
from
km3buu.config
import
Config
TESTDATA_DIR
=
data_path
(
"
gibuu
"
)
...
...
@@ -89,7 +90,6 @@ class TestGiBUUOutput(unittest.TestCase):
2511.13458
,
places
=
2
)
@pytest.mark.skipif
(
not
KM3NET_LIB_AVAILABLE
,
reason
=
"
KM3NeT dataformat required
"
)
class
TestOfflineFile
(
unittest
.
TestCase
):
...
...
@@ -144,6 +144,27 @@ class TestOfflineFile(unittest.TestCase):
# GiBUU weight
np
.
testing
.
assert_almost_equal
(
evt
.
w2list
[
23
],
0.004062418521597373
)
@pytest.mark.skipif
(
not
KM3NET_LIB_AVAILABLE
,
reason
=
"
KM3NeT dataformat required
"
)
class
TestNoGeometryWriteout
(
unittest
.
TestCase
):
def
setUp
(
self
):
output
=
GiBUUOutput
(
TESTDATA_DIR
)
datafile
=
NamedTemporaryFile
(
suffix
=
"
.root
"
)
geometry
=
NoVolume
()
np
.
random
.
seed
(
1234
)
write_detector_file
(
output
,
datafile
.
name
,
geometry
=
geometry
)
self
.
fobj
=
km3io
.
OfflineReader
(
datafile
.
name
)
def
test_firstevent
(
self
):
evt
=
self
.
fobj
.
events
[
0
]
np
.
testing
.
assert_array_almost_equal
(
evt
.
mc_tracks
.
dir_x
[
0
],
0
)
np
.
testing
.
assert_array_almost_equal
(
evt
.
mc_tracks
.
dir_y
[
0
],
0
)
np
.
testing
.
assert_array_almost_equal
(
evt
.
mc_tracks
.
dir_z
[
0
],
1
)
np
.
testing
.
assert_allclose
(
evt
.
mc_tracks
.
pos_x
,
0.0
)
np
.
testing
.
assert_allclose
(
evt
.
mc_tracks
.
pos_y
,
0.0
)
np
.
testing
.
assert_allclose
(
evt
.
mc_tracks
.
pos_z
,
0.0
)
@pytest.mark.skipif
(
not
KM3NET_LIB_AVAILABLE
,
reason
=
"
KM3NeT dataformat required
"
)
...
...
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