Skip to content

Conversation

@phmbressan
Copy link
Collaborator

@phmbressan phmbressan commented Aug 30, 2024

Pull request type

  • Code maintenance (refactoring, formatting, tests)

Checklist

  • Tests for the changes have been added (if needed)
  • 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

Currently the Tank's testing module present the following issues:

  • The module has too complex logic inside the tests;
  • There are analytical functions that perform geometrical validation:
    • Those, even if correct, are hard to maintain and may, for instance, repeat mistakes from the code.

New behavior

This PR aims to bring the following changes to code:

  • CAD related data by cadquery module for geometrical validation;
  • Refactor of the complex logic inside the Tanks tests;
    • There is still room for improvement here, but the code is better organized now.
  • Implement plotting and printing functionality to the Tanks class (this can be moved to another PR if needed).

Breaking change

  • Yes
  • No

Additional information

Check out CadQuery docs for further information and examples.

An important notice is that the CAD module is not executed in every test for the two reasons:

  • The CAD library has a large install size (> 200MB);
  • Some models are slow to be used in parametrized tests.

Therefore I have added the necessary code into a Jupyter notebook for easy recalculation of the expected values, but this can be discussed further on this PR.

P.S.: I will fix the PyLint errors shortly.

@phmbressan phmbressan added this to the Release v1.X.0 milestone Aug 30, 2024
@phmbressan phmbressan self-assigned this Aug 30, 2024
@phmbressan phmbressan requested a review from a team as a code owner August 30, 2024 21:14
@codecov
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 96.90722% with 3 lines in your changes missing coverage. Please review.

Project coverage is 76.43%. Comparing base (e1a2061) to head (e6dec5b).
Report is 26 commits behind head on develop.

Files with missing lines Patch % Lines
rocketpy/plots/tank_geometry_plots.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #678      +/-   ##
===========================================
+ Coverage    75.99%   76.43%   +0.44%     
===========================================
  Files           95       95              
  Lines        11015    11078      +63     
===========================================
+ Hits          8371     8468      +97     
+ Misses        2644     2610      -34     

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

@Gui-FernandesBR Gui-FernandesBR changed the title MNT: Refactor Tank's testing Assertion with CAD data. TST: Refactor Tank's testing Assertion with CAD data. Sep 8, 2024
@Gui-FernandesBR Gui-FernandesBR changed the title TST: Refactor Tank's testing Assertion with CAD data. MNT: Refactor Tank's testing Assertion with CAD data. Sep 8, 2024
@Gui-FernandesBR Gui-FernandesBR marked this pull request as draft September 12, 2024 02:58
@phmbressan phmbressan marked this pull request as ready for review November 13, 2024 17:11
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.

a few tests are not passing locally...

def test_all_info(mock_show, flight_calisto_robust):  # pylint: disable=unused-argument
def test_motor(mock_show, cesaroni_m1670):  # pylint: disable=unused-argument

@phmbressan
Copy link
Collaborator Author

a few tests are not passing locally...

Thanks for testing it. I will check what is happening.

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 Gui-FernandesBR merged commit d93666a into develop Nov 30, 2024
7 checks passed
@Gui-FernandesBR Gui-FernandesBR deleted the mnt/tank-cad-testing branch November 30, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

4 participants