Skip to content

Commit f1a43fa

Browse files
authored
Merge pull request #127 from Kai-Striega/maint/tidy-up-environment.yml
MAINT: Tidy up environment.yml
2 parents 3263e71 + cb41ae4 commit f1a43fa

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

.github/workflows/pythonpackage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
auto-update-conda: true
2121
python-version: ${{ matrix.python-version }}
22-
activate-environment: numpy-financial-dev
22+
activate-environment: npf-dev
2323
environment-file: environment.yml
2424
auto-activate-base: false
2525
- name: Conda metadata

environment.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# To use:
22
# $ conda env create -f environment.yml # `mamba` works too for this command
3-
# $ conda activate numpy-financial-dev
3+
# $ conda activate npf-dev
44
#
5-
name: numpy-financial-dev
5+
name: npf-dev
66
channels:
77
- conda-forge
88
dependencies:
99
# Runtime dependencies
1010
- python
11-
- numpy
11+
- numpy>=2.0.0
1212
# Build
1313
- cython>=3.0.9
1414
- compilers
@@ -20,7 +20,6 @@ dependencies:
2020
# Tests
2121
- pytest
2222
- pytest-xdist
23-
- asv>=0.6.0
2423
- hypothesis
2524
# Docs
2625
- myst-parser

numpy_financial/_financial.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def pmt(rate, nper, pv, fv=0, when='end'):
245245
years at an annual interest rate of 7.5%?
246246
247247
>>> npf.pmt(0.075/12, 12*15, 200000)
248-
-1854.0247200054619
248+
np.float64(-1854.0247200054619)
249249
250250
In order to pay-off (i.e., have a future-value of 0) the $200,000 obtained
251251
today, a monthly payment of $1,854.02 would be required. Note that this
@@ -424,7 +424,7 @@ def ipmt(rate, per, nper, pv, fv=0, when='end'):
424424
425425
>>> interestpd = np.sum(ipmt)
426426
>>> np.round(interestpd, 2)
427-
-112.98
427+
np.float64(-112.98)
428428
429429
"""
430430
when = _convert_when(when)
@@ -562,7 +562,7 @@ def pv(rate, nper, pmt, fv=0, when='end'):
562562
interest rate is 5% (annually) compounded monthly.
563563
564564
>>> npf.pv(0.05/12, 10*12, -100, 15692.93)
565-
-100.00067131625819
565+
np.float64(-100.00067131625819)
566566
567567
By convention, the negative sign represents cash flow out
568568
(i.e., money not available today). Thus, to end up with
@@ -913,7 +913,7 @@ def npv(rate, values):
913913
914914
>>> rate, cashflows = 0.08, [-40_000, 5_000, 8_000, 12_000, 30_000]
915915
>>> np.round(npf.npv(rate, cashflows), 5)
916-
3065.22267
916+
np.float64(3065.22267)
917917
918918
It may be preferable to split the projected cashflow into an initial
919919
investment and expected future cashflows. In this case, the value of
@@ -923,7 +923,7 @@ def npv(rate, values):
923923
>>> initial_cashflow = cashflows[0]
924924
>>> cashflows[0] = 0
925925
>>> np.round(npf.npv(rate, cashflows) + initial_cashflow, 5)
926-
3065.22267
926+
np.float64(3065.22267)
927927
928928
The NPV calculation may be applied to several ``rates`` and ``cashflows``
929929
simulatneously. This produces an array of shape ``(len(rates), len(cashflows))``.

0 commit comments

Comments
 (0)