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

BUG: Correctly update atmospheric conditions after changing date and location #743

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

WilliamArmst
Copy link
Contributor

Pull request type

Bugfix

Checklist

  • 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

If the environment date is updated after setting the atmospheric model, the function call to update the model to that date did not pass self.atmospheric_model_type when it is required by the function. This led to the file being passed in as the type.

New behavior

Behaves as expected

Breaking change

  • Yes
  • No

Additional information

N/A

@WilliamArmst WilliamArmst requested a review from a team as a code owner December 2, 2024 18:35
@WilliamArmst WilliamArmst changed the title BUG: Correctly update atmospheric conditions after changing date BUG: Correctly update atmospheric conditions after changing date and location Dec 2, 2024
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #743      +/-   ##
===========================================
+ 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.

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.

Nice catch!

Can you run black again please? @WilliamArmst

I am wondering whether we should release this BUG in a minor version (v1.7.1).

@WilliamArmst
Copy link
Contributor Author

I'm not sure what running black again means, if it's the local tests I'll have to wait until I get back from classes.

This is a pretty small fix and even without it, I think updating the date sometimes works anyways for some reason? It doesn't make sense to me, but it only became an issue for me when I tried doing batch simulations with multiple dates. Ultimately up to you if you want to put it into a bugfix.

@WilliamArmst
Copy link
Contributor Author

Is it failing because the linter wants this?

self.set_atmospheric_model(
        type=self.atmospheric_model_type,
        file=self.atmospheric_model_file,
        dictionary=self.atmospheric_model_dict,
)

@Gui-FernandesBR
Copy link
Member

Is it failing because the linter wants this?

self.set_atmospheric_model(
        type=self.atmospheric_model_type,
        file=self.atmospheric_model_file,
        dictionary=self.atmospheric_model_dict,
)

Yes!

The code line should not exceeds 88 length positions.

Black is one of our linters. Running make format should work. you can learn more about it here: https://docs.rocketpy.org/en/latest/development/style_guide.html

Gui-FernandesBR
Gui-FernandesBR previously approved these changes Dec 6, 2024
@phmbressan phmbressan changed the base branch from develop to master December 6, 2024 22:31
@phmbressan phmbressan dismissed Gui-FernandesBR’s stale review December 6, 2024 22:31

The base branch was changed.

@phmbressan phmbressan changed the base branch from master to develop December 6, 2024 22:32
@phmbressan phmbressan merged commit ed2a6a2 into RocketPy-Team:develop Dec 6, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants