Re: [Numpy-discussion] NEP 32: Remove the financial functions from NumPy

2019-09-11 Thread Warren Weckesser
On 9/3/19, Warren Weckesser  wrote:
> Github issue 2880 ("Get financial functions out of main namespace",
> https://github.com/numpy/numpy/issues/2880) has been open since 2013. In a
> recent community meeting, it was suggested that we create a NEP to propose
> the removal of the financial functions from NumPy.  I have submitted "NEP
> 32:  Remove the financial functions from NumPy" in a pull request at
> https://github.com/numpy/numpy/pull/14399.  A copy of the latest version of
> the NEP is below.


FYI, the NEP is now also available at
https://numpy.org/neps/nep-0032-remove-financial-functions.html.

Warren


>
> According to the NEP process document, "Once the PR is in place, the NEP
> should be announced on the mailing list for discussion (comments on the PR
> itself should be restricted to minor editorial and technical fixes)."  This
> email is the announcement for NEP 32.
>
> The NEP includes a brief summary of the history of the financial functions,
> and has links to several relevant mailing list threads, dating back to when
> the functions were added to NumPy in 2008.  I recommend reviewing those
> threads before commenting here.
>
> Warren
>
> -
>
> ==
> NEP 32 — Remove the financial functions from NumPy
> ==
>
> :Author: Warren Weckesser 
> :Status: Draft
> :Type: Standards Track
> :Created: 2019-08-30
>
>
> Abstract
> 
>
> We propose deprecating and ultimately removing the financial functions [1]_
> from NumPy.  The functions will be moved to an independent repository,
> and provided to the community as a separate package with the name
> ``numpy_financial``.
>
>
> Motivation and scope
> 
>
> The NumPy financial functions [1]_ are the 10 functions ``fv``, ``ipmt``,
> ``irr``, ``mirr``, ``nper``, ``npv``, ``pmt``, ``ppmt``, ``pv`` and
> ``rate``.
> The functions provide elementary financial calculations such as future
> value,
> net present value, etc. These functions were added to NumPy in 2008 [2]_.
>
> In May, 2009, a request by Joe Harrington to add a function called ``xirr``
> to
> the financial functions triggered a long thread about these functions [3]_.
> One important point that came up in that thread is that a "real" financial
> library must be able to handle real dates.  The NumPy financial functions
> do
> not work with actual dates or calendars.  The preference for a more capable
> library independent of NumPy was expressed several times in that thread.
>
> In June, 2009, D. L. Goldsmith expressed concerns about the correctness of
> the
> implementations of some of the financial functions [4]_.  It was suggested
> then
> to move the financial functions out of NumPy to an independent package.
>
> In a GitHub issue in 2013 [5]_, Nathaniel Smith suggested moving the
> financial
> functions from the top-level namespace to ``numpy.financial``.  He also
> suggested giving the functions better names.  Responses at that time
> included
> the suggestion to deprecate them and move them from NumPy to a separate
> package.  This issue is still open.
>
> Later in 2013 [6]_, it was suggested on the mailing list that these
> functions
> be removed from NumPy.
>
> The arguments for the removal of these functions from NumPy:
>
> * They are too specialized for NumPy.
> * They are not actually useful for "real world" financial calculations,
> because
>   they do not handle real dates and calendars.
> * The definition of "correctness" for some of these functions seems to be a
>   matter of convention, and the current NumPy developers do not have the
>   background to judge their correctness.
> * There has been little interest among past and present NumPy developers
>   in maintaining these functions.
>
> The main arguments for keeping the functions in NumPy are:
>
> * Removing these functions will be disruptive for some users.  Current
> users
>   will have to add the new ``numpy_financial`` package to their
> dependencies,
>   and then modify their code to use the new package.
> * The functions provided, while not "industrial strength", are apparently
>   similar to functions provided by spreadsheets and some calculators.
> Having
>   them available in NumPy makes it easier for some developers to migrate
> their
>   software to Python and NumPy.
>
> It is clear from comments in the mailing list discussions and in the GitHub
> issues that many current NumPy developers believe the benefits of removing
> the functions outweigh the costs.  For example, from [5]_::
>
> The financial functions should probably be part of a separate package
> -- Charles Harris
>
> If there's a better package we can point people to we could just
> deprecate
> them and then remove them entirely... I'd be fine with that too...
> -- Nathaniel Smith
>
> +1 to deprecate them. If no other package exists, it can be created if
> someone feels the need for that.
> -- Ralf Gommer

Re: [Numpy-discussion] NEP 32: Remove the financial functions from NumPy

2019-09-11 Thread Warren Weckesser
On 9/9/19, D.S. McNeil  wrote:
> [coming over from the pydata post]
>
> I just checked about ~150KLOC of our Python code in a financial context,
> written by about twenty developers over about four years.  Almost every
> function uses numpy, sometimes directly and sometimes via pandas.
>
> It seems like these functions were never used anywhere, and the lead dev on
> one of the projects responded "never used them; didn't even know they
> exist".  I knew they existed, but even on the rare occasion I need the
> functionality I need better control over the dates, which means for
> practical purposes I need something which supports Series natively anyhow.
>
> As it is, they also clutter up the namespace in unfriendly ways: if there's
> going to be a top-level function called np.rate I don't think this is the
> one it should be.  Admittedly that's more an argument against their current
> location.
>
> Although it wouldn't be useful for us, I could imagine someone finding a
> package which provides numpy-compatible versions of the many OpenFormula
> (or
> whatever the spec is called) functions helpful.  Having numpy carry a tiny
> subset of them doesn't feel productive.
>
> +1 for removing them.
>
>
> Doug


Thanks Doug, that's useful feedback.

Warren


>
>
>
> --
> Sent from: http://numpy-discussion.10968.n7.nabble.com/
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] NEP 32: Remove the financial functions from NumPy

