From: <jd...@us...> - 2007-07-19 03:16:55
|
Revision: 3571 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3571&view=rev Author: jdh2358 Date: 2007-07-18 20:16:53 -0700 (Wed, 18 Jul 2007) Log Message: ----------- minor revisions to design goals Modified Paths: -------------- trunk/matplotlib/mpl1/DESIGN_GOALS Modified: trunk/matplotlib/mpl1/DESIGN_GOALS =================================================================== --- trunk/matplotlib/mpl1/DESIGN_GOALS 2007-07-19 03:00:21 UTC (rev 3570) +++ trunk/matplotlib/mpl1/DESIGN_GOALS 2007-07-19 03:16:53 UTC (rev 3571) @@ -2,56 +2,65 @@ and all of this is open to discussion. What I present below is pretty ambitious, so if there is support, we will need significant contributions from several developers for several months. Ideally, we -would get a good sketch working, and then organize a spint (4 days?) +would get a good sketch working, and then organize a spint (3-4 days?) for late August, where we try get as far as possible to making this viable. -= data copying = += Data copying = -Push the data to the backend only once, or only when required. update -the transforms to the backend, but do not push transformed data on +Push the data to the backend only once, or only when required. Update +the transforms in the backend, but do not push transformed data on every draw. This is potentially a major win, because we currently -move the data around on every draw +move the data around on every draw. Eg see how mpl1.py handles pusing +the paths when the renderer is set (Figure.set_renderer) but on draw +commands (Figure.draw) only pushes the current affine. += Transformations = -= transformations = - Support a normal transformation architecture. The current draft -implmentation assumes one nonlinear transformation, which happens at a -high layer, and all transformations after that are affines. Currently -there are three affines: the transformation from view limits -> axes -units, the transformation from axes units to normalized figure untis, -and the transformation from normalized figure units to display +implementation assumes one nonlinear transformation, which happens at +a high layer, and all transformations after that are affines. In the +mpl1 draft, there are three affines: the transformation from view +limits -> axes units (AxesCoords.affineview), the transformation from +axes units to normalized figure units (AxesCoords.affineaxes), and the +transformation from normalized figure units to display +(Renderer.affine) Do we want to use 3x3 or 4x4 to leave the door open for 3D developers? -= objects that talk to the backend "primitives" = += Objects that talk to the backend "primitives" = Have just a few, fairly rich obects, that the backends need to understand. Clear candidates are a Path, Text and Image, but despite -some similar names, don't confuse these with the current matplotlib -Artists by the same name, which are considerably higher level than -what I'm thinking of here. Each of these will carry their metadata, -eg a path will carry its stroke color, facecolor, linewidth, etc.. -Text will carry its font size, color, etc. We may need some -optimizations down the road, but start small. For now, let's call -these objects "primitives". +similar names, don't confuse these with the current matplotlib Artists +by the same name, which are considerably higher level than what I'm +thinking of here. Each of these will carry their metadata, eg a path +will carry its stroke color, facecolor, linewidth, etc. Text will +carry its font size, color, etc. We may need some optimizations down +the road, but start small. For now, let's call these objects +"primitives". -= where do the plot functions live? = += Where do the plot functions live? = In matplotlib, the plot functions are axes methods and I think there is consensus that this is a poor design. Where should these live, what should they create, etc? -= how much of an intermediate artist layer do we need = += How much of an intermediate artist layer do we need? = Do we want to create high level objects like Circle, Rectangle and Line, each of which manage a Path object under the hood? Probably, for user convenience and general compability with matplotlib. By using traits properly here, these will be thin interfaces around one -of our primitives. +of our primitives. I think the whole collections module is poorly +designed, and should be chucked wholesale, if favor of faster, more +elegant, optimizations and special cases. Just having the right Path +object will reduce the need for many of these, eg LineCollection, +PolygonCollection, etc... Also, everything should be numpy enabled, +and the list of python tuples approach that many of the collections +take should be shed. -= z-ordering, containers, etc = += Z-ordering, containers, etc = Peter has been doing a lot of nice work on z-order and layers and stuff like that for chaco, stuff that looks really useful for picking, @@ -59,7 +68,7 @@ carefully about how this should be handled. Paul may be a good candidate for this, since he has been working on picking. -= extension code = += Extension code = I would like to shed all of the CXX extension code -- it is just too small a nitch of the python world to base our project on. SWIG is @@ -67,17 +76,18 @@ transformations with some carefully chosen extension code where necessary, so this gets rid of _transforms.cpp. I also plan to use the SWIG agg wrapper, so this gets rid of _backend_agg. If we can -enhance the SWIG agg wrapper, we can also do images through here. -Having a fully featured python agg wrapper will be a plus. But with -the agg license change, I'm open to discussion of alternatives. +enhance the SWIG agg wrapper, we can also do images through there. +Having a fully featured python exposed agg wrapper will be a plus. +But with the agg license change, I'm open to discussion of +alternatives. I want to do away with *all* GUI extension code. This should live -outside MPL, eg in a toolkit, if we need it. This means someone needs -to figure out how to get tk talking to a python buffer or numpy array. -Maintaining the GUI extension code across platforms is an unending -headache. +outside MPL if at all, eg in a toolkit, if we need it. This means +someone needs to figure out how to get tk talking to a python buffer +object or numpy array. Maintaining the GUI extension code across +platforms is an unending headache. -= traits = += Traits = I think we should make a major committment to traits and use them from the ground up. Without the UI stuff, they add plenty to make them @@ -86,29 +96,36 @@ the logic for sharing an x-axis in matplotlib transforms with sharex with the approach used in mpl1.py with synch-ed affines. -= axis handling = += Axis handling = The whole conception of the Axes needs to be rethought, in light of the fact that we need to support multiple axis objects on one Axes. The matplotlib implementation assumes 1 xaxis and 1 yaxis per Axes, and we hack two y-axis support with some transform shenanigans via -twinx, but the approach is not generalizable and is unweildy. +twinx, but the approach is not generalizable and is unwieldy. This will require a fair amount of thought, but we should aim for supporting an arbitrary number of axis obects, presumably associated with individual artists or primitives, on each Axes. They also need to be *much* faster. matplotlib uses Artists for each tick, tickline, -gridline, ticklabel, etc, and this is mind-numbingsly slow. +gridline, ticklabel, etc, and this is mind-numbingsly slow. I have +some proto-type axis implementations that draw all the ticks with a +single path using repeated MOVETO and LINETO, for example, which will +be incomparably faster, than using a separate object from each tick. -= breakage = += Breakage = I think we need to be prepared to break the hell out of matplotlib. The API will basically be a total rewrite. pylab will still mostly work unchanged -- that is the beauty of pylab - though API calls on -return obects will probably be badly broken. We'll probably want to -install into a new namespace, eg mpl, and envision both matplotlib and -mpl co-existing for some time. In fact, mpl might depend on -matplotlib for a while (eg until a CXX free ft2font is available) +return obects will probably be badly broken. We can mitigate this +pain if we desire with clever wrapper objects, but once you start +calling methods on return objects, you oin the community of power +users, and this is the community I'm most willing to inconvenience +with breakage. We'll probably want to install into a new namespace, +eg "mpl", and envision both matplotlib and mpl co-existing for some +time. In fact, mpl might depend on matplotlib initially (eg until a +CXX free ft2font is available) We should expect to be supporting and using matplotlib for a long time, since the proposals discussed here imply that it will be a long @@ -120,10 +137,10 @@ Or we could forget all this wild speculation and resume our normally scheduled lives. -= chaco and kiva = += Chaco and Kiva = It is a good idea for an enterprising developer to take a careful look -at tghe current Chaco and Kiva to see if we can further integrate with +at the current Chaco and Kiva to see if we can further integrate with them. I am gun shy because they seem formiddable and complex, and one of my major goals here is to streamline and simplify, but they are incredible pieces of work and we need to carefully consider them, @@ -131,14 +148,14 @@ core, eg traits, increasing the possibility of synergies. -= unit handling, custom object types = += Unit handling, custom object types = There is a legitimate need to be able to feed custom objects into matplotlib. Recent versions of matplotlib support this with a unit -registry. A clear use case is plotting with native datetime objects, -which is supported in the latest release of matplotlib via the unit -handling, which should probably be called "custom object handling and -conversion". This is a deep and complicaed subect, involving -questions of where the original data live, how they are converted to -useful types (arrays of floats) etc. It's worth thinking about as we -discuss redesign issues. +registry in the "units" module. A clear use case is plotting with +native datetime objects, which is supported in the latest release of +matplotlib via the unit handling, which should probably be called +"custom object handling and conversion". This is a deep and +complictaed subject, involving questions of where the original data +live, how they are converted to useful types (arrays of floats) etc. +It's worth thinking about as we discuss redesign issues. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |