-
-
Notifications
You must be signed in to change notification settings - Fork 0
BUG: fins failing to accept both sweep and angle #59
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
WalkthroughAdded a class-level Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant FinsModel as Fins
rect rgb(240,248,255)
Caller->>FinsModel: call get_additional_parameters()
note right of FinsModel: 1) model_dict = self.dict()
end
rect rgb(245,245,245)
FinsModel->>FinsModel: exclude keys in _base_keys from model_dict
FinsModel->>FinsModel: remove entries with value == None
FinsModel->>FinsModel: if sweep_angle and sweep_length present → remove sweep_length
end
FinsModel-->>Caller: return additional_parameters (dict)
sequenceDiagram
participant Caller
participant Utils as collect_attributes
participant Resolver as _resolve_attribute_path
participant Populator as _populate_simulation_attributes
rect rgb(240,255,240)
Caller->>Utils: call collect_attributes(obj)
note right of Utils: prepare attributes dict & dispatcher table
end
rect rgb(255,250,240)
Utils->>Populator: _populate_simulation_attributes(obj, attr_class, attributes)
Populator->>Resolver: resolve source paths via _resolve_attribute_path
Populator->>Utils: _annotation_keys to get keys
Populator->>Utils: _resolve_attribute_target to ensure nested targets
Populator->>Utils: _copy_missing_attributes(source, target, keys)
end
Utils-->>Caller: return encoded attributes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
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 |
@aasitvora99 I think this line of code is more problematic than the one you have shared ![]() |
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
57e0159
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Makefile (1)
76-76
: Declare composite targets as PHONY.The
.PHONY
declaration includes individual targets but omits the composite targetslint
andformat
defined at lines 42-43. This can cause issues if files namedlint
orformat
exist in the directory.Apply this diff:
-.PHONY: black flake8 pylint test dev clean build ruff format +.PHONY: black flake8 pylint test dev clean build ruff format lint
🧹 Nitpick comments (1)
src/utils.py (1)
57-58
: Simplify parameter naming.The parameter rename from
obj
too
followed by immediate reassignmentobj = o
is unnecessary. The original parameter nameobj
is more descriptive and aligns with the rest of the method body.Apply this diff:
- def default(self, o): - obj = o + def default(self, obj):
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
Makefile
(1 hunks)src/models/sub/aerosurfaces.py
(1 hunks)src/utils.py
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/models/sub/aerosurfaces.py
🧰 Additional context used
🧬 Code graph analysis (1)
src/utils.py (4)
src/views/flight.py (1)
FlightSimulation
(9-140)src/views/rocket.py (1)
RocketSimulation
(8-59)src/views/motor.py (1)
MotorSimulation
(7-73)src/views/environment.py (1)
EnvironmentSimulation
(13-78)
🪛 checkmake (0.2.2)
Makefile
[warning] 43-43: Target "lint" should be declared PHONY.
(phonydeclared)
🔇 Additional comments (4)
Makefile (1)
6-40
: LGTM: Tool variable logic with virtualenv preference.The conditional logic correctly prioritizes virtualenv-installed tools over system commands, with appropriate fallbacks for pytest and uvicorn using
python3 -m
. This ensures consistent behavior across different development environments.src/utils.py (3)
76-76
: Correct fix for accessing private Flight method.The change from
obj.__evaluate_post_process()
toobj._Flight__evaluate_post_process()
correctly uses Python's name mangling convention to access the private method__evaluate_post_process
defined in theFlight
class. The original code would have failed to call the intended method.
128-190
: Well-structured refactoring with defensive programming.The refactored attribute population logic cleanly separates concerns:
_populate_simulation_attributes
: Coordinates the mapping-driven population_annotation_keys
: Filters annotations by exclusions_resolve_attribute_path
: Navigates nested attributes safely_resolve_attribute_target
: Builds nested dict structure_copy_missing_attributes
: Copies with AttributeError handlingThe mapping-based approach at lines 132-142 clearly documents the relationships between simulation classes and their attribute paths.
117-126
: Confirmed fin sweep/angle fix implemented in src/models/sub/aerosurfaces.py —Fins.get_additional_parameters
(lines 47–58) introduces_base_keys
and dropssweep_length
when bothsweep_angle
andsweep_length
are set.
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:
Summary by CodeRabbit
Breaking Changes
Changes
Chores
Refactor