2019-09-09 Thread D.S. McNeil
[coming over from the pydata post]

I just checked about ~150KLOC of our Python code in a financial context,
written by about twenty developers over about four years.  Almost every
function uses numpy, sometimes directly and sometimes via pandas. 

It seems like these functions were never used anywhere, and the lead dev on
one of the projects responded "never used them; didn't even know they
exist".  I knew they existed, but even on the rare occasion I need the
functionality I need better control over the dates, which means for
practical purposes I need something which supports Series natively anyhow.

As it is, they also clutter up the namespace in unfriendly ways: if there's
going to be a top-level function called np.rate I don't think this is the
one it should be.  Admittedly that's more an argument against their current
location.

Although it wouldn't be useful for us, I could imagine someone finding a
package which provides numpy-compatible versions of the many OpenFormula (or
whatever the spec is called) functions helpful.  Having numpy carry a tiny
subset of them doesn't feel productive.

+1 for removing them. 


Doug



--
Sent from: http://numpy-discussion.10968.n7.nabble.com/
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] NEP 32: Remove the financial functions from NumPy

2019-09-08 Thread Warren Weckesser
On 9/4/19, Matthew Brett  wrote:
> Hi,
>
> Maybe worth asking over at the Pandas list?  I bet there are more
> Python / finance people over there.


OK, I sent a message to the PyData mailing list.

Warren


