Skip to content

Conversation

aasitvora99
Copy link
Contributor

@aasitvora99 aasitvora99 commented Oct 4, 2025

Saw an error with fin sweep declaration even after sending null value for them. Temp fixing this until lib works on a proper fix.

Stacktrace:

2025-10-05 01:24:46,930 - ERROR - get_flight_simulation: Unexpected error Cannot use sweep_length and sweep_angle together
Traceback (most recent call last):
  File "/Infinity-API/src/controllers/interface.py", line 16, in wrapper
    return await method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Infinity-API/src/controllers/flight.py", line 107, in get_flight_simulation
    flight_service = FlightService.from_flight_model(flight.flight)
  File "/Infinity-API/src/services/flight.py", line 34, in from_flight_model
    rocketpy_rocket = RocketService.from_rocket_model(flight.rocket).rocket
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Infinity-API/src/services/rocket.py", line 69, in from_rocket_model
    rocketpy_finset_list = cls.get_rocketpy_finset_list_from_fins_list(
        rocket.fins
    )
  File "/Infinity-API/src/services/rocket.py", line 150, in get_rocketpy_finset_list_from_fins_list
    cls.get_rocketpy_finset(fins, fins.fins_kind) for fins in fins_list
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Infinity-API/src/services/rocket.py", line 164, in get_rocketpy_finset
    rocketpy_finset = RocketPyTrapezoidalFins(
        n=fins.n,
    ...<3 lines>...
        **fins.get_additional_parameters(),
    )
  File "/RocketPy/rocketpy/rocket/aero_surface/fins/trapezoidal_fins.py", line 174, in __init__
    raise ValueError("Cannot use sweep_length and sweep_angle together")
ValueError: Cannot use sweep_length and sweep_angle together

Summary by CodeRabbit

  • Breaking Changes
    • Removed the sweep_angle field from Fins. It is no longer accepted in inputs or returned in serialized outputs, and will be absent from exported data.
  • Changes
    • sweep_angle is no longer considered in additional parameters, which may impact tools or workflows that referenced it.

Copy link
Contributor

coderabbitai bot commented Oct 4, 2025

Walkthrough

Removed the optional sweep_angle field from the Fins model in src/models/sub/aerosurfaces.py, affecting serialization and excluding sweep_angle from get_additional_parameters.

Changes

Cohort / File(s) Summary of Changes
Aerosurface model update
src/models/sub/aerosurfaces.py
Removed sweep_angle: Optional[float] = None from Fins; sweep_angle no longer appears in dict serialization; get_additional_parameters will not consider sweep_angle.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A whisk of wind, a trim so fine,
The fins now fly a simpler line.
No sweep to keep, no angle steep—
Just cleaner fields for sprints we leap.
Thump-thump goes my review beat—
Ship it swift on rabbit feet! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title describes the bug symptom rather than the actual change of removing the sweep_angle field from the Fins model and uses a generic “BUG:” prefix, so it does not clearly and concisely summarize the main change in the pull request. Rename the title to clearly reflect the fix, for example “Remove Fins.sweep_angle field to resolve sweep_length conflict” to concisely capture the primary change without the “BUG:” prefix.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/fin-sweep

📜 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 da0bdb0 and 25a8178.

📒 Files selected for processing (1)
  • src/models/sub/aerosurfaces.py (0 hunks)
💤 Files with no reviewable changes (1)
  • src/models/sub/aerosurfaces.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Gui-FernandesBR
Copy link
Member

The behavior on RocketPy lib seems to be fine. My guess is that rocketpy (lib) calculates and sets the sweep angle and length after initialization, the infinity tries to recreate the object using these values

@Gui-FernandesBR
Copy link
Member

@aasitvora99 I think this line of code is more problematic than the one you have shared

image

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

Successfully merging this pull request may close these issues.

2 participants