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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel