8000 WIP, MAINT: Improve import time by hmaarrfk · Pull Request #14083 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

WIP, MAINT: Improve import time #14083

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

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
Delay importing Decimal
  • Loading branch information
hmaarrfk committed Jul 23, 2019
commit 172347557db6096a0ac5ab312996888d7a746b29
5 changes: 4 additions & 1 deletion numpy/lib/financial.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"""
from __future__ import division, absolute_import, print_function

from decimal import Decimal
import functools

import numpy as np
Expand Down Expand Up @@ -621,6 +620,8 @@ def rate(nper, pmt, pv, fv, when='end', guess=None, tol=None, maxiter=100):
OpenDocument-formula-20090508.odt

"""
from decimal import Decimal

when = _convert_when(when)
default_type = Decimal if isinstance(pmt, Decimal) else float

Expand Down Expand Up @@ -812,6 +813,8 @@ def mirr(values, finance_rate, reinvest_rate):
Modified internal rate of return

"""
from decimal import Decimal

values = np.asarray(values)
n = values.size

Expand Down
0