Skip to content

Commit 765afb0

Browse files
MAINT: Improve setup, and other maintenance.
* In setup.py, use setup() from setuptools, and use more arguments in setup(). * Copy-edit README.md, and make similar changes in doc/index.rst. * Remove an unused import of os from doc/source/conf.py. * Add __init__.py in numpy_financial/tests/.
1 parent 0a3d64c commit 765afb0

File tree

5 files changed

+68
-15
lines changed

5 files changed

+68
-15
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# NumPy Financial
22

3-
The `numpy-financial` package contains a collection of elementary financial functions.
4-
The original versions of these functions were in NumPy.
5-
The NumPy versions will be deprecated:
6-
see [NEP-32](https://numpy.org/neps/nep-0032-remove-financial-functions.html).
3+
The `numpy-financial` package contains a collection of elementary financial
4+
functions.
5+
6+
The [financial functions in NumPy](https://numpy.org/doc/1.17/reference/routines.financial.html)
7+
are deprecated and eventually will be removed from NumPy; see
8+
[NEP-32](https://numpy.org/neps/nep-0032-remove-financial-functions.html)
9+
for more information. This package is the replacement for the original
10+
NumPy financial functions.
11+
12+
The source code for this package is available at https://github.com/numpy/numpy-financial.
13+
14+
The importable name of the package is `numpy_financial`. When giving the
15+
name a shortened alias, `npf` is recommended. For example,
16+
17+
```
18+
>>> import numpy_financial as npf
19+
>>> npf.irr([-250000, 100000, 150000, 200000, 250000, 300000])
20+
0.5672303344358536
21+
```

doc/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# list see the documentation:
55
# https://www.sphinx-doc.org/en/master/usage/configuration.html
66

7-
import os
87
import numpy_financial
98

109
# -- Path setup --------------------------------------------------------------

doc/source/index.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,25 @@
66
numpy-financial |version|
77
=========================
88

9-
Simple financial functions.
9+
The `numpy-financial` package contains a collection of elementary financial
10+
functions.
1011

11-
The importable Python package name is ``numpy_financial``.
12+
The `financial functions in NumPy <https://numpy.org/doc/1.17/reference/routines.financial.html>`_
13+
are deprecated and eventually will be removed from NumPy; see
14+
`NEP-32 <https://numpy.org/neps/nep-0032-remove-financial-functions.html>`_
15+
for more information. This package is the replacement for the deprecated
16+
NumPy financial functions.
1217

1318
The source code for this package is available at https://github.com/numpy/numpy-financial.
1419

20+
The importable name of the package is `numpy_financial`. The recommended
21+
alias is `npf`. For example,
22+
23+
>>> import numpy_financial as npf
24+
>>> npf.irr([-250000, 100000, 150000, 200000, 250000, 300000])
25+
0.5672303344358536
26+
27+
1528
Functions
1629
---------
1730

numpy_financial/tests/__init__.py

Whitespace-only changes.

setup.py

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python
22

3+
from os import path
4+
35

46
def get_version():
57
"""
@@ -19,16 +21,40 @@ def get_version():
1921
return s[1][1:-1]
2022

2123

22-
def configuration(parent_package='', top_path=None):
23-
from numpy.distutils.misc_util import Configuration
24-
config = Configuration(None, parent_package, top_path)
25-
config.add_subpackage('numpy_financial')
26-
return config
27-
24+
CLASSIFIERS = """\
25+
Development Status :: 5 - Production/Stable
26+
Intended Audience :: Science/Research
27+
Intended Audience :: Developers
28+
License :: OSI Approved
29+
Programming Language :: Python
30+
Programming Language :: Python :: 3
31+
Programming Language :: Python :: 3.5
32+
Programming Language :: Python :: 3.6
33+
Programming Language :: Python :: 3.7
34+
Programming Language :: Python :: 3 :: Only
35+
Topic :: Software Development
36+
Topic :: Scientific/Engineering
37+
"""
38+
39+
here = path.abspath(path.dirname(__file__))
40+
with open(path.join(here, 'README.md'), 'r') as f:
41+
long_description = f.read()
2842

2943
if __name__ == "__main__":
30-
from numpy.distutils.core import setup
44+
from setuptools import setup, find_packages
3145

3246
setup(name='numpy-financial',
3347
version=get_version(),
34-
configuration=configuration)
48+
description='Simple financial functions',
49+
long_description=long_description,
50+
long_description_content_type='text/markdown',
51+
packages=find_packages(exclude=['doc']),
52+
author='Travis E. Oliphant et al.',
53+
license='BSD',
54+
python_requires='>=3.5',
55+
classifiers=CLASSIFIERS.splitlines(),
56+
project_urls={
57+
"Bug Tracker": "https://github.com/numpy/numpy-financial/issues",
58+
"Documentation": "https://numpy.org/numpy-financial/",
59+
"Source Code": "https://github.com/numpy/numpy-financial",
60+
})

0 commit comments

Comments
 (0)