On Mon, Jun 28, 2010 at 7:19 PM, Kenneth Arnold <kenneth.arnold@gmail.com> wrote:
On Mon, Jun 28, 2010 at 4:40 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,

> I propose moving the scipy/io/matlab directory to scipy/io/matfile and have
> the __init__.py file for scipy.io to import scipy.io.matfile as matlab.  I
> don't know if that works for all of the ways one would call that module.
> Also, is there any sort of way to make a deprecation warning fire for
> importing scipy.io.matlab, but not for scipy.io.matfile?  I never had to do
> any sort of fancy module setup, so I am not sure what is best.

I think that won't work
for people who have done things like

import scipy.io.matlab

or

from scipy.io.matlab import loadmat

and I'm not sure what would, apart from a symbolic link - but then I
don't know how you'd raise the deprecation warning.

You could put the following in scipy/io/matlab.py:

import warnings
warnings.warn(...)
from scipy.io.matfile import *

-Ken



Ok, I think that would work very nicely for those who directly import scipy.io.matlab.  Something else will have to be done for the __init__.py file for scipy.io.  If currently imports from "matlab.mio" and "matlab.byteordercodes".  Also, it makes available a "matlab" namespace somehow when you import scipy.io.

(Note that there is currently a "matlab" directory in scipy/io directory with its own __init__.py and other parts to do file reading and writing.)

How does that fit in with everything?

Ben Root
 
_______________________________________________
SciPy-User mailing list
SciPy-User@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user