rnelsonchem / pHcalc

Systematic pH calculation package for Python
35 stars 9 forks source link

DeprecationWarning - NumPy 2.0 uses cumprod instead of cumproduct #14

Open Eheran1 opened 1 week ago

Eheran1 commented 1 week ago
DeprecationWarning: `cumproduct` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `cumprod` instead.
  fracs = phos.alpha(phs)

Should be Was an easy fix to simply replace the function. Since NumPy is already version >2 this will mean it does not run for any newer installations.

As a side note, you can use this code for the legend in the plot of the H3PO4 dissociation for proper formatting, as matplotlib supports latex: plt.legend(['$H_3PO_4$', '${H_2PO_4}^{1-}$', '${HPO_4}^{2-}$', '${PO_4}^{3-}$'])