Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
km3py
km3io
Commits
e4a0496d
Commit
e4a0496d
authored
3 years ago
by
Tamas Gal
Browse files
Options
Downloads
Plain Diff
Merge branch 'make-bit-checker-numba-compatible' into 'master'
Make bit checker numba compatible See merge request
!66
parents
4b8448f0
88371693
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!66
Make bit checker numba compatible
Pipeline
#23220
passed
3 years ago
Stage: test
Stage: coverage
Stage: doc
Stage: release
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+2
-1
2 additions, 1 deletion
CHANGELOG.rst
km3io/tools.py
+3
-2
3 additions, 2 deletions
km3io/tools.py
with
5 additions
and
3 deletions
CHANGELOG.rst
+
2
−
1
View file @
e4a0496d
Unreleased changes
------------------
* The ``km3io.tools.is_bit_set()`` and all the related trigger mask checkers
(``is_3dmuon()``...) are now compatible with Numba
Version 0
---------
...
...
This diff is collapsed.
Click to expand it.
km3io/tools.py
+
3
−
2
View file @
e4a0496d
...
...
@@ -493,15 +493,16 @@ def usr(objects, field):
return
objects
.
usr
[:,
idx
]
@nb.vectorize
((
"
boolean(int64, int64)
"
,
"
boolean(uint64, int64)
"
),
nopython
=
True
)
def
is_bit_set
(
value
,
bit_position
):
"""
Returns true if a bit at the given position is 1.
value: int or array(int)
value: int or array(
[u]
int
64
)
The value to check, can be a single value or an array of values.
bit_position: int
0 for the first position, 1 for the second etc.
"""
return
(
np
.
array
(
value
)
&
(
1
<<
bit_position
))
.
astype
(
bool
)
return
bool
(
value
&
(
1
<<
bit_position
))
def
is_3dshower
(
trigger_mask
):
...
...
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