Add backend parameter to detect_equilibration_window for optional numba dependencyupdate
#10
+304
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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