Comments (3)
@garfieldthecat I'm sorry that no one has taken the time to look at this. I've started doing some maintenance work on numpy-financial and have also noticed the speed to be an issue for some functions. At a glance, Numba seems to be a good fit here.
I'm currently in the process of adding asv benchmarks, once that's done would you still be interested in contributing?
from numpy-financial.
Sure, do let me know. A couple of comments:
-
part of the reason why all the functions are very slow seems to be the fact that they are set up to accept both scalars and arrays as inputs. I have coded my own functions which accept only scalars and they're so much faster
-
Numba is not even at version 1. I am not sure everyone can/wants to install it. By all means, do considera a numba implementation, but maybe as an option? If you make your functions rely on numba only it might be tricky
from numpy-financial.
- part of the reason why all the functions are very slow seems to be the fact that they are set up to accept both scalars and arrays as inputs. I have coded my own functions which accept only scalars and they're so much faster
The functions have been set up to act similarly to numpy ufuncs. I believe this can now be achieved using np.vectorize or np.fromfunc. Perhaps these are an avenue worth exploring?
There are more considerations, off the top of my head, this includes:
- Do they handle masked arrays
- Handling
when
(this could be expensive if vectorized) - Handling
Decimal
datatype
- Numba is not even at version 1. I am not sure everyone can/wants to install it. By all means, do considera a numba implementation, but maybe as an option? If you make your functions rely on numba only it might be tricky
Good point. Numba was suggested to me by another NumPy developer and it's been sitting in the back of my mind while I've been working. Either way I'd prefer to have some full benchmarks before anything changes in the name of performance.
from numpy-financial.
Related Issues (20)
- BUG: ipmt not working with numpy==1.26.4 when using a pandas df as input. HOT 2
- MAINT: Avoid ``ZeroDivisionError``s in ``nper_inner_loop``
- BUG: Benchmarking does not work with spin
- BUG: rate returning incorrect value HOT 2
- AttributeError: partially initialized module 'numpy_financial' has no attribute 'ipmt' (most likely due to a circular import) HOT 3
- We currently test against old versions of Python HOT 1
- We need more thorough test coverage HOT 5
- API: Move business days functions to `numpy-financial` HOT 2
- TST: Replace `assert_almost_equal` checks with `assert_allclose` in test suite HOT 3
- BENCH: Add air speed velocity as a benchmarking suite
- TST: Parameterise tests where needed
- TST/CI: Automatically test documentation when it is built HOT 1
- DOC: NumPy-Financial should have a documented style guide
- DOC: MIRR documentation is lacking HOT 3
- DOC: Documentation should be available for different versions
- DOC: Document how to run the benchmarking suite
- DOC: Convert developer docs from Markdown to restructured text HOT 1
- DOC: How to install docs dependencies and build documentation with poetry HOT 1
- DOC: Test examples in doctstrings fail HOT 2
- BUG: There may exist multplit roots in the solution of IRR function HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from numpy-financial.