techjollof / scitools

Automatically exported from code.google.com/p/scitools
Other
0 stars 0 forks source link

Call to compute_histogram returns 'new=True' error #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Install of Python2.6, NumPy 1.5.1 Win32SuperPack,SciPy0.8.0,SciTools 0.7 on 
Win7 64.  Fresh intall of all Python components today.

2.  Call to 
3.

What is the expected output? What do you see instead?
I expected to see a histogram (e.g. Langtangen et. al. 'Primer' p. 421).
Instead I get an error message:
>>> x,y = compute_histogram(tempList,nbins=20)
Traceback (most recent call last):
  File "U:\04_Programming\ShastaXS\objXS_V1.py", line 1, in <module>
    import csv, subprocess, sys, os, os.path
  File "c:\Python26\Lib\site-packages\scitools\numpyutils.py", line 1078, in compute_histogram
    y0, bin_edges = histogram(samples, bins=nbins, normed=True, new=True)
TypeError: histogram() got an unexpected keyword argument 'new'

A quick google search shows that this type of error has to do with a mismatch 
of NumPy and other componenents.  The 'new' argument is an addition to the 
call. 

Looking at the SciTools installing page, I believe I have the correct 
dependancies matched.

What version of the product are you using? On what operating system?
see above

Please provide any additional information below.
grateful for assistance!

Original issue reported on code.google.com by vandyke....@gmail.com on 13 Dec 2010 at 11:23

GoogleCodeExporter commented 9 years ago
Thanks for your report. The problem is that the function 'numpy.histogram' in 
NumPy >= 1.4 no longer supports the 'new' keyword argument. This is now fixed 
in the SciTools development repository. You can either install SciTools again 
from the development repository or remove the 'new' keyword in line 1078 in the 
file c:\Python26\Lib\site-packages\scitools\numpyutils.py, that is, change this 
line

  y0, bin_edges = histogram(samples, bins=nbins, normed=True, new=True)

into this

  y0, bin_edges = histogram(samples, bins=nbins, normed=True)

Original comment by johannes...@gmail.com on 14 Dec 2010 at 9:51