Collection of fixes - #1528, #1385 and warnings #194

Merged
merged 10 commits into from Apr 27, 2012

2 participants

@rgommers
SciPy member

Fixes:

  • all ResourceWarnings under Python 3.2 (#1528)
  • some build warnings that are a problem with the OpenSuse build service (#1358)
  • filters all visible warnings when running tests
  • fixes up existing warning filters with usage of WarningManager
  • some cleanups in cluster.vq test file

This should all be fairly straightforward. Please pay attention to the two one-liner Fortran fixes for #1358; they look reasonable but I don't speak much Fortran.

@rgommers
SciPy member

Add two more py3k bug fixes while we're at it.

@rgommers
SciPy member

OK, one more trivial one. Tickets to close: 1385, 1528, 1576, 1632.

@pv pv and 1 other commented on an outdated diff Apr 25, 2012
scipy/cluster/tests/test_hierarchy.py
@@ -101,9 +101,9 @@ def load_testing_files():
for fn in _filenames:
name = fn.replace(".txt", "").replace("-ml", "")
fqfn = os.path.join(os.path.dirname(__file__), fn)
- eo[name] = np.loadtxt(open(fqfn))
- #print "%s: %s %s" % (name, str(eo[name].shape), str(eo[name].dtype))
- #eo['pdist-boolean-inp'] = np.bool_(eo['pdist-boolean-inp'])
+ fp = open(fqfn)
+ eo[name] = np.loadtxt(fp)
@pv
SciPy member
pv added a note Apr 25, 2012

Maybe np.loadtxt(fqfn)?

@rgommers
SciPy member

Yes, much better. Will change, also for test_vq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pv pv commented on an outdated diff Apr 25, 2012
scipy/cluster/tests/test_vq.py
@@ -146,7 +148,9 @@ def test_kmeans2_simple(self):
def test_kmeans2_rank1(self):
"""Testing simple call to kmeans2 with rank 1 data."""
- data = np.fromfile(open(DATAFILE1), sep = ", ")
+ fp = open(DATAFILE1)
+ data = np.fromfile(fp, sep = ", ")
@pv
SciPy member
pv added a note Apr 25, 2012

np.fromfile(DATAFILE1)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pv pv commented on an outdated diff Apr 25, 2012
scipy/cluster/tests/test_vq.py
@@ -158,7 +162,9 @@ def test_kmeans2_rank1(self):
def test_kmeans2_rank1_2(self):
"""Testing simple call to kmeans2 with rank 1 data."""
- data = np.fromfile(open(DATAFILE1), sep = ", ")
+ fp = open(DATAFILE1)
+ data = np.fromfile(fp, sep = ", ")
@pv
SciPy member
pv added a note Apr 25, 2012

Ditto, and so on below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pv pv commented on the diff Apr 25, 2012
scipy/integrate/dop/dop853.f
@@ -867,6 +867,7 @@ FUNCTION CONTD8(II,X,CON,ICOMP,ND)
5 CONTINUE
IF (I.EQ.0) THEN
WRITE (6,*) ' NO DENSE OUTPUT AVAILABLE FOR COMP.',II
+ CONTD8=-1
@pv
SciPy member
pv added a note Apr 25, 2012

These changes are OK. I think these routines aren't used, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pv pv commented on the diff Apr 25, 2012
scipy/integrate/dop/dopri5.f
@@ -634,6 +634,7 @@ FUNCTION CONTD5(II,X,CON,ICOMP,ND)
5 CONTINUE
IF (I.EQ.0) THEN
WRITE (6,*) ' NO DENSE OUTPUT AVAILABLE FOR COMP.',II
+ CONTD5=-1
@pv
SciPy member
pv added a note Apr 25, 2012

Similarly OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pv pv commented on the diff Apr 25, 2012
scipy/integrate/multipack.h
@@ -175,7 +175,7 @@ static PyObject *call_python_function(PyObject *func, npy_intp n, double *x, PyO
*/
if ((result = PyEval_CallObject(func, arglist))==NULL) {
PyErr_Print();
- tmpobj = PyObject_GetAttrString(func, "func_name");
+ tmpobj = PyObject_GetAttrString(func, "__name__");
@pv
SciPy member
pv added a note Apr 25, 2012

OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pv pv commented on the diff Apr 25, 2012
scipy/signal/filter_design.py
@@ -1708,4 +1708,3 @@ def besselap(N):
'h': 'highpass'
}
-warnings.simplefilter("always", BadCoefficients)
@pv
SciPy member
pv added a note Apr 25, 2012

Ok, this seems like just a left-over debugging aid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pv
SciPy member
pv commented Apr 25, 2012

These changes seem correct to me.

@rgommers rgommers merged commit 75409c2 into scipy:master Apr 27, 2012
@rgommers
SciPy member

Thanks for checking Pauli. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment