[Numpy-discussion] set_local_path in test files

2008-07-02 Thread Alan McIntyre
Some test files have a set_local_path()/restore_path() pair at the
top, and some don't.  Is there any reason to be changing sys.path like
this in the test modules?  If not, I'll take them out when I see them.

Thanks,
Alan
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Pearu Peterson

Alan McIntyre wrote:
 Some test files have a set_local_path()/restore_path() pair at the
 top, and some don't.  Is there any reason to be changing sys.path like
 this in the test modules?  If not, I'll take them out when I see them.

The idea behind set_local_path is that it allows running tests
inside subpackages without the need to rebuild the entire package.
set_local_path()/restore_path() are convenient when debugging or
developing a subpackage.
If you are sure that there are no bugs in numpy subpackges
that need such debugging process, then the set_local_path()
restore_path() calls can be removed. (But please do not
remove them from scipy tests files, rebuilding scipy just
takes too much time and debugging subpackages globally would
be too painful).

Pearu



___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Alan McIntyre
On Wed, Jul 2, 2008 at 9:35 AM, Pearu Peterson [EMAIL PROTECTED] wrote:
 Alan McIntyre wrote:
 Some test files have a set_local_path()/restore_path() pair at the
 top, and some don't.  Is there any reason to be changing sys.path like
 this in the test modules?  If not, I'll take them out when I see them.

 The idea behind set_local_path is that it allows running tests
 inside subpackages without the need to rebuild the entire package.

Ah, thanks; I'd forgotten about that.  I'll leave them alone, then.  I
made a note for myself to make sure it's possible to run tests locally
without doing a full build/install (where practical).
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Matthew Brett
Hi,

 The idea behind set_local_path is that it allows running tests
 inside subpackages without the need to rebuild the entire package.

 Ah, thanks; I'd forgotten about that.  I'll leave them alone, then.  I
 made a note for myself to make sure it's possible to run tests locally
 without doing a full build/install (where practical).

I noticed that people were often putting this at the top of scipy test
files as boilerplate when they didn't in fact need the local directory
on the path.  I did it myself when I first started using the Numpy
test rig.  So, to avoid that happening, it would be good to remove all
the cases where it is not necessary...

Best,

Matthew
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Robert Kern
On Wed, Jul 2, 2008 at 09:01, Alan McIntyre [EMAIL PROTECTED] wrote:
 On Wed, Jul 2, 2008 at 9:35 AM, Pearu Peterson [EMAIL PROTECTED] wrote:
 Alan McIntyre wrote:
 Some test files have a set_local_path()/restore_path() pair at the
 top, and some don't.  Is there any reason to be changing sys.path like
 this in the test modules?  If not, I'll take them out when I see them.

 The idea behind set_local_path is that it allows running tests
 inside subpackages without the need to rebuild the entire package.

 Ah, thanks; I'd forgotten about that.  I'll leave them alone, then.  I
 made a note for myself to make sure it's possible to run tests locally
 without doing a full build/install (where practical).

Please remove them and adjust the imports. As I've mentioned before,
numpy and scipy can now reliably be built in-place with python
setup.py build_src --inplace build_ext --inplace. This is a more
robust method to test uninstalled code than adjusting sys.path.

-- 
Robert Kern

I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth.
 -- Umberto Eco
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Pearu Peterson
On Wed, July 2, 2008 8:25 pm, Robert Kern wrote:
 On Wed, Jul 2, 2008 at 09:01, Alan McIntyre [EMAIL PROTECTED]
 wrote:
 On Wed, Jul 2, 2008 at 9:35 AM, Pearu Peterson [EMAIL PROTECTED]
 wrote:
 Alan McIntyre wrote:
 Some test files have a set_local_path()/restore_path() pair at the
 top, and some don't.  Is there any reason to be changing sys.path like
 this in the test modules?  If not, I'll take them out when I see them.

 The idea behind set_local_path is that it allows running tests
 inside subpackages without the need to rebuild the entire package.

 Ah, thanks; I'd forgotten about that.  I'll leave them alone, then.  I
 made a note for myself to make sure it's possible to run tests locally
 without doing a full build/install (where practical).

 Please remove them and adjust the imports. As I've mentioned before,
 numpy and scipy can now reliably be built in-place with python
 setup.py build_src --inplace build_ext --inplace. This is a more
 robust method to test uninstalled code than adjusting sys.path.

