Skip to content

Commit

Permalink
BUG: Correct dummy decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtage committed Oct 12, 2023
1 parent a96640b commit e30a307
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
11 changes: 10 additions & 1 deletion arch/compat/numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,17 @@ def jit(
**kwargs: Any,
) -> Any:
if function_or_signature is not None and callable(function_or_signature):
return function_or_signature
# Used directly, e.g., f_jit = jit(f)
@functools.wraps(function_or_signature)
def wrapper(*args: Any, **kwargs: Any) -> Callable[..., Any]:
import warnings

warnings.warn(performance_warning, PerformanceWarning)
return function_or_signature(*args, **kwargs)

return wrapper

# Used as a decorator, e.g., @jit
def wrap(func):
@functools.wraps(func)
def wrapper(*args: Any, **kwargs: Any) -> Callable[..., Any]:
Expand Down
3 changes: 2 additions & 1 deletion arch/tests/univariate/test_recursions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from arch.univariate.volatility import RiskMetrics2006

CYTHON_COVERAGE = os.environ.get("ARCH_CYTHON_COVERAGE", "0") in ("true", "1", "True")
DISABLE_NUMBA = os.environ.get("ARCH_DISABLE_NUMBA", False) in ("1", "true", "True")

try:
import arch.univariate.recursions as rec_cython
Expand All @@ -29,7 +30,7 @@
try:
import numba # noqa

MISSING_NUMBA = False
MISSING_NUMBA = False or DISABLE_NUMBA
except ImportError:
MISSING_NUMBA = True

Expand Down
5 changes: 1 addition & 4 deletions arch/univariate/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,10 +1189,7 @@ def summary(self) -> Summary:

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
Expand Down

0 comments on commit e30a307

Please sign in to comment.