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

Minor fixes in mission module #579

Merged
merged 5 commits into from
Nov 27, 2024
Merged

Minor fixes in mission module #579

merged 5 commits into from
Nov 27, 2024

Conversation

christophe-david
Copy link
Contributor

@christophe-david christophe-david commented Nov 25, 2024

This PR addresses 2 small problems:

  • lift value was generally not computed (knowing CL can be enough), though the column is always in csv files.
  • in ClimbAndCruise segment, the target of inner climb segment could be set without guarantee the climb segment was not None.

Additionally, some refactoring has been done to have CL and CD computed in only one location. For this purpose, abstract classes AbstractLiftFromWeightSegment and AbstractLiftFromAoASegment have been created, in the same purpose as AbstractManualThrustSegment and AbstractRegulatedThrustSegment.

BTW, the load_factor attribute has been added to AbstractLiftFromWeightSegment. It's an easy addition that allows to simulate segments with load factors different from 1.

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 97.87234% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.92%. Comparing base (0eb2816) to head (90d6bef).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
...performances/mission/segments/registered/cruise.py 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #579      +/-   ##
==========================================
+ Coverage   91.91%   91.92%   +0.01%     
==========================================
  Files         100      100              
  Lines        6183     6169      -14     
  Branches      973      974       +1     
==========================================
- Hits         5683     5671      -12     
+ Misses        334      333       -1     
+ Partials      166      165       -1     

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

@christophe-david christophe-david marked this pull request as ready for review November 25, 2024 17:28
Copy link
Contributor

@esnguyenvan esnguyenvan left a comment

Choose a reason for hiding this comment

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

Thanks for the clean-up. Seems all good to me.

@christophe-david christophe-david marked this pull request as draft November 26, 2024 12:55
@christophe-david
Copy link
Contributor Author

Thanks for the clean-up. Seems all good to me.

Sorry, just realized lift_equals_weight should have been a class attribute, not an instance one. And BTW, I consider now inheritance looks a better option to handle that. Stay tuned...

@christophe-david christophe-david marked this pull request as ready for review November 26, 2024 14:37
Copy link
Contributor

@esnguyenvan esnguyenvan left a comment

Choose a reason for hiding this comment

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

Seems good to me thanks for cleaning this up, it will solve additional issues. I would suggest to complete the documentation of the hold segment with the new load factor feature.

@@ -434,36 +496,6 @@ def get_gamma_and_acceleration(self, flight_point: FlightPoint):

return 0.0, acceleration

def complete_flight_point(self, flight_point: FlightPoint):
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for deleting this unnecessary overload, it fixed the values in brackets in the flight point at the same time. It took me while to figure it out: this overload does not apply the scalarise() method at the end.

@christophe-david christophe-david merged commit c59a2cd into master Nov 27, 2024
17 of 18 checks passed
@christophe-david christophe-david deleted the mission-cleanup branch November 27, 2024 14:43
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