Ted Drain wrote:
> Does this proposal change the way people access this 
> functionality?  We have a lot of scripts (and a lot of users with 
> scripts) that use basemap and it tends to be extremely annoying to 
> people when their scripts suddenly break.
>
> Ted
>   

Ted:  Unfortunately it would break scripts, but only the initial import.

Instead of

from matplotlib.toolkits.basemap import Basemap

you would do

from mpl_toolkits.basemap.api import Basemap

Everything else would be the same.  

-Jeff
> At 03:34 PM 1/9/2008, Andrew Straw wrote:
>   
>> As the author of the only other known MPL toolkit (at least in the MPL
>> tree), I'm happy with the idea of using a namespace package for
>> mpl_toolkits. I understand your proposal to mean that each toolkit would
>> have a directory structure:
>>
>> setup.py
>> lib/
>>      mpl_toolkits/
>>                           __init__.py (empty)
>>                           basemap/
>>                                           __init__.py
>>                                           other_files.py
>>
>> This is OK with me, but I question is whether it's necessary to have the
>> "lib" directory -- it seems entirely redundant. I'm fine with either
>> way, though.
>>
>> -Andrew
>>
>> Jeff Whitaker wrote:
>>     
>>> Now that the transforms branch has merged with the trunk, I'd like to
>>> resurrect namespace packages so that toolkits will work again when
>>> matplotlib is installed as an egg.  As was discussed in a previous
>>> thread, all __init__.py files in the toolkit hierarchy must be empty
>>> (aside declare_namespace statement).  Since lib/matplotlib/__init__.py
>>> contains a lot of important stuff, I think the path of least resistance
>>> is to move the toolkits out of lib/matplotlib and into a separate
>>> directory lib/mpl_toolkits.  The semantics of importing a toolkit would
>>> have to change from
>>>
>>> import matplotlib.toolkits.toolkit
>>>
>>> to
>>>
>>> import mpl_toolkit.toolkit.
>>>
>>> Of course, all the toolkit __init__.py files would need to be emptied.
>>> In the case of basemap, this would be changing imports from
>>>
>>> from matplotlib.toolkits.basemap import Basemap
>>>
>>> to something like
>>>
>>> from mpl_toolkits.basemap.api import Basemap
>>>
>>> All the stuff now imported directly into __init__.py would go in api.py.
>>>
>>> I've tried this in my local tree and it seems to work fine.  Does this
>>> sound reasonable?  If there's general agreement, I can make the
>>> necessary mods in matplotlib trunk and the mplsizer and basemap toolkits.
>>>
>>> -Jeff
>>>
>>>
>>>       
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Matplotlib-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>     
>
> Ted Drain     Jet Propulsion Laboratory   [EMAIL PROTECTED]    
>
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>   


-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : [EMAIL PROTECTED]
325 Broadway                Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to