Add backend parameter to detect_equilibration_window for optional numba dependencyupdate#10
Add backend parameter to detect_equilibration_window for optional numba dependencyupdate#10xiki-tempula wants to merge 1 commit intofjclark:mainfrom
backend parameter to detect_equilibration_window for optional numba dependencyupdate#10Conversation
74a1842 to
d00b2b5
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
===========================================
- Coverage 100.00% 99.19% -0.81%
===========================================
Files 10 10
Lines 646 745 +99
===========================================
+ Hits 646 739 +93
- Misses 0 6 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
|
Thanks very much for this! Before I review in detail, could you please comment on the speed differences? If I run the tests on |
|
Thanks for flagging this - that's a significant slowdown and definitely not expected! |
|
Thanks! I see this slow-down consistently:
On my ubuntu workstation:
Latest version: 0.63.1
Yes, this returns True. Here's the full environment on my ubuntu workstation: |
|
I cannot really reproduce the slowdown, given that the speed improvement is not big big, I think I will just close this PR. |
Summary
backendparameter todetect_equilibration_windowthat allows choosing between"numba"(default) and"numpy"backendsMotivation
This change allows users who don't have numba installed (or don't want to use it) to still use
detect_equilibration_window. The numpy backend provides a pure Python/numpy implementation that works without any additional dependencies.Changes
red/variance.py:_optional_njitdecorator that applies numba JIT only when available_compute_variance_series_window_numpy- pure numpy implementation_compute_variance_series_window_indexed- numba parallel implementationbackendparameter toget_variance_series_windowred/sse.py: Addedbackendparameter toget_sse_series_windowred/equilibration.py: Addedbackendparameter todetect_equilibration_windowred/tests/test_equilibration.py: Addedtest_detect_equilibration_window_backendsto verify both backends produce identical resultsUsage