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

Replace interface singleton class with cached functions #572

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

joeshannon
Copy link
Contributor

@joeshannon joeshannon commented Jul 24, 2024

@joeshannon joeshannon force-pushed the 568-singleton-to-cache branch 2 times, most recently from ce694ff to 323c5ce Compare July 24, 2024 12:40
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

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

Project coverage is 93.05%. Comparing base (0a4abfe) to head (37a6530).

Files Patch % Lines
src/blueapi/service/runner.py 86.95% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #572      +/-   ##
==========================================
- Coverage   93.13%   93.05%   -0.08%     
==========================================
  Files          42       42              
  Lines        1865     1844      -21     
==========================================
- Hits         1737     1716      -21     
  Misses        128      128              

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

@joeshannon joeshannon force-pushed the 568-singleton-to-cache branch 3 times, most recently from 38fc495 to 8417a7f Compare July 26, 2024 09:24
@joeshannon joeshannon changed the title WIP Use lru_cache Replace interface singleton class with cached functions Jul 26, 2024
@joeshannon joeshannon force-pushed the 568-singleton-to-cache branch from 8417a7f to ca9ec44 Compare July 26, 2024 10:05
@joeshannon joeshannon force-pushed the delete-commented-code branch from a387311 to 65d9026 Compare July 26, 2024 12:28
Base automatically changed from delete-commented-code to main July 30, 2024 15:58
@joeshannon joeshannon force-pushed the 568-singleton-to-cache branch from ca9ec44 to 37ba514 Compare July 30, 2024 16:05
src/blueapi/service/runner.py Show resolved Hide resolved
src/blueapi/service/runner.py Show resolved Hide resolved
Replace with lru_cached functions. These will return the same value
each time they are called. This simplifies the interface module.

The tests and checks for working initialisation have been removed as
they are no longer appropriate.
@joeshannon joeshannon force-pushed the 568-singleton-to-cache branch from 37ba514 to 37a6530 Compare July 31, 2024 12:38
@joeshannon joeshannon merged commit ca718d8 into main Jul 31, 2024
24 checks passed
@joeshannon joeshannon deleted the 568-singleton-to-cache branch July 31, 2024 12:44
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.

2 participants