Skip to content

Conversation

@Bizo883
Copy link

@Bizo883 Bizo883 commented Nov 5, 2025

Pull request type

  • Code changes (bugfix, features)
  • Code maintenance (refactoring, formatting, tests)
  • ReadMe, Docs and GitHub updates

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behavior

There is no test for the _check_missing_components().

New behavior

This PR adds unit tests to verify the warning behavior of the _check_missing_components() method.
Specifically, it includes three test cases:

  1. All components missing → expects a single warning listing all missing elements.
  2. Some components missing → ensures only the absent components appear in the warning message.
  3. No components missing → ensures no warning is issued.

These tests are defined in tests/unit/test_rocket.py.

Breaking change

  • Yes
  • No

@Bizo883 Bizo883 requested a review from a team as a code owner November 5, 2025 15:22
C8H10O2 and others added 5 commits November 15, 2025 00:23
Added a placeholder in the [Unreleased] section for the upcoming feature
to add custom warnings when a rocket is missing motors and/or aero-surface. See RocketPy-Team#285.
This enhancement adds a warning when a Rocket object has no motors,
parachutes, or AeroSurface components. It notifies the user so that
they can add missing components before running simulations. See RocketPy-Team#285
Only warn if motor or aerodynamic surfaces are missing. Never raise a warning for no parachute. See RocketPy-Team#285
@C8H10O2 C8H10O2 force-pushed the enh/custom-warning-no-motor-parachute-aerosurface branch from 016acae to 1d75f80 Compare November 14, 2025 23:32
@Gui-FernandesBR Gui-FernandesBR changed the base branch from master to develop November 19, 2025 01:50
Copilot finished reviewing on behalf of Gui-FernandesBR November 19, 2025 01:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds unit tests for the new _check_missing_components() method in the Rocket class, which verifies whether a rocket has essential components (motor and aerodynamic surfaces) and issues warnings when components are missing.

  • Adds _check_missing_components() method to detect missing rocket components
  • Implements three unit tests covering all scenarios: all components missing, some missing, and none missing
  • Updates CHANGELOG to document the enhancement

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
rocketpy/rocket/rocket.py Adds _check_missing_components() method to warn users about missing motor or aerodynamic surfaces
tests/unit/rocket/test_rocket.py Adds three unit tests to verify warning behavior for different component configurations
CHANGELOG.md Documents the custom exception errors and messages enhancement

@Gui-FernandesBR
Copy link
Member

@Bizo883 please address all the comments, fix tests and linters. You can let me know when the PR is ready for review again

C8H10O2 and others added 3 commits November 25, 2025 14:45
- Removed redundant len() check for aerodynamic_surfaces.
- Added 'Returns: None' section to NumPy-style docstring.
- Removed redundant '[WARNING]' prefix in warnings messages.
…r: exceptions must be derived from Warning, not <class 'NoneType'>
@Bizo883
Copy link
Author

Bizo883 commented Nov 25, 2025

@Gui-FernandesBR The PR is ready for review again. Thank you!

@Gui-FernandesBR
Copy link
Member

@Bizo883 can you please mark all the solved commets as 'resolved' please?

Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

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

I will approve and merge this PR as soon as you fix linter issues

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.29%. Comparing base (9cf3dd4) to head (dc369f0).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #871      +/-   ##
===========================================
+ Coverage    80.27%   80.29%   +0.02%     
===========================================
  Files          104      104              
  Lines        12769    12777       +8     
===========================================
+ Hits         10250    10259       +9     
+ Misses        2519     2518       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-project-automation github-project-automation bot moved this from Backlog to Next Version in LibDev Roadmap Nov 26, 2025
Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

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

LGTM

@Gui-FernandesBR
Copy link
Member

great implementation! It's time to merge it!

@Gui-FernandesBR Gui-FernandesBR merged commit 9da4565 into RocketPy-Team:develop Nov 26, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from Next Version to Closed in LibDev Roadmap Nov 26, 2025
@Gui-FernandesBR Gui-FernandesBR changed the title Enh/custom warning no motor parachute aerosurface ENH: custom warning no motor or aerosurface Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

5 participants