Closed joel-becker closed 1 year ago
not usually a python user, so maybe it is standard practice to account for integers and numpy integers separately? raising as issue in case not.
hopefully the below example is clear:
>>> distribution <Distribution> lognorm(mean=-1.26, sd=1.61) >>> n 9 >>> distribution @ 9 array([0.0225612 , 0.46752896, 2.20596081, 0.04523069, 0.12903551, 0.01490158, 2.06714022, 1.97190706, 0.1854637 ]) >>> distribution @ n Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/joel/Library/Python/3.9/lib/python/site-packages/squigglepy/distributions.py", line 57, in __matmul__ raise ValueError ValueError >>> type(n) <class 'numpy.int64'> >>> type(9) <class 'int'> >>> n = int(n) >>> distribution @ n array([0.76783902, 0.07521819, 0.35157636, 0.06835797, 0.01786806, 1.28000189, 2.06632018, 1.06315067, 0.24975447])
the error stems from this line in squigglepy/distributions.py.
squigglepy/distributions.py
Thanks. I recognize this as a bug and will commit to fixing it in the next version.
@joel-becker Now live on pip in v0.24!
not usually a python user, so maybe it is standard practice to account for integers and numpy integers separately? raising as issue in case not.
hopefully the below example is clear:
the error stems from this line in
squigglepy/distributions.py
.