-
Notifications
You must be signed in to change notification settings - Fork 5
Fgalizzi #146
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
Draft
fgalizzi
wants to merge
54
commits into
main
Choose a base branch
from
fgalizzi
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…lection, add save_pngs as bool, add fit_ok criteria, rename outputs
… fit status to fit_efficiency, get_10to90_range_fit
Merging main to have the correct definition of gaussian
…verbose, run_by_run to the steering
…atasets merged by thresholds, new outputs
…threshold in jitter estimation
Merging origin/main into fgalizzi
Merging Julio's commit before PR140 is merged
falemanno
approved these changes
Dec 16, 2025
Jurenag contribution to fgalizzi dev branch
hvsouza
reviewed
Dec 18, 2025
src/waffles/utils/numerical_utils.py
Outdated
|
|
||
| result = 0. | ||
|
|
||
| if operation == "sum": |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
# precompute squares once
e1_2 = e1 * e1
e2_2 = e2 * e2
p1_2 = p1 * p1
p2_2 = p2 * p2
match operation:
case "sum" | "sub":
result = math.sqrt(e1_2 + e2_2)
case "mul":
result = math.sqrt( e1_2 * p2_2 + e2_2 * p1_2 )
case "div":
p2_4 = p2_2 * p2_2
result = math.sqrt(e1_2 / p2_2 + e2_2 * p1_2 / p2_4)
case "sqrt_sum" | "sqrt_sub":
sign = 1 if operation == "sqrt_sum" else -1
f2 = p1_2 + sign * p2_2
result = math.sqrt((e1_2 * p1_2 + e2_2 * p2_2) / f2)
case _:
raise Exception(GenerateExceptionMessage(
1,
'error_propagation()',
"Invalid operation: must be 'sum', 'sub', 'mul',"
" 'div', 'sqrt_sum' or 'sqrt_sub'."))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Final NP04 self-trigger analysis + Cross-talk