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: Callback function for collecting additional data from Monte Carlo sims #702

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

emtee14
Copy link

@emtee14 emtee14 commented Oct 6, 2024

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 tests -m slow --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behaviour

Implementation for this feature suggestion #699 . At the moments users are limited to set variables when exporting data from Monte Carlo experiments.

New behaviour

Now a function can be passed to the MonteCarlo class which takes a Flight object as an argument and returns a dict to be appended to the default outputs.

Breaking change

  • No

Additional information

At the moment the implementation works but there is an existing issue with the RocketPyEncoder for writing the inputs to the .txt file as JSON strings. I've also made it check if the function overwrites existing variables though I feel this may not be necessary. I also had to fix how the previous results are imported as they are errors since text results can now be exported, see line 671.

@emtee14 emtee14 changed the base branch from master to develop October 6, 2024 21:18
@Gui-FernandesBR
Copy link
Member

Thanks for opening the PR @emtee14 , we will get back to you after the EuRoC competition, when our development team will be more available.

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 38.46154% with 8 lines in your changes missing coverage. Please review.

Project coverage is 75.85%. Comparing base (8e4db26) to head (a25c2ee).

Files with missing lines Patch % Lines
rocketpy/simulation/monte_carlo.py 38.46% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #702      +/-   ##
===========================================
- Coverage    75.90%   75.85%   -0.05%     
===========================================
  Files           99       99              
  Lines        11222    11232      +10     
===========================================
+ Hits          8518     8520       +2     
- Misses        2704     2712       +8     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

2 participants