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

ENH: Argument for Optional Mutation on Function Discretize #519

Merged
merged 12 commits into from
Jan 20, 2024

Conversation

phmbressan
Copy link
Collaborator

Pull request type

  • Code changes (bugfix, features)

Checklist

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

Current behavior

The behavior of Function.set_discrete is well documented, but not exactly intuitive: the original Function is always mutated. This may not always be the need of the user and it has caused problems before in development, such as #514 .

New behavior

This PR adds a new optional parameter (whose default does not call a breaking change) so that it may be specified whether the self should be discretized.

Tests for the changes have been added.

Breaking change

  • No

Additional information

Please, on review make a sanity recheck that this is not a breaking change.

@phmbressan phmbressan added the Enhancement New feature or request, including adjustments in current codes label Dec 20, 2023
@phmbressan phmbressan added this to the Release v1.X.0 milestone Dec 20, 2023
@phmbressan phmbressan self-assigned this Dec 20, 2023
@phmbressan phmbressan requested a review from a team as a code owner December 20, 2023 11:47
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (7f033d8) 71.99% compared to head (2205fdf) 72.20%.
Report is 8 commits behind head on develop.

Files Patch % Lines
rocketpy/mathutils/function.py 93.54% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #519      +/-   ##
===========================================
+ Coverage    71.99%   72.20%   +0.20%     
===========================================
  Files           56       56              
  Lines         9374     9376       +2     
===========================================
+ Hits          6749     6770      +21     
+ Misses        2625     2606      -19     

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

@phmbressan
Copy link
Collaborator Author

I will work on the codecov report later.

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.

Well done, I don't see any breaking changes happening here.

It would be nice to include tests for 2-D functions.

CHANGELOG.md Outdated Show resolved Hide resolved
rocketpy/mathutils/function.py Show resolved Hide resolved
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
Copy link
Member

@phmbressan do you know what is happening with the GitHub actions here?

@phmbressan
Copy link
Collaborator Author

@phmbressan do you know what is happening with the GitHub actions here?

There was one test that oddly failed on first pass forcing the others to be run manually.

@Gui-FernandesBR Gui-FernandesBR merged commit a14e7e8 into develop Jan 20, 2024
11 checks passed
@Gui-FernandesBR Gui-FernandesBR deleted the enh/optional-discretize-mutation branch January 20, 2024 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request, including adjustments in current codes
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants