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!: Revise stepper state creation #3987

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

Conversation

andiwand
Copy link
Contributor

@andiwand andiwand commented Dec 14, 2024

  • move stepper state creation code from State constructor to makeState. this is the function which will actually be called from outside
  • move context references to stepper options
  • store stepper options in stepper state

In a future PR I would like to decouple the stepper from the propagation state and the navigator. This is the first step towards that.

pulled out of #3449

Summary by CodeRabbit

  • New Features

    • Enhanced state management in various steppers by consolidating parameters into an Options struct.
    • Introduction of new options for configuring steppers, including geometry and magnetic field contexts.
    • Streamlined initialization process for state objects using makeState methods across multiple classes.
  • Bug Fixes

    • Improved handling of context references in state management, ensuring correct context usage in various methods.
  • Tests

    • Refactored test cases to utilize new state management features and options structures, enhancing clarity and maintainability.
    • Expanded test coverage for impact point estimation and navigator functionalities.
  • Chores

    • Removed unnecessary include directives to streamline code and reduce dependencies.

@andiwand andiwand added this to the v39.0.0 milestone Dec 14, 2024
Copy link

coderabbitai bot commented Dec 14, 2024

Walkthrough

Hmm, significant changes to the propagation architecture, these modifications reveal. Across multiple stepper classes - AtlasStepper, EigenStepper, StraightLineStepper - a common pattern emerges. Context management and state initialization, they have streamlined. The Options struct, now central to configuration, it has become. Geometry and magnetic field contexts, encapsulated within, they are. A more elegant approach to propagation, the developers have crafted.

Changes

