-
Notifications
You must be signed in to change notification settings - Fork 255
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
Sped up covariance estimate via numba #686
Conversation
Codecov ReportAll modified lines are covered by tests ✅
📢 Thoughts on this report? Let us know!. |
Looks good. Can you run isort for fix imports. ? |
I actually ran I'm guessing there's been a
I can apply it if you want to, but it's not really part of this PR :) The other issue is (was, I just pushed an update) that the signature for the |
Disregard part of that last comment... I was looking at the wrong branch ;) The diff above still applies though |
To get the decorator to work, I thnk you can use try:
if DISABLE_NUMBA:
raise ImportError
from numba import jit
jit = functools.partial(jit, nopython=True)
except ImportError:
def jit(
*args: Any,
**kwargs: Any,
) -> Any:
if args and callable(args[0]):
func = args[0]
def wrap(func):
def wrapper(*args: Any, **kwargs: Any) -> Callable[..., Any]:
import warnings
warnings.warn(performance_warning, PerformanceWarning)
return func(*args, **kwargs)
return wrapper
return wrap |
I pushed an improved version of the fix. |
Allow use as both a decorator and directly
Thanks. Merged these in after some surgery on the compact layer. |
Thanks for the quick merge and the awesome project! |
Benchmarked using:
py.test arch/tests/unitroot/test_fmols_ccr.py
Before:
After:
Nothing too dramatic but a useful performance improvement :)
I'm still looking at other bottlenecks right now so depending on your preference I can create separate pull requests or a single large one :)