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
561ec6c2
Verified
Commit
561ec6c2
authored
3 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Make is_bit_set numba compatible
parent
4b8448f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!66
Make bit checker numba compatible
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3io/tools.py
+3
-2
3 additions, 2 deletions
km3io/tools.py
with
3 additions
and
2 deletions
km3io/tools.py
+
3
−
2
View file @
561ec6c2
...
...
@@ -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