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

Issue #136: Speed up root finding #137

Merged
merged 2 commits into from
May 16, 2024
Merged

Issue #136: Speed up root finding #137

merged 2 commits into from
May 16, 2024

Conversation

Mark2000
Copy link
Contributor

Description

Closes #136

Gets rid of chebpy and instead uses our knowledge about the problem to solve it more efficiently.

Before: 0.728 ms/call
After: 0.318 ms/call

Effective reduction of reset() times by 0.5x in imaging tasks.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How should this pull request be reviewed?

  • By commit
  • All changes at once

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Passes Tests

  • Unit tests (General Environment only) pytest --cov bsk_rl/envs/general_satellite_tasking --cov-report term-missing tests/unittest
  • Integrated tests (General Environment only) pytest --cov bsk_rl/envs/general_satellite_tasking --cov-report term-missing tests/integration
  • Examples (General Environment only) pytest tests/examples

Test Configuration

  • Python: 3.10
  • Basilisk: 2.3.0
  • Platform: MacOS

Checklist:

  • My code follows the style guidelines of this project (passes Black, ruff, and isort)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Commit messages are atomic, are in the form Issue #XXX: Message and have a useful message
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@Mark2000 Mark2000 requested review from Yume27 and LorenzzoQM May 16, 2024 16:39
@Mark2000
Copy link
Contributor Author

Going to add some additional changes in a second commit, but won't affect the first commit

@@ -294,7 +294,7 @@ class AccessSatellite(Satellite):
def __init__(
self,
*args,
generation_duration: float = 60 * 95,
generation_duration: float = 600.0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be 6,000.0 instead of 600.0 to be closer to 60*95?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, 6000 is excessive. Usually what happens is you calculate up to your time limit, but at the end you just need a handful of extra observations past the time limit to fill out your observation. If you needed to go past 600s, it would calculate additional 600s increments until it has everything it needs.

@Mark2000
Copy link
Contributor Author

Added a second commit that improves some bounds on a search by calculating them off the fly. Leads to a >80% reduction in reset time in my scenario.

Copy link
Contributor

@LorenzzoQM LorenzzoQM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Also, it is good not having to install chebpy considering the compatibility issues we were having.

Copy link

@Yume27 Yume27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works good with my script.

@Mark2000 Mark2000 merged commit 012875c into develop May 16, 2024
4 checks passed
@Mark2000 Mark2000 deleted the feature/136-fast-roots branch May 16, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the speed of root finding
3 participants