Closed wolph closed 12 months ago
All modified lines are covered by tests :white_check_mark:
Files | Coverage Δ | |
---|---|---|
arch/covariance/kernel.py | 100.00% <100.00%> (ø) |
:loudspeaker: Thoughts on this report? Let us know!.
Looks good. Can you run isort for fix imports. ?
I actually ran isort
, black
and flake8
and none of those show issues with my code.
I'm guessing there's been a black
update this is the diff that black
is producing now:
$ git diff
diff --git a/arch/univariate/base.py b/arch/univariate/base.py
index 4847000f8..f59fd7c1c 100644
--- a/arch/univariate/base.py
+++ b/arch/univariate/base.py
@@ -1189,10 +1189,7 @@ class ARCHModelFixedResult(_SummaryRepr):
stubs = list(self._names)
header = ["coef"]
- param_table_data = [
- [format_float_fixed(param, 10, 4)]
- for param in self.params
- ]
+ param_table_data = [[format_float_fixed(param, 10, 4)] for param in self.params]
mc = self.model.num_params
vc = self.model.volatility.num_params
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 jit
function is incorrect. It doesn't allow usage as a decorator with arguments
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.
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 :)