-
-
Notifications
You must be signed in to change notification settings - Fork 0
FIX: Add Motors to Rocket without rail buttons. #43
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
Conversation
WalkthroughThe changes update the rocket motor integration within the Changes
Sequence Diagram(s)sequenceDiagram
participant RV as RocketView
participant RS as RocketService
participant RP as rocketpy_rocket
RV->>RS: Call from_rocket_model(rocket)
RS->>RP: Create rocketpy_rocket instance
RS->>RP: Call add_motor()
RP-->>RS: Rocket model updated with motor
RS-->>RV: Return updated rocket instance
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
lib/services/rocket.py (1)
48-51
: Add validation for motor presence.Consider adding validation to ensure
rocket.motor
androcket.motor_position
are not None before attempting to add the motor. This would prevent potential runtime errors.+ if not rocket.motor: + raise ValueError("Motor is required") + if rocket.motor_position is None: + raise ValueError("Motor position is required") rocketpy_rocket.add_motor( MotorService.from_motor_model(rocket.motor).motor, rocket.motor_position, )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
lib/services/rocket.py
(1 hunks)
🔇 Additional comments (1)
lib/services/rocket.py (1)
48-51
: LGTM! Good architectural improvement.Removing the dependency between motor addition and rail buttons is the right approach since they serve different purposes. This change correctly allows motors to be added to rockets regardless of rail button presence.
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.
LGTM
Summary by CodeRabbit