File Change Summary
Core/include/Acts/Propagator/* Steppers refactored to use centralized Options struct for context management
Core/src/Propagator/* Methods updated to utilize new Options for state initialization and context retrieval
Tests/UnitTests/Core/Propagator/* Test cases modified to align with new stepper initialization patterns

Poem

Propagation's dance, a code ballet 🌟
Options wrapped tight, contexts at play 🌈
Steppers evolve, with grace they stride
Geometry's whispers, no longer hide 🚀
A refactored path, clean and bright 🌠

Possibly related PRs

  • No strongly related PRs identified in the provided context.

Hmm, yes. A journey of code refinement, this pull request represents. Simplicity and clarity, the path to better software, they are. chuckles softly

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


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.

Copy link

📊: Physics performance monitoring for 5d7bde6

Full contents

physmon summary

@andiwand andiwand marked this pull request as ready for review December 17, 2024 14:26
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (10)
Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp (1)

Line range hint 37-83: Wise architectural changes, these are! Hmmmm.

A step towards decoupling the stepper from propagation state, this refactoring is. Through the options structure, flow the contexts now do. Cleaner architecture, we achieve. Future changes, easier they become.

Core/include/Acts/Propagator/detail/LoopStepperUtils.hpp (1)

129-133: Architectural wisdom, share I must!

A step towards greater decoupling, this change represents. Yet more work ahead, I sense. Consider these paths for future journeys:

  1. Further separate the stepper's concerns from state management, you should
  2. Document the new context access patterns in comments, helpful it would be
  3. Unit tests for the new structure, essential they are

The Force of clean architecture, strong it grows!

Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp (1)

168-169: Avoid code duplication, refactor you should

Repeated, the initialization of MultiOptions options(geoCtx, magCtx); and options.maxStepSize = defaultStepSize; is. Into a common setup function or fixture, consolidate this code, you should.

Also applies to: 204-205, 235-236, 284-285, 309-310, 385-386, 471-472, 585-586, 668-669, 718-719, 768-769

Tests/UnitTests/Core/Propagator/NavigatorTests.cpp (1)

76-79: Introduce Options struct, you do. Ensure references remain valid, you must.

Consider using value types instead of references in Options to avoid potential lifetime issues.

Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp (1)

529-530: Logging additions provide clarity. Helpful, they are.

Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp (2)

211-212: Unnecessary re-initialization of options, see I do

Re-initializing esOptions with the same contexts may be redundant. Reuse esOptions, consider you should.


263-263: Use of magic number -1337., question I do

Confusing, the use of -1337. for step size may be. Consider a named constant or comment to explain.

Core/include/Acts/Propagator/PropagatorOptions.hpp (1)

61-64: Strong with the Force, this design is!

Initialize stepping and navigation options in the constructor, we now do. A clean separation of concerns, this brings.

Consider documenting the relationship between these components in the class documentation, help future Padawans it will.

Core/include/Acts/Propagator/Propagator.ipp (1)

178-179: Improved state initialization pattern, I sense.

Simplified state creation through makeState function, this change brings. Better encapsulation and cleaner architecture, it achieves. Consistent with the path to decouple stepper from propagation state, it is.

Also applies to: 217-218

Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp (1)

331-346: Improved readability of step size calculation, I observe.

Better formatted and more readable, the intersection calculation has become. Easier to maintain and understand, this code now is.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9a2b74d and 5d7bde6.

📒 Files selected for processing (27)
  • Core/include/Acts/Propagator/AtlasStepper.hpp (8 hunks)
  • Core/include/Acts/Propagator/EigenStepper.hpp (3 hunks)
  • Core/include/Acts/Propagator/EigenStepper.ipp (6 hunks)
  • Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp (8 hunks)
  • Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp (2 hunks)
  • Core/include/Acts/Propagator/Propagator.hpp (0 hunks)
  • Core/include/Acts/Propagator/Propagator.ipp (2 hunks)
  • Core/include/Acts/Propagator/PropagatorOptions.hpp (2 hunks)
  • Core/include/Acts/Propagator/StepperOptions.hpp (1 hunks)
  • Core/include/Acts/Propagator/StraightLineStepper.hpp (3 hunks)
  • Core/include/Acts/Propagator/SympyStepper.hpp (3 hunks)
  • Core/include/Acts/Propagator/detail/LoopStepperUtils.hpp (1 hunks)
  • Core/include/Acts/Propagator/detail/SteppingHelper.hpp (1 hunks)
  • Core/include/Acts/TrackFitting/detail/GsfActor.hpp (1 hunks)
  • Core/src/Propagator/StraightLineStepper.cpp (4 hunks)
  • Core/src/Propagator/SympyStepper.cpp (5 hunks)
  • Tests/IntegrationTests/PropagationTests.hpp (4 hunks)
  • Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp (15 hunks)
  • Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp (9 hunks)
  • Tests/UnitTests/Core/Propagator/JacobianTests.cpp (1 hunks)
  • Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp (21 hunks)
  • Tests/UnitTests/Core/Propagator/NavigatorTests.cpp (2 hunks)
  • Tests/UnitTests/Core/Propagator/PropagatorTests.cpp (2 hunks)
  • Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp (7 hunks)
  • Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp (8 hunks)
  • Tests/UnitTests/Core/SpacePointFormation/SpacePointBuilderTests.cpp (1 hunks)
  • Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp (1 hunks)
💤 Files with no reviewable changes (1)
  • Core/include/Acts/Propagator/Propagator.hpp
🔇 Additional comments (98)
Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp (2)

Line range hint 37-41: Approve this change, I do! Hmmmm.

Moved to options the geoContext has been, as planned in the great refactoring it was. Maintain the same intersection logic we do, yet cleaner the structure becomes.


81-83: Consistent with the Force, this change is!

Similar to the previous modification, moved to options the geoContext has been. A pattern emerges, it does! The way of the refactoring, this is.

Core/include/Acts/Propagator/detail/LoopStepperUtils.hpp (1)

129-133: Approve the context access pattern change, I do!

Moved to stepper options, the geometry context has been. Wise decision, this is, aligning with the greater refactoring purpose. Consistent with the path to decouple the stepper from propagation state, it remains.

Verify the consistency of this pattern across the codebase, we must:

✅ Verification successful

Consistent with the refactoring path, this change is. Approve it, I do!

Through the Force, searched the entire codebase I have. A clear pattern emerges:

  • The old pattern state.geoContext still exists in many places, yes, but primarily in files not yet touched by this refactoring effort
  • The new pattern state.options.geoContext appears consistently in the stepper implementations, where this change belongs
  • In LoopStepperUtils.hpp, the change aligns perfectly with similar changes in other stepper implementations like StraightLineStepper and SympyStepper

Hmm, wise this refactoring is. Moving context to options, a gradual process it must be. This change, a step in the right direction it is.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining direct geoContext access patterns
rg "\.geoContext[^.]" --type cpp

# Search for the new pattern of accessing through options
rg "\.options\.geoContext" --type cpp

Length of output: 27886

Core/include/Acts/TrackFitting/detail/GsfActor.hpp (1)

368-373: Functionality correct, the changes are.

Consistency in context usage, you have maintained. Good work, this is.

Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp (3)

281-292: Well-implemented test for invalid state, this is

Appropriate exception handling, demonstrated here is. Ensures that makeState handles invalid input correctly, this test does.


Line range hint 467-556: Accurate surface status updates, the code performs

Properly updates the status of surfaces and components, your implementation does. Consistent with expected behavior, the results are.


Line range hint 714-747: Combined curvilinear state computation, correctly implemented it is

Validates that the curvilinear parameters match expected values, your test does. Good alignment with the single-component parameters, there is.

Core/src/Propagator/SympyStepper.cpp (5)

26-51: Good the refactoring is, hmmm.

Streamlined the state initialization using options, you have. Approve, I do.


Line range hint 58-69: Context references updated correctly, they are.

Consistent your changes are. Well done, this is.


81-84: Consistent context access, maintain you do.

Throughout the class, options you now use. Good, this is.


102-102: Updated the context usage is, hmmm.

Ensured consistency, you have.


125-127: In transportCovarianceToBound, context usage correct it is.

Options you use, as intended.

Core/include/Acts/Propagator/EigenStepper.ipp (5)

24-49: Refactored the state creation is. Good, this change is.

Using options to initialize the state, you are. Approve, I do.


Line range hint 58-69: Context references updated, correctly they are.

Consistent the usage is. Well done, hmmm.


82-85: Consistent context handling, you maintain.

Good this is. Approve, I do.


138-138: Context usage updated, it is. Correctly done, you have.


164-167: In transportCovarianceToBound, context access updated, it is.

Consistent your changes are.

Core/include/Acts/Propagator/SympyStepper.hpp (3)

42-44: Added the Options constructor, you have. Encapsulate contexts, it does.

Good this is.


57-64: Simplified the State constructor, hmmm.

Using options and field cache, you are. Approve, I do.


121-122: Updated makeState to use options, you have. Good, this change is.

Consistent with other changes, it is.

Core/include/Acts/Propagator/EigenStepper.hpp (3)

60-62: Added the Options constructor, hmmm.

Encapsulating contexts, you are. Good, this is.


75-82: Simplified the State constructor, you have.

Using options, instead of separate contexts. Approve, I do.


153-154: Updated makeState to use options, you have.

Consistent with other changes, this is. Good, hmmm.

Core/include/Acts/Propagator/StraightLineStepper.hpp (3)

58-60: Properly initialize Options constructor, you have.


74-76: State now accepts Options. Good, this is.


124-150: Refactored makeState method wisely, you have.

Tests/UnitTests/Core/Propagator/NavigatorTests.cpp (1)

83-84: State now contains Options. Correct, this is.

Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp (13)

15-15: Include Tolerance.hpp, you have. Necessary, this is.


105-113: Initialize Stepper and State with Options, you correctly do.


132-140: Construct State with covariance, rightly you have.


159-167: Getters test updated with Options. Good, this is.


178-186: UpdateFromBound test refactored with Options. Maintain consistency, you do.


225-233: UpdateFromComponents test uses makeState. Correct, this is.


250-259: Refactor BuildBound test to use Options, you have. Consistency achieved.


279-287: BuildCurvilinear test updated properly with Options.


305-313: Step test now initializes State with Options. Well done, it is.


342-350: StepWithCovariance test refactored to use Options. Consistent, your changes are.


382-390: Reset test updated with Options and makeState. Good, continue you must.


578-587: StepSize test refactored with Options and makeState. Correct, this is.


598-606: StepSizeSurface test updated to use Options and makeState. Consistency maintained, you have.

Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp (6)

159-160: Typedef SingleOptions introduced. Clarity, this brings.


186-189: Options struct now inherits from SingleOptions and initializes correctly. Good change, this is.


203-204: State now includes Options member. Consistent with other steppers, it is.


244-268: Refactored makeState method to use Options. Uniformity across codebase, you maintain.


423-424: addComponent method now uses SingleStepper's makeState with Options. Appropriate, this is.


587-588: updateStepSize method correctly accesses geoContext from Options. Good, this is.

Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp (13)

13-13: Necessary, the inclusion of Tolerance.hpp is

Ensures the availability of tolerance constants in tests, this inclusion does.


191-192: Initialize EigenStepper options with contexts, necessary this change is

By providing tgContext and mfContext, properly initialized the options are.


197-197: Create state with options and parameters, correctly you have

Using es.makeState(esOptions, cp), proper initialization of the state this ensures.


219-219: Create new state with options and parameters, acceptable this is

Consistent use of esOptions in state creation, good practice it is.


244-246: Initialize options and set max step size, correctly you have

Setting esOptions.maxStepSize to control step size properly, wise this is.


247-249: Build stepper and state with options, acceptable this is

Proper initialization of the stepper and state using options and parameters, you have done.


346-346: Creating a copy of the state, acceptable this is

Properly using es.makeState(esOptions, cp) for state copying, you are.


369-369: Copying state using copyState, acceptable this is

Correctly duplicating the stepping state, you are.


446-446: Creating state with options and bound parameters, correct this is

Using es.makeState(esOptions, bp) to initialize the state properly, you have.


452-452: Using infinite boundary tolerance, acceptable this is

No boundary limit imposed, BoundaryTolerance::Infinite() ensures.


459-463: Updating step size with surface intersection, correct this is

Appropriate use of es.updateStepSize with surface intersection, you have done.


468-472: Updating step size with surface intersection, acceptable this is

Consistent approach in step size adjustment, see I do.


517-518: Initializing options and state for null field stepper, acceptable this is

Contexts provided to nesOptions, correctly initializing nesState you are.

Core/include/Acts/Propagator/AtlasStepper.hpp (11)

48-50: Constructor added to Options, acceptable this is

Initializing with GeometryContext and MagneticFieldContext, proper context management this ensures.


62-65: Updated State constructor with options and field cache, acceptable this is

With Options and fieldCache, properly you initialize the state.


67-67: Added options member to State, acceptable this is

Context accessibility within State enhanced it is.


69-69: Initialize particle hypothesis to pion, acceptable this is

Default ParticleHypothesis set, predictability this enhances.


142-145: Updated makeState to use options and initialize state, correct this is

Consistent context usage ensured by passing Options to makeState.


146-313: Refactored state initialization into makeState, clarity this brings

Improves code organization by moving initialization into makeState, you have.


328-330: Updated update call with options' geoContext, acceptable this is

Using state.options.geoContext for consistent context usage, you are.


618-619: Using options' geoContext in referenceFrame call, correct this is

Ensures context consistency in transformations, this does.


949-950: Using options' geoContext in covariance transport, acceptable this is

Proper context handling during covariance transport, important it is.


979-981: Accessing surface center with options' geoContext, correct this is

Consistency in context usage during calculations, maintained it is.


1079-1080: Using options' geoContext to access surface center, acceptable this is

Enhances code reliability through consistent context usage.

Core/include/Acts/Propagator/StepperOptions.hpp (4)

11-11: Added include for <functional>, necessary this is

Provides std::reference_wrapper, including <functional> does.


16-18: Added forward declarations for GeometryContext and MagneticFieldContext, acceptable this is

Allows reference usage without full definitions, this does.


20-24: Added constructor to initialize contexts, acceptable this is

Contexts held by StepperPlainOptions, this constructor allows.


25-30: Added context references as member variables, acceptable this is

Enhances context accessibility by storing geoContext and magFieldContext.

Core/include/Acts/Propagator/detail/SteppingHelper.hpp (1)

42-42: Updated to use options' geoContext in surface intersection, acceptable this is

Correct context used during intersection calculations, this ensures.

Core/src/Propagator/StraightLineStepper.cpp (4)

42-42: Consistent the changes are. Approve them, I do!

Follow the same pattern of accessing geoContext through options, this change does.


65-67: In harmony with the Force, these changes are!

The pattern of accessing geoContext through options, maintained it is.


75-76: The path to clean code, these changes follow!

Through options, the context flows. A consistent pattern, this maintains.

Also applies to: 86-87


21-24: Hmmmm, moved to options the context has been. Wise this change is!

Consistent with the refactoring objectives, this modification is. But verify all usages of geoContext, we must.

✅ Verification successful

Hmmmm, many instances of state.geoContext still linger in our codebase, they do!

In header files and test files, these occurrences primarily reside. A pattern emerges - the change to state.options.geoContext, only in implementation files (.cpp), happening it is. The headers and tests, unchanged they remain.

  • Core/include/Acts/Propagator/detail/LoopStepperUtils.hpp
  • Core/include/Acts/Propagator/Navigator.hpp
  • Core/include/Acts/TrackFitting/KalmanFitter.hpp
  • Core/include/Acts/Navigation/DetectorNavigator.hpp
  • Many other header files, containing direct state.geoContext usage, they do

Clarity through the Force, I now see!

No implementation files with direct state.geoContext usage remain, hmmmm! The change from state.geoContext to state.options.geoContext in this file, correct it is. The Force reveals that header files still use the old pattern, but this is expected, as refactoring wave-by-wave, proceeding it is.

In implementation files (.cpp), the transition complete it is. The path to enlightenment, this change follows!

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining direct geoContext usage
rg "state\.geoContext" --type cpp

Length of output: 6687


Script:

#!/bin/bash
# Check if there are any implementation files still using state.geoContext
rg "state\.geoContext" --type cpp -g "*.cpp" --exclude "Tests/*"

Length of output: 478


Script:

#!/bin/bash
# Try different approach to find implementation files with state.geoContext
rg "state\.geoContext" -g "*.cpp" | grep -v "Tests/"

Length of output: 52

Core/include/Acts/Propagator/PropagatorOptions.hpp (1)

94-97: Mirror the plain options, these changes do. Good, this is!

Consistent initialization pattern in both constructors, maintained it is.

Also applies to: 102-104

Tests/UnitTests/Core/Propagator/JacobianTests.cpp (1)

135-141: Updated the tests, we have. Wise this is!

Use the new Options pattern for stepper initialization, these changes do. But verify all test cases, we must.

✅ Verification successful

The previous search might have been too specific. Let me broaden the search to find stepper-related test cases and their initialization patterns. This will help verify if all test cases have been properly updated to use the new Options pattern.


Hmm, more investigation we need. The Force tells me to search specifically for old-style stepper initialization patterns and locate all stepper-related test files, it does. Help us find any remaining cases that need updating, this will.


Correct the changes are, young padawan!

Through the Force, seen I have that all stepper tests use the new Options pattern correctly, they do. The changes in JacobianTests.cpp align with the way of the Jedi, using Options(tgContext, mfContext) they do. In MultiStepperTests.cpp and other stepper tests, proper usage of Options observed is. No old-style initialization remains, hmm.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining old-style stepper initialization
rg "makeState.*geoContext.*magFieldContext" --type cpp

Length of output: 56


Script:

#!/bin/bash
# Search for any stepper initialization patterns in test files
rg "makeState.*Context" Tests/ --type cpp -B 2 -A 2

# Search for test cases using steppers
ast-grep --pattern 'TEST($$$) {
  $$$
  Stepper$$$
  $$$
}'

Length of output: 8767


Script:

#!/bin/bash
# Search for old-style stepper initialization in test files
rg "makeState\([^O].*pars" Tests/ --type cpp -B 2 -A 2

# Find all stepper test files to ensure complete coverage
fd "Stepper.*Tests\.cpp$" Tests/

Length of output: 7598

Tests/UnitTests/Core/SpacePointFormation/SpacePointBuilderTests.cpp (1)

50-51: Improved readability through better code organization, hmm.

Better documentation and spacing, this change brings. Clearer understanding of the code's purpose, it provides.

Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp (2)

76-78: Embraced the new way of state creation, you have.

Through Options object, state initialization now flows. Cleaner and more maintainable, the code becomes.

Also applies to: 84-84


152-152: Additional control over step size updates, gained we have.

New boolean parameter in updateStepSize, more flexibility it brings. Better control over the stepping process, we achieve.

Tests/IntegrationTests/PropagationTests.hpp (3)

351-359: Approve template parameter simplification, I do!

Removed the options_t template parameter, making the code cleaner and more maintainable, it has become. The function signature now focuses on the essential propagator types.

Also applies to: 361-361


Line range hint 377-387: Simplified template parameters, good they are!

Similar to the previous change, removed unnecessary template parameter options_t has been. Consistency in approach, maintained it is.


396-399: Consistent with previous changes, this modification is!

The pattern of simplified template usage continues here. Cleaner code structure, it maintains.

Tests/UnitTests/Core/Propagator/PropagatorTests.cpp (2)

407-408: Proper initialization of options, this is!

Initialize EigenPropagatorType::Options with both geometry and magnetic field contexts, we now do. More explicit and safer, this approach is.


440-441: Consistent initialization pattern, maintained it is!

Similar to previous change, proper initialization of StraightLineStepper options with contexts, implemented it has been.

Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp (7)

165-168: Proper initialization of stepper options and state, this is!

Initialize options with contexts before creating the stepper, we now do. Clear separation of concerns, this maintains.


172-172: State creation through makeState, properly implemented it is!

Use makeState consistently for state initialization, the code does. Good practice for encapsulation, this is.

Also applies to: 186-186, 193-193


218-223: Options configuration and state initialization, well structured they are!

Configure max step size through options and create state using makeState, the code does. Proper encapsulation of configuration, this maintains.


237-237: Step size update with proper flag, implemented it is!

Added boolean parameter to updateStepSize, making the behavior more explicit, it does.


320-320: State copying through makeState, proper approach this is!

Use makeState for initial state creation in copy operation, maintaining consistency with new pattern.


417-418: Options reinitialization, properly done it is!

Reinitialize options with contexts before creating new state, maintaining proper initialization pattern.


424-424: Surface intersection handling, properly updated it is!

Update surface status and step size with proper context usage, the code does. Consistent with new options-based approach, this remains.

Also applies to: 432-435, 441-444

Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp (2)

270-272: Approve the addition of StraightPropagator options, I do!

Wise choice it is, to configure propagator options separately. Clear separation between straight line and helical propagation, this brings. Consistent with the stepper state refactoring goals, this change is.


279-280: Approve the updated propagation call with new options, I do!

Properly configured propagation with dedicated options, now we have. Clean and explicit the code becomes, when separate options for straight line propagation we use.

Copy link
Member

@paulgessinger paulgessinger left a comment

Choose a reason for hiding this comment

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

Not 100% convinced why this shouldn't be in the constructor, but I can see the argument that it doesn't need to be, with the state only being a value holder.

@andiwand
Copy link
Contributor Author

To me it makes sense to separate the creation and the initialization of the state. In the constructor we do not have enough information to really initialize the state so I would only pass in the stuff which is really required like the options. Passing in the field and the config of the stepper/navigator seems overkill for a constructor IMO.

Potentially we can think about renaming makeState and/or combine it with the navigator initialize.

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

Successfully merging this pull request may close these issues.

2 participants