>
> Cheers,
>
> Matthew
>
> On Wed, Sep 4, 2019 at 7:11 PM Ilhan Polat  wrote:
>>
>> +1 on removing them from NumPy. I think there are plenty of alternatives
>> already so many that we might even consider deprecating them just like
>> SciPy misc module by pointing to alternatives.
>>
>> On Tue, Sep 3, 2019 at 6:38 PM Sebastian Berg 
>> wrote:
>>>
>>> On Tue, 2019-09-03 at 08:56 -0400, Warren Weckesser wrote:
>>> > Github issue 2880 ("Get financial functions out of main namespace",
>>>
>>> Very briefly, I am absolutely in favor of this.
>>>
>>> Keeping the functions in numpy seems more of a liability than help
>>> anyone. And this push is more likely to help users by spurring
>>> development on a good replacement, than a practically unmaintained
>>> corner of NumPy that may seem like it solves a problem, but probably
>>> does so very poorly.
>>>
>>> Moving them into a separate pip installable package seems like the best
>>> way forward until a better replacement, to which we can point users,
>>> comes up.
>>>
>>> - Sebastian
>>>
>>>
>>> > https://github.com/numpy/numpy/issues/2880) has been open since 2013.
>>> > In a recent community meeting, it was suggested that we create a NEP
>>> > to propose the removal of the financial functions from NumPy.  I have
>>> > submitted "NEP 32:  Remove the financial functions from NumPy" in a
>>> > pull request at https://github.com/numpy/numpy/pull/14399.  A copy of
>>> > the latest version of the NEP is below.
>>> >
>>> > According to the NEP process document, "Once the PR is in place, the
>>> > NEP should be announced on the mailing list for discussion (comments
>>> > on the PR itself should be restricted to minor editorial and
>>> > technical fixes)."  This email is the announcement for NEP 32.
>>> >
>>> > The NEP includes a brief summary of the history of the financial
>>> > functions, and has links to several relevant mailing list threads,
>>> > dating back to when the functions were added to NumPy in 2008.  I
>>> > recommend reviewing those threads before commenting here.
>>> >
>>> > Warren
>>> >
>>> > -
>>> >
>>> > ==
>>> > NEP 32 — Remove the financial functions from NumPy
>>> > ==
>>> >
>>> > :Author: Warren Weckesser 
>>> > :Status: Draft
>>> > :Type: Standards Track
>>> > :Created: 2019-08-30
>>> >
>>> >
>>> > Abstract
>>> > 
>>> >
>>> > We propose deprecating and ultimately removing the financial
>>> > functions [1]_
>>> > from NumPy.  The functions will be moved to an independent
>>> > repository,
>>> > and provided to the community as a separate package with the name
>>> > ``numpy_financial``.
>>> >
>>> >
>>> > Motivation and scope
>>> > 
>>> >
>>> > The NumPy financial functions [1]_ are the 10 functions ``fv``,
>>> > ``ipmt``,
>>> > ``irr``, ``mirr``, ``nper``, ``npv``, ``pmt``, ``ppmt``, ``pv`` and
>>> > ``rate``.
>>> > The functions provide elementary financial calculations such as
>>> > future value,
>>> > net present value, etc. These functions were added to NumPy in 2008
>>> > [2]_.
>>> >
>>> > In May, 2009, a request by Joe Harrington to add a function called
>>> > ``xirr`` to
>>> > the financial functions triggered a long thread about these functions
>>> > [3]_.
>>> > One important point that came up in that thread is that a "real"
>>> > financial
>>> > library must be able to handle real dates.  The NumPy financial
>>> > functions do
>>> > not work with actual dates or calendars.  The preference for a more
>>> > capable
>>> > library independent of NumPy was expressed several times in that
>>> > thread.
>>> >
>>> > In June, 2009, D. L. Goldsmith expressed concerns about the
>>> > correctness of the
>>> > implementations of some of the financial functions [4]_.  It was
>>> > suggested then
>>> > to move the financial functions out of NumPy to an independent
>>> > package.
>>> >
>>> > In a GitHub issue in 2013 [5]_, Nathaniel Smith suggested moving the
>>> > financial
>>> > functions from the top-level namespace to ``numpy.financial``.  He
>>> > also
>>> > suggested giving the functions better names.  Responses at that time
>>> > included
>>> > the suggestion to deprecate them and move them from NumPy to a
>>> > separate
>>> > package.  This issue is still open.
>>> >
>>> > Later in 2013 [6]_, it was suggested on the mailing list that these
>>> > functions
>>> > be removed from NumPy.
>>> >
>>> > The arguments for the removal of these functions from NumPy:
>>> >
>>> > * They are too specialized for NumPy.
>>> > * They are not actually useful for "real world" financial
>>> > calculations, because
>>> >   they do not handle real dates and calendars.
>>> > * The definition of "correctness" for some of these functions seems

Re: [Numpy-discussion] NEP 32: Remove the financial functions from NumPy

2019-09-04 Thread Matthew Brett
Hi,

Maybe worth asking over at the Pandas list?  I bet there are more
Python / finance people over there.

Cheers,

Matthew

On Wed, Sep 4, 2019 at 7:11 PM Ilhan Polat  wrote:
>
> +1 on removing them from NumPy. I think there are plenty of alternatives 
> already so many that we might even consider deprecating them just like SciPy 
> misc module by pointing to alternatives.
>
> On Tue, Sep 3, 2019 at 6:38 PM Sebastian Berg  
> wrote:
>>
>> On Tue, 2019-09-03 at 08:56 -0400, Warren Weckesser wrote:
>> > Github issue 2880 ("Get financial functions out of main namespace",
>>
>> Very briefly, I am absolutely in favor of this.
>>
>> Keeping the functions in numpy seems more of a liability than help
>> anyone. And this push is more likely to help users by spurring
>> development on a good replacement, than a practically unmaintained
>> corner of NumPy that may seem like it solves a problem, but probably
>> does so very poorly.
>>
>> Moving them into a separate pip installable package seems like the best
>> way forward until a better replacement, to which we can point users,
>> comes up.
>>
>> - Sebastian
>>
>>
>> > https://github.com/numpy/numpy/issues/2880) has been open since 2013.
>> > In a recent community meeting, it was suggested that we create a NEP
>> > to propose the removal of the financial functions from NumPy.  I have
>> > submitted "NEP 32:  Remove the financial functions from NumPy" in a
>> > pull request at https://github.com/numpy/numpy/pull/14399.  A copy of
>> > the latest version of the NEP is below.
>> >
>> > According to the NEP process document, "Once the PR is in place, the
>> > NEP should be announced on the mailing list for discussion (comments
>> > on the PR itself should be restricted to minor editorial and
>> > technical fixes)."  This email is the announcement for NEP 32.
>> >
>> > The NEP includes a brief summary of the history of the financial
>> > functions, and has links to several relevant mailing list threads,
>> > dating back to when the functions were added to NumPy in 2008.  I
>> > recommend reviewing those threads before commenting here.
>> >
>> > Warren
>> >
>> > -
>> >
>> > ==
>> > NEP 32 — Remove the financial functions from NumPy
>> > ==
>> >
>> > :Author: Warren Weckesser 
>> > :Status: Draft
>> > :Type: Standards Track
>> > :Created: 2019-08-30
>> >
>> >
>> > Abstract
>> > 
>> >
>> > We propose deprecating and ultimately removing the financial
>> > functions [1]_
>> > from NumPy.  The functions will be moved to an independent
>> > repository,
>> > and provided to the community as a separate package with the name
>> > ``numpy_financial``.
>> >
>> >
>> > Motivation and scope
>> > 
>> >
>> > The NumPy financial functions [1]_ are the 10 functions ``fv``,
>> > ``ipmt``,
>> > ``irr``, ``mirr``, ``nper``, ``npv``, ``pmt``, ``ppmt``, ``pv`` and
>> > ``rate``.
>> > The functions provide elementary financial calculations such as
>> > future value,
>> > net present value, etc. These functions were added to NumPy in 2008
>> > [2]_.
>> >
>> > In May, 2009, a request by Joe Harrington to add a function called
>> > ``xirr`` to
>> > the financial functions triggered a long thread about these functions
>> > [3]_.
>> > One important point that came up in that thread is that a "real"
>> > financial
>> > library must be able to handle real dates.  The NumPy financial
>> > functions do
>> > not work with actual dates or calendars.  The preference for a more
>> > capable
>> > library independent of NumPy was expressed several times in that
>> > thread.
>> >
>> > In June, 2009, D. L. Goldsmith expressed concerns about the
>> > correctness of the
>> > implementations of some of the financial functions [4]_.  It was
>> > suggested then
>> > to move the financial functions out of NumPy to an independent
>> > package.
>> >
>> > In a GitHub issue in 2013 [5]_, Nathaniel Smith suggested moving the
>> > financial
>> > functions from the top-level namespace to ``numpy.financial``.  He
>> > also
>> > suggested giving the functions better names.  Responses at that time
>> > included
>> > the suggestion to deprecate them and move them from NumPy to a
>> > separate
>> > package.  This issue is still open.
>> >
>> > Later in 2013 [6]_, it was suggested on the mailing list that these
>> > functions
>> > be removed from NumPy.
>> >
>> > The arguments for the removal of these functions from NumPy:
>> >
>> > * They are too specialized for NumPy.
>> > * They are not actually useful for "real world" financial
>> > calculations, because
>> >   they do not handle real dates and calendars.
>> > * The definition of "correctness" for some of these functions seems
>> > to be a
>> >   matter of convention, and the current NumPy developers do not have
>> > the
>> >   background to judge their correctness.
>> > * There has been little interest among past and present NumPy
>> > developers
>>

Re: [Numpy-discussion] NEP 32: Remove the financial functions from NumPy

2019-09-04 Thread Ilhan Polat
+1 on removing them from NumPy. I think there are plenty of alternatives
already so many that we might even consider deprecating them just like
SciPy misc module by pointing to alternatives.

On Tue, Sep 3, 2019 at 6:38 PM Sebastian Berg 
wrote:

> On Tue, 2019-09-03 at 08:56 -0400, Warren Weckesser wrote:
> > Github issue 2880 ("Get financial functions out of main namespace",
>
> Very briefly, I am absolutely in favor of this.
>
> Keeping the functions in numpy seems more of a liability than help
> anyone. And this push is more likely to help users by spurring
> development on a good replacement, than a practically unmaintained
> corner of NumPy that may seem like it solves a problem, but probably
> does so very poorly.
>
> Moving them into a separate pip installable package seems like the best
> way forward until a better replacement, to which we can point users,
> comes up.
>
> - Sebastian
>
>
> > https://github.com/numpy/numpy/issues/2880) has been open since 2013.
> > In a recent community meeting, it was suggested that we create a NEP
> > to propose the removal of the financial functions from NumPy.  I have
> > submitted "NEP 32:  Remove the financial functions from NumPy" in a
> > pull request at https://github.com/numpy/numpy/pull/14399.  A copy of
> > the latest version of the NEP is below.
> >
> > According to the NEP process document, "Once the PR is in place, the
> > NEP should be announced on the mailing list for discussion (comments
> > on the PR itself should be restricted to minor editorial and
> > technical fixes)."  This email is the announcement for NEP 32.
> >
> > The NEP includes a brief summary of the history of the financial
> > functions, and has links to several relevant mailing list threads,
> > dating back to when the functions were added to NumPy in 2008.  I
> > recommend reviewing those threads before commenting here.
> >
> > Warren
> >
> > -
> >
> > ==
> > NEP 32 — Remove the financial functions from NumPy
> > ==
> >
> > :Author: Warren Weckesser 
> > :Status: Draft
> > :Type: Standards Track
> > :Created: 2019-08-30
> >
> >
> > Abstract
> > 
> >
> > We propose deprecating and ultimately removing the financial
> > functions [1]_
> > from NumPy.  The functions will be moved to an independent
> > repository,
> > and provided to the community as a separate package with the name
> > ``numpy_financial``.
> >
> >
> > Motivation and scope
> > 
> >
> > The NumPy financial functions [1]_ are the 10 functions ``fv``,
> > ``ipmt``,
> > ``irr``, ``mirr``, ``nper``, ``npv``, ``pmt``, ``ppmt``, ``pv`` and
> > ``rate``.
> > The functions provide elementary financial calculations such as
> > future value,
> > net present value, etc. These functions were added to NumPy in 2008
> > [2]_.
> >
> > In May, 2009, a request by Joe Harrington to add a function called
> > ``xirr`` to
> > the financial functions triggered a long thread about these functions
> > [3]_.
> > One important point that came up in that thread is that a "real"
> > financial
> > library must be able to handle real dates.  The NumPy financial
> > functions do
> > not work with actual dates or calendars.  The preference for a more
> > capable
> > library independent of NumPy was expressed several times in that
> > thread.
> >
> > In June, 2009, D. L. Goldsmith expressed concerns about the
> > correctness of the
> > implementations of some of the financial functions [4]_.  It was
> > suggested then
> > to move the financial functions out of NumPy to an independent
> > package.
> >
> > In a GitHub issue in 2013 [5]_, Nathaniel Smith suggested moving the
> > financial
> > functions from the top-level namespace to ``numpy.financial``.  He
> > also
> > suggested giving the functions better names.  Responses at that time
> > included
> > the suggestion to deprecate them and move them from NumPy to a
> > separate
> > package.  This issue is still open.
> >
> > Later in 2013 [6]_, it was suggested on the mailing list that these
> > functions
> > be removed from NumPy.
> >
> > The arguments for the removal of these functions from NumPy:
> >
> > * They are too specialized for NumPy.
> > * They are not actually useful for "real world" financial
> > calculations, because
> >   they do not handle real dates and calendars.
> > * The definition of "correctness" for some of these functions seems
> > to be a
> >   matter of convention, and the current NumPy developers do not have
> > the
> >   background to judge their correctness.
> > * There has been little interest among past and present NumPy
> > developers
> >   in maintaining these functions.
> >
> > The main arguments for keeping the functions in NumPy are:
> >
> > * Removing these functions will be disruptive for some users.
> > Current users
> >   will have to add the new ``numpy_financial`` package to their
> > dependencies,
> >   and then modify their code to u

Re: [Numpy-discussion] NEP 32: Remove the financial functions from NumPy

2019-09-04 Thread Martin.Gfeller
Dear all


As a user of Numpy in finance, I'm absolutely in favour of removing these 
functions.

They're too domain-specific, not flexible and general enough for widespread 
use, and probably

not easy to maintain.


Best regards

Martin

___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] NEP 32: Remove the financial functions from NumPy

2019-09-03 Thread Sebastian Berg
On Tue, 2019-09-03 at 08:56 -0400, Warren Weckesser wrote:
> Github issue 2880 ("Get financial functions out of main namespace", 

Very briefly, I am absolutely in favor of this.

Keeping the functions in numpy seems more of a liability than help
anyone. And this push is more likely to help users by spurring
development on a good replacement, than a practically unmaintained
corner of NumPy that may seem like it solves a problem, but probably
does so very poorly.

Moving them into a separate pip installable package seems like the best
way forward until a better replacement, to which we can point users,
comes up.

- Sebastian


> https://github.com/numpy/numpy/issues/2880) has been open since 2013.
> In a recent community meeting, it was suggested that we create a NEP
> to propose the removal of the financial functions from NumPy.  I have
> submitted "NEP 32:  Remove the financial functions from NumPy" in a
> pull request at https://github.com/numpy/numpy/pull/14399.  A copy of
> the latest version of the NEP is below.
> 
> According to the NEP process document, "Once the PR is in place, the
> NEP should be announced on the mailing list for discussion (comments
> on the PR itself should be restricted to minor editorial and
> technical fixes)."  This email is the announcement for NEP 32.
> 
> The NEP includes a brief summary of the history of the financial
> functions, and has links to several relevant mailing list threads,
> dating back to when the functions were added to NumPy in 2008.  I
> recommend reviewing those threads before commenting here.
> 
> Warren
> 
> -
> 
> ==
> NEP 32 — Remove the financial functions from NumPy
> ==
> 
> :Author: Warren Weckesser 
> :Status: Draft
> :Type: Standards Track
> :Created: 2019-08-30
> 
> 
> Abstract
> 
> 
> We propose deprecating and ultimately removing the financial
> functions [1]_
> from NumPy.  The functions will be moved to an independent
> repository,
> and provided to the community as a separate package with the name
> ``numpy_financial``.
> 
> 
> Motivation and scope
> 
> 
> The NumPy financial functions [1]_ are the 10 functions ``fv``,
> ``ipmt``,
> ``irr``, ``mirr``, ``nper``, ``npv``, ``pmt``, ``ppmt``, ``pv`` and
> ``rate``.
> The functions provide elementary financial calculations such as
> future value,
> net present value, etc. These functions were added to NumPy in 2008
> [2]_.
> 
> In May, 2009, a request by Joe Harrington to add a function called
> ``xirr`` to
> the financial functions triggered a long thread about these functions
> [3]_.
> One important point that came up in that thread is that a "real"
> financial
> library must be able to handle real dates.  The NumPy financial
> functions do
> not work with actual dates or calendars.  The preference for a more
> capable
> library independent of NumPy was expressed several times in that
> thread.
> 
> In June, 2009, D. L. Goldsmith expressed concerns about the
> correctness of the
> implementations of some of the financial functions [4]_.  It was
> suggested then
> to move the financial functions out of NumPy to an independent
> package.
> 
> In a GitHub issue in 2013 [5]_, Nathaniel Smith suggested moving the
> financial
> functions from the top-level namespace to ``numpy.financial``.  He
> also
> suggested giving the functions better names.  Responses at that time
> included
> the suggestion to deprecate them and move them from NumPy to a
> separate
> package.  This issue is still open.
> 
> Later in 2013 [6]_, it was suggested on the mailing list that these
> functions
> be removed from NumPy.
> 
> The arguments for the removal of these functions from NumPy:
> 
> * They are too specialized for NumPy.
> * They are not actually useful for "real world" financial
> calculations, because
>   they do not handle real dates and calendars.
> * The definition of "correctness" for some of these functions seems
> to be a
>   matter of convention, and the current NumPy developers do not have
> the
>   background to judge their correctness.
> * There has been little interest among past and present NumPy
> developers
>   in maintaining these functions.
> 
> The main arguments for keeping the functions in NumPy are:
> 
> * Removing these functions will be disruptive for some users. 
> Current users
>   will have to add the new ``numpy_financial`` package to their
> dependencies,
>   and then modify their code to use the new package.
> * The functions provided, while not "industrial strength", are
> apparently
>   similar to functions provided by spreadsheets and some
> calculators.  Having
>   them available in NumPy makes it easier for some developers to
> migrate their
>   software to Python and NumPy.
> 
> It is clear from comments in the mailing list discussions and in the
> GitHub
> issues that many current NumPy developers believe the benefits of
> removing
> the functions 

[Numpy-discussion] NEP 32: Remove the financial functions from NumPy

2019-09-03 Thread Warren Weckesser
Github issue 2880 ("Get financial functions out of main namespace",
https://github.com/numpy/numpy/issues/2880) has been open since 2013. In a
recent community meeting, it was suggested that we create a NEP to propose
the removal of the financial functions from NumPy.  I have submitted "NEP
32:  Remove the financial functions from NumPy" in a pull request at
https://github.com/numpy/numpy/pull/14399.  A copy of the latest version of
the NEP is below.

According to the NEP process document, "Once the PR is in place, the NEP
should be announced on the mailing list for discussion (comments on the PR
itself should be restricted to minor editorial and technical fixes)."  This
email is the announcement for NEP 32.

The NEP includes a brief summary of the history of the financial functions,
and has links to several relevant mailing list threads, dating back to when
the functions were added to NumPy in 2008.  I recommend reviewing those
threads before commenting here.

Warren

-

==
NEP 32 — Remove the financial functions from NumPy
==

:Author: Warren Weckesser 
:Status: Draft
:Type: Standards Track
:Created: 2019-08-30


Abstract


We propose deprecating and ultimately removing the financial functions [1]_
from NumPy.  The functions will be moved to an independent repository,
and provided to the community as a separate package with the name
``numpy_financial``.


Motivation and scope


The NumPy financial functions [1]_ are the 10 functions ``fv``, ``ipmt``,
``irr``, ``mirr``, ``nper``, ``npv``, ``pmt``, ``ppmt``, ``pv`` and
``rate``.
The functions provide elementary financial calculations such as future
value,
net present value, etc. These functions were added to NumPy in 2008 [2]_.

In May, 2009, a request by Joe Harrington to add a function called ``xirr``
to
the financial functions triggered a long thread about these functions [3]_.
One important point that came up in that thread is that a "real" financial
library must be able to handle real dates.  The NumPy financial functions do
not work with actual dates or calendars.  The preference for a more capable
library independent of NumPy was expressed several times in that thread.

In June, 2009, D. L. Goldsmith expressed concerns about the correctness of
the
implementations of some of the financial functions [4]_.  It was suggested
then
to move the financial functions out of NumPy to an independent package.

In a GitHub issue in 2013 [5]_, Nathaniel Smith suggested moving the
financial
functions from the top-level namespace to ``numpy.financial``.  He also
suggested giving the functions better names.  Responses at that time
included
the suggestion to deprecate them and move them from NumPy to a separate
package.  This issue is still open.

Later in 2013 [6]_, it was suggested on the mailing list that these
functions
be removed from NumPy.

The arguments for the removal of these functions from NumPy:

* They are too specialized for NumPy.
* They are not actually useful for "real world" financial calculations,
because
  they do not handle real dates and calendars.
* The definition of "correctness" for some of these functions seems to be a
  matter of convention, and the current NumPy developers do not have the
  background to judge their correctness.
* There has been little interest among past and present NumPy developers
  in maintaining these functions.

The main arguments for keeping the functions in NumPy are:

* Removing these functions will be disruptive for some users.  Current users
  will have to add the new ``numpy_financial`` package to their
dependencies,
  and then modify their code to use the new package.
* The functions provided, while not "industrial strength", are apparently
  similar to functions provided by spreadsheets and some calculators.
Having
  them available in NumPy makes it easier for some developers to migrate
their
  software to Python and NumPy.

It is clear from comments in the mailing list discussions and in the GitHub
issues that many current NumPy developers believe the benefits of removing
the functions outweigh the costs.  For example, from [5]_::

The financial functions should probably be part of a separate package
-- Charles Harris

If there's a better package we can point people to we could just
deprecate
them and then remove them entirely... I'd be fine with that too...
-- Nathaniel Smith

+1 to deprecate them. If no other package exists, it can be created if
someone feels the need for that.
-- Ralf Gommers

I feel pretty strongly that we should deprecate these. If nobody on
numpy’s
core team is interested in maintaining them, then it is purely a drag on
development for NumPy.
-- Stephan Hoyer

And from the 2013 mailing list discussion, about removing the functions from
NumPy::

I am +1 as well, I don't think they should have been included in t