Note that the point of set_local_path is not to test uninstalled
code but to test only a subpackage. For example,

  cd svn/scipy/scipy/fftpack
  python setup.py build
  python tests/test_basic.py

would run the tests using the extensions from the build directory.
Well, at least it used to do that in past but it seems that the
feature has been removed from scipy svn:(

Scipy subpackages used to be usable as standalone packages
(even not requiring scipy itself) but this seems to be changed.
This is not good from from the refactoring point of view.

Pearu

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Robert Kern
On Wed, Jul 2, 2008 at 13:58, Pearu Peterson [EMAIL PROTECTED] wrote:
 On Wed, July 2, 2008 8:25 pm, Robert Kern wrote:
 On Wed, Jul 2, 2008 at 09:01, Alan McIntyre [EMAIL PROTECTED]
 wrote:
 On Wed, Jul 2, 2008 at 9:35 AM, Pearu Peterson [EMAIL PROTECTED]
 wrote:
 Alan McIntyre wrote:
 Some test files have a set_local_path()/restore_path() pair at the
 top, and some don't.  Is there any reason to be changing sys.path like
 this in the test modules?  If not, I'll take them out when I see them.

 The idea behind set_local_path is that it allows running tests
 inside subpackages without the need to rebuild the entire package.

 Ah, thanks; I'd forgotten about that.  I'll leave them alone, then.  I
 made a note for myself to make sure it's possible to run tests locally
 without doing a full build/install (where practical).

 Please remove them and adjust the imports. As I've mentioned before,
 numpy and scipy can now reliably be built in-place with python
 setup.py build_src --inplace build_ext --inplace. This is a more
 robust method to test uninstalled code than adjusting sys.path.

 Note that the point of set_local_path is not to test uninstalled
 code but to test only a subpackage.

And nose does that just fine by itself.

-- 
Robert Kern

I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth.
  -- Umberto Eco
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Alan McIntyre
On Wed, Jul 2, 2008 at 1:25 PM, Robert Kern [EMAIL PROTECTED] wrote:
 Please remove them and adjust the imports. As I've mentioned before,
 numpy and scipy can now reliably be built in-place with python
 setup.py build_src --inplace build_ext --inplace. This is a more
 robust method to test uninstalled code than adjusting sys.path.

Ok.  Since set_package_path is also just used for adjusting sys.path,
should that go away as well?  If so, I'll remove set_package_path,
set_local_path, and restore_path from numpy/testing/numpytest.py, and
of course remove all their uses.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Robert Kern
On Wed, Jul 2, 2008 at 14:34, Alan McIntyre [EMAIL PROTECTED] wrote:
 On Wed, Jul 2, 2008 at 1:25 PM, Robert Kern [EMAIL PROTECTED] wrote:
 Please remove them and adjust the imports. As I've mentioned before,
 numpy and scipy can now reliably be built in-place with python
 setup.py build_src --inplace build_ext --inplace. This is a more
 robust method to test uninstalled code than adjusting sys.path.

 Ok.  Since set_package_path is also just used for adjusting sys.path,
 should that go away as well?  If so, I'll remove set_package_path,
 set_local_path, and restore_path from numpy/testing/numpytest.py, and
 of course remove all their uses.

Please deprecate the functions for 1.2 and schedule them for removal in 1.3.

-- 
Robert Kern

I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth.
 -- Umberto Eco
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Stéfan van der Walt
2008/7/2 Robert Kern [EMAIL PROTECTED]:
 On Wed, Jul 2, 2008 at 14:34, Alan McIntyre [EMAIL PROTECTED] wrote:
 On Wed, Jul 2, 2008 at 1:25 PM, Robert Kern [EMAIL PROTECTED] wrote:
 Please remove them and adjust the imports. As I've mentioned before,
 numpy and scipy can now reliably be built in-place with python
 setup.py build_src --inplace build_ext --inplace. This is a more
 robust method to test uninstalled code than adjusting sys.path.

 Ok.  Since set_package_path is also just used for adjusting sys.path,
 should that go away as well?  If so, I'll remove set_package_path,
 set_local_path, and restore_path from numpy/testing/numpytest.py, and
 of course remove all their uses.

 Please deprecate the functions for 1.2 and schedule them for removal in 1.3.

I'm really glad these are disappearing -- they were never working
properly for arbitrarily deeply nested modules.

Regards
Stéfan
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion