Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reboost core API #26

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open

Reboost core API #26

wants to merge 24 commits into from

Conversation

tdixon97
Copy link
Collaborator

Implemented most of the core functions (orchestration) and added tests. @gipert , @ManuelHu
Still missing is extracting the detector mapping from config (for cases its not trivial) and also more full scale tests with build_hit

@tdixon97
Copy link
Collaborator Author

CI will be fixed once legend-exp/legend-pydataobj#132 is merged.

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 94.86301% with 15 lines in your changes missing coverage. Please review.

Project coverage is 66.18%. Comparing base (1729480) to head (0947e88).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
src/reboost/core.py 94.20% 4 Missing ⚠️
src/reboost/utils.py 91.48% 4 Missing ⚠️
src/reboost/build_hit.py 88.88% 3 Missing ⚠️
src/reboost/hpge/surface.py 93.93% 2 Missing ⚠️
src/reboost/iterator.py 96.15% 1 Missing ⚠️
src/reboost/shape/group.py 96.96% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #26       +/-   ##
===========================================
+ Coverage   54.87%   66.18%   +11.30%     
===========================================
  Files          16       20        +4     
  Lines        1139     1375      +236     
===========================================
+ Hits          625      910      +285     
+ Misses        514      465       -49     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ManuelHu
Copy link
Collaborator

src/reboost/core.py Outdated Show resolved Hide resolved
Comment on lines +41 to +54
if isinstance(mu, Array):
mu = mu.view_as("ak")
elif isinstance(mu, ak.Array):
mu = mu.to_numpy()
elif not isinstance(mu, np.ndarray):
mu = np.array(mu)

# similar for sigma
if isinstance(sigma, Array):
sigma = sigma.view_as("ak")
elif isinstance(sigma, ak.Array):
sigma = sigma.to_numpy()
elif not isinstance(sigma, (float, int, np.ndarray)):
sigma = np.array(sigma)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, this does not look right from the types. should'nt it be .view_as("np") to always get an numpy array....?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants