Spaces:
Sleeping
Sleeping
hotfix: correct _sf() kwarg — lag= → l= (the param is named 'l')
Browse files- _startup_patch.py +13 -0
_startup_patch.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Startup patch: fixes the _sf() keyword argument bug in sample_extractor.py"""
|
| 2 |
+
import importlib, sys, os
|
| 3 |
+
|
| 4 |
+
# Patch the source file on disk before importing
|
| 5 |
+
path = os.path.join(os.path.dirname(__file__), 'sample_extractor.py')
|
| 6 |
+
with open(path, 'r') as f:
|
| 7 |
+
src = f.read()
|
| 8 |
+
|
| 9 |
+
if '_sf(yh,lag=2,ms=5)' in src:
|
| 10 |
+
src = src.replace('_sf(yh,lag=2,ms=5)', '_sf(yh,l=2,ms=5)')
|
| 11 |
+
with open(path, 'w') as f:
|
| 12 |
+
f.write(src)
|
| 13 |
+
print("[patch] Fixed _sf() kwarg: lag=2 → l=2")
|