RocketPy icon indicating copy to clipboard operation
RocketPy copied to clipboard

BUG: Motor method 'export_eng' for liquid motors bug fix. (solves #473)

Open lucasfourier opened this issue 1 year ago • 6 comments

Pull request type

  • [X] Code changes (bugfix, features)
  • [X] Code maintenance (refactoring, formatting, tests)
  • [ ] ReadMe, Docs and GitHub updates
  • [ ] Other (please describe):

Checklist

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

Current behavior

As described in #473, 'export_eng' method does not work for liquid motors since it does not have grain related attributes.

New behavior

The Motor method 'export_eng' now works for liquid motors and the .eng file is created. For liquid motors, the first two parameters written to the file are now zeros, since those are grain related attributes.

Breaking change

  • [ ] Yes
  • [X] No

Additional information

Below is the '.eng' file generated for the liquid motor defined in the SEB_liquid_motor.ipynb notebook.

image

lucasfourier avatar Feb 20 '24 17:02 lucasfourier

I'd like to add that Issue #473 requests the implementation of tests. However, I'd like to request permission to not write tests for this method for now. My plan is to refactor the unit tests for the liquid_motor module later today, and I intend to include the tests for this method as part of that refactor.

lucasfourier avatar Feb 20 '24 17:02 lucasfourier

.eng files documentation: https://www.thrustcurve.org/info/raspformat.html

Saving that for reference.

Gui-FernandesBR avatar Feb 20 '24 18:02 Gui-FernandesBR

Codecov Report

Attention: Patch coverage is 92.85714% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 72.60%. Comparing base (79aa3b6) to head (bb65a33). Report is 13 commits behind head on develop.

Files Patch % Lines
rocketpy/motors/motor.py 92.85% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #559      +/-   ##
===========================================
+ Coverage    72.47%   72.60%   +0.12%     
===========================================
  Files           59       59              
  Lines         9567     9584      +17     
===========================================
+ Hits          6934     6958      +24     
+ Misses        2633     2626       -7     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 20 '24 18:02 codecov[bot]

@Gui-FernandesBR Much better, thanks. Committed your solution

lucasfourier avatar Feb 24 '24 20:02 lucasfourier

Done it

lucasfourier avatar Feb 24 '24 22:02 lucasfourier

Fixed it

lucasfourier avatar Feb 24 '24 23:02 lucasfourier