fmilthaler / FinQuant

A program for financial portfolio management, analysis and optimisation.
MIT License
1.38k stars 190 forks source link

Fixes #74. The sum() method returns an instance of numpy.int64 if the… #78

Closed PietropaoloFrisoni closed 1 year ago

PietropaoloFrisoni commented 1 year ago

… allocation only contains integers.

An instance of numpy.int64 is not recognized as an instance of int, as they are two different classes.

This causes the error message since the total investment is not recognized as an integer.

Curious: trying with allocations equal to 20^(200), the returned number is an instance of "int" instead of "numpy.int64"

I added np.integer and np.floating to the checks

fmilthaler commented 1 year ago

Great, thanks for the fix! :)