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

refactor: Drop SympyStepper::stepImpl #4103

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

andiwand
Copy link
Contributor

@andiwand andiwand commented Feb 20, 2025

After getting rid of the templated step function there is no reason to have a separate stepImpl function anymore. This PR is merging stepImpl into step and drops former.

Summary by CodeRabbit

  • Refactor
    • Streamlined the stepping process by centralizing configuration parameters within the system's state.
    • Improved error handling and step size scaling to maintain consistent performance.

@andiwand andiwand added this to the next milestone Feb 20, 2025
Copy link

coderabbitai bot commented Feb 20, 2025

Walkthrough

A private method, stepImpl, removed it has been from the SympyStepper class. In the header file, the method declaration is eliminated. In the source file, its functionality is merged into the public step method, with parameters now retrieved from state.options instead of local variables. Streamlined the stepping control flow, this change has, with no other modifications to the class made.

Changes

File(s) Change Summary
Core/include/.../SympyStepper.hpp Removed private stepImpl declaration from SympyStepper class.
Core/src/.../SympyStepper.cpp Integrated stepImpl logic into the step method; updated parameters to use state.options, streamlining control flow.

Sequence Diagram(s)

sequenceDiagram
    participant C as Caller
    participant S as SympyStepper
    participant St as State
    C ->> S: step(state, direction, material)
    S ->> St: Retrieve options (stepTolerance, stepSizeCutOff, maxRungeKuttaStepTrials)
    S ->> S: Execute integrated stepping logic (incl. calcStepSizeScaling)
    S -->> C: Return result
Loading

Possibly related PRs

Suggested labels

Component - Core, automerge

Suggested reviewers

  • paulgessinger

Poem

Refactored our code, we have,
StepImpl now gone, like a shadow it passed.
Merged functions guide our flow so true,
In state options, the power anew!
May the Force of simplicity shine on you!
Hmm, clean our code now is.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b5261c and a91cac4.

📒 Files selected for processing (2)
  • Core/include/Acts/Propagator/SympyStepper.hpp (0 hunks)
  • Core/src/Propagator/SympyStepper.cpp (3 hunks)
💤 Files with no reviewable changes (1)
  • Core/include/Acts/Propagator/SympyStepper.hpp
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: merge-sentinel
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: unused_files
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, clang++)
  • GitHub Check: missing_includes
  • GitHub Check: macos
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, g++)
  • GitHub Check: linux_ubuntu
  • GitHub Check: build_debug
  • GitHub Check: docs
🔇 Additional comments (5)
Core/src/Propagator/SympyStepper.cpp (5)

151-151: Sound design, strong in the ways of error handling you are.

Dividing by errorEstimate_ precarious it may be, yet shielded by the clamp at line 185 you have—ensure no zero or negativity creeps in. Good, this is.


175-176: Step tolerance, unified from state options now it is.

A simpler configuration, yes, to pass the factor 4 * state.options.stepTolerance directly into rk4(). Expanded readability, consistent usage you achieve.


198-198: Validate the minimum step cutoff you must.

If state.options.stepSizeCutOff is zero or extremely small, stall the particle it might. Confirm the input range you should, for robust propagation.


205-205: Confirm the step trials boundary condition, you must.

Consider whether nStepTrials >= state.options.maxRungeKuttaStepTrials or > suits your logic better. Potential off-by-one error, see I can.


129-231:

❓ Verification inconclusive

Check thoroughly for remnants of stepImpl, you should.

Removed from the interface it is—ensure no references remain.

Use this script to search the codebase for remaining references:


🏁 Script executed:

#!/bin/bash
rg 'stepImpl'

Length of output: 13


No stepImpl remnants detected, but verify manually you must.

  • The search with rg 'stepImpl' returned no references in the codebase.
  • Despite the absence of output, caution remains—manually review further to ensure no lingering usages of stepImpl exist.
  • Code appears clean, yet validation by your own eyes, you should perform.
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the Component - Core Affects the Core module label Feb 20, 2025
Copy link

github-actions bot commented Feb 20, 2025

📊: Physics performance monitoring for df3b1b5

Full contents
🟥 summary not found!

@andiwand
Copy link
Contributor Author

looks like there is a transient G4 data download error

- download of 'G4EMLOW.8.2.tar.gz' failed : CURL error 0

@kodiakhq kodiakhq bot merged commit 9cfe189 into acts-project:main Feb 20, 2025
49 checks passed
@andiwand andiwand deleted the drop-sympy-stepimpl branch February 20, 2025 16:41
@acts-project-service acts-project-service added the Fails Athena tests This PR causes a failure in the Athena tests label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Core Affects the Core module Fails Athena tests This PR causes a failure in the Athena tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants