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
5ecac3e5
Commit
5ecac3e5
authored
10 months ago
by
Johannes Schumann
Browse files
Options
Downloads
Plain Diff
Merge branch 'lru_particle_masses' into 'master'
Cache particle masses See merge request
!89
parents
95d963a6
ffff8321
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!89
Cache particle masses
Pipeline
#51532
passed
10 months ago
Stage: test
Stage: coverage
Stage: doc
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+1
-0
1 addition, 0 deletions
CHANGELOG.rst
km3buu/physics.py
+2
-0
2 additions, 0 deletions
km3buu/physics.py
with
3 additions
and
0 deletions
CHANGELOG.rst
+
1
−
0
View file @
5ecac3e5
Unreleased changes
------------------
* Use LRU in particle mass lookup
v1.8.1
----------------------------
...
...
This diff is collapsed.
Click to expand it.
km3buu/physics.py
+
2
−
0
View file @
5ecac3e5
...
...
@@ -20,6 +20,7 @@ import awkward as ak
from
particle
import
Particle
import
mendeleev
import
scipy.constants
as
constants
from
functools
import
lru_cache
from
.config
import
read_default_media_compositions
...
...
@@ -196,6 +197,7 @@ def get_targets_per_volume(targetZ,
def
_get_particle_rest_mass
(
pdgid
):
@np.vectorize
@lru_cache
def
vfunc
(
x
):
try
:
return
Particle
.
from_pdgid
(
x
).
mass
*
1e-3
...
...
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