SF.net SVN: matplotlib:[7707] trunk/toolkits/basemap/lib/mpl_toolkits/ basemap/netcdftime.py

2009-09-08 Thread jswhit
Revision: 7707
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7707&view=rev
Author:   jswhit
Date: 2009-09-08 12:06:35 + (Tue, 08 Sep 2009)

Log Message:
---
update to latest version from netcdf4-python

Modified Paths:
--
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py

Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py
===
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py   
2009-09-08 01:53:12 UTC (rev 7706)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py   
2009-09-08 12:06:35 UTC (rev 7707)
@@ -934,18 +934,38 @@
 cdftime = utime(units,calendar=calendar)
 return cdftime.num2date(times)
 
-
 def _check_index(indices, dates, nctime, calendar):
-"""Assert that the time indices given correspond to the given dates."""
-t = numpy.empty(len(indices), nctime.dtype)
-for n,i in enumerate(indices):
-t[n] = nctime[i]
-assert numpy.all( num2date(t, nctime.units, calendar) == dates)
+"""Return True if the time indices given correspond to the given dates, 
+False otherwise.
+
+Parameters: 
 
+indices : sequence of integers
+Positive integers indexing the time variable.
 
-def date2index(dates, nctime, calendar=None):
+dates : sequence of datetime objects
+Reference dates.
+
+nctime : netCDF Variable object
+NetCDF time object.
+
+calendar : string
+Calendar of nctime.
+ """
+if  (indices <0).any():
+   return False
+   
+if (indices >= nctime.shape[0]).any():
+return False
+
+t = nctime[indices] 
+return numpy.all( num2date(t, nctime.units, calendar) == dates)
+
+
+
+def date2index(dates, nctime, calendar=None, select='exact'):
 """
-date2index(dates, nctime, calendar=None)
+date2index(dates, nctime, calendar=None, select='exact')
 
 Return indices of a netCDF time variable corresponding to the given dates.
 
@@ -953,7 +973,8 @@
 The datetime objects should not include a time-zone offset.
 
 @param nctime: A netCDF time variable object. The nctime object must have a
-C{units} attribute.
+C{units} attribute. The entries are assumed to be stored in increasing 
+order.
 
 @param calendar: Describes the calendar used in the time calculation.
 Valid calendars C{'standard', 'gregorian', 'proleptic_gregorian'
@@ -961,32 +982,54 @@
 Default is C{'standard'}, which is a mixed Julian/Gregorian calendar
 If C{calendar} is None, its value is given by C{nctime.calendar} or
 C{standard} if no such attribute exists.
+
+@param select: C{'exact', 'before', 'after', 'nearest'}
+  The index selection method. C{exact} will return the indices perfectly 
+  matching the dates given. C{before} and C{after} will return the indices 
+  corresponding to the dates just before or just after the given dates if 
+  an exact match cannot be found. C{nearest} will return the indices that 
+  correpond to the closest dates. 
 """
 # Setting the calendar.
 if calendar is None:
 calendar = getattr(nctime, 'calendar', 'standard')
 
 num = numpy.atleast_1d(date2num(dates, nctime.units, calendar))
-
-index = numpy.empty(numpy.alen(dates), int)
-
+
 # Trying to infer the correct index from the starting time and the stride.
-try:
-t0, t1 = nctime[:2]
-dt = t1 - t0
-index[:] = (num-t0)/dt
+# This assumes that the times are increasing uniformly. 
+t0, t1 = nctime[:2]
+dt = t1 - t0
+index = numpy.array((num-t0)/dt, int)
 
-# Checking that the index really corresponds to the given date.
-_check_index(index, dates, nctime, calendar)
-
-except AssertionError:
-
-# If check fails, use brute force method.
-index[:] = numpy.digitize(num, nctime[:]) - 1
-
-# Perform check again.
-_check_index(index, dates, nctime, calendar)
-
+# Checking that the index really corresponds to the given date.
+# If the times do not correspond, then it means that the times
+# are not increasing uniformly and we try the bisection method.
+if not _check_index(index, dates, nctime, calendar):
+
+# Use the bisection method. Assumes the dates are ordered.
+import bisect
+
+index = numpy.array([bisect.bisect_left(nctime, n) for n in num], int)
+
+nomatch = num2date(nctime[index], nctime.units) != dates
+
+if select == 'exact':
+if not (num2date(nctime[index], nctime.units) == dates).all():
+raise ValueError, 'Dates not found.'
+
+elif select == 'before':
+index[nomatch] -= 1
+
+elif select == 'after':
+pass
+
+elif select == 'nearest':
+index[nomatch] = index[nomatch]

SF.net SVN: matplotlib:[7708] trunk/toolkits/basemap/lib/mpl_toolkits/ basemap/__init__.py

2009-09-08 Thread jswhit
Revision: 7708
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7708&view=rev
Author:   jswhit
Date: 2009-09-08 12:12:18 + (Tue, 08 Sep 2009)

Log Message:
---
update date2index docstring

Modified Paths:
--
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py

Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-09-08 
12:06:35 UTC (rev 7707)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-09-08 
12:12:18 UTC (rev 7708)
@@ -3919,6 +3919,13 @@
  If ``calendar=None``, will use ``calendar`` attribute
  of ``nctime`` object, and if that attribute does 
  not exist calendar is set to ``standard``. 
+select   The index selection method. ``exact`` wil return the
+ indices perfectly matching the dates given. 
+ ``before`` and ``after`` will return the indices
+ corresponding to the dates just before or after
+ the given dates if an exact match cannot be found.
+ ``nearest``  will return the indices that 
+ correspond to the closest dates. 
 ==   
 
 Returns an index or a sequence of indices.


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7709] trunk/toolkits/basemap/Changelog

2009-09-08 Thread jswhit
Revision: 7709
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7709&view=rev
Author:   jswhit
Date: 2009-09-08 12:13:44 + (Tue, 08 Sep 2009)

Log Message:
---
update date2index function from netcdf4-python

Modified Paths:
--
trunk/toolkits/basemap/Changelog

Modified: trunk/toolkits/basemap/Changelog
===
--- trunk/toolkits/basemap/Changelog2009-09-08 12:12:18 UTC (rev 7708)
+++ trunk/toolkits/basemap/Changelog2009-09-08 12:13:44 UTC (rev 7709)
@@ -1,4 +1,5 @@
 version 0.99.5 (not yet released)
+   * update date2index function with a bug-fix from netcdf4-python.
* in contourf method, mask data outside map projection region
  (this prevents contourf from erroneously filling entire map).
* added 'nightshade' method to shade night regions on a map.


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7711] trunk/matplotlib/doc/sphinxext/ math_symbol_table.py

2009-09-08 Thread mdboom
Revision: 7711
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7711&view=rev
Author:   mdboom
Date: 2009-09-08 15:13:33 + (Tue, 08 Sep 2009)

Log Message:
---
Reverting last change -- seems to have broken things

Modified Paths:
--
trunk/matplotlib/doc/sphinxext/math_symbol_table.py

Modified: trunk/matplotlib/doc/sphinxext/math_symbol_table.py
===
--- trunk/matplotlib/doc/sphinxext/math_symbol_table.py 2009-09-08 14:30:16 UTC 
(rev 7710)
+++ trunk/matplotlib/doc/sphinxext/math_symbol_table.py 2009-09-08 15:13:33 UTC 
(rev 7711)
@@ -1,4 +1,4 @@
-nsymbols = [
+symbols = [
 ["Lower-case Greek",
  5,
  r"""\alpha \beta \gamma \chi \delta \epsilon \eta \iota \kappa
@@ -128,17 +128,27 @@
 state_machine.insert_input(lines, "Symbol table")
 return []
 
-def setup(app):
+try:
+from docutils.parsers.rst import Directive
+except ImportError:
+from docutils.parsers.rst.directives import _directives
 def math_symbol_table_directive(name, arguments, options, content, lineno,
 content_offset, block_text, state, 
state_machine):
 return run(state_machine)
 math_symbol_table_directive.arguments = None
 math_symbol_table_directive.options = {}
 math_symbol_table_directive.content = False
-app.add_directive('math_symbol_table',
-  math_symbol_table_directive)
+_directives['math_symbol_table'] = math_symbol_table_directive
+else:
+class math_symbol_table_directive(Directive):
+has_content = False
+def run(self):
+return run(self.state_machine)
+from docutils.parsers.rst import directives
+directives.register_directive('math_symbol_table',
+  math_symbol_table_directive)
 
-if __name__ == '__main__':
+if __name__ == "__main__":
 # Do some verification of the tables
 from matplotlib import _mathtext_data
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7712] trunk/matplotlib

2009-09-08 Thread mdboom
Revision: 7712
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7712&view=rev
Author:   mdboom
Date: 2009-09-08 15:17:20 + (Tue, 08 Sep 2009)

Log Message:
---
Add an rcParam for hinting, and set it to False when running tests.

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/__init__.py
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
trunk/matplotlib/lib/matplotlib/config/mplconfig.py
trunk/matplotlib/lib/matplotlib/config/rcsetup.py
trunk/matplotlib/lib/matplotlib/mathtext.py
trunk/matplotlib/lib/matplotlib/rcsetup.py
trunk/matplotlib/lib/matplotlib/text.py
trunk/matplotlib/matplotlibrc.template

Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===
--- trunk/matplotlib/lib/matplotlib/__init__.py 2009-09-08 15:13:33 UTC (rev 
7711)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2009-09-08 15:17:20 UTC (rev 
7712)
@@ -893,6 +893,8 @@
 from testing.noseclasses import KnownFailure
 from nose.plugins.manager import PluginManager
 use('Agg') # use Agg backend for these tests
+rcParams['font.family'] = 'Bitstream Vera Sans'
+rcParams['text.hinting'] = False
 plugins = []
 plugins.append( KnownFailure() )
 plugins.extend( [plugin() for plugin in nose.plugins.builtin.plugins] )

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-09-08 
15:13:33 UTC (rev 7711)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-09-08 
15:17:20 UTC (rev 7712)
@@ -30,7 +30,7 @@
 from matplotlib.cbook import is_string_like, maxdict
 from matplotlib.figure import Figure
 from matplotlib.font_manager import findfont
-from matplotlib.ft2font import FT2Font, LOAD_FORCE_AUTOHINT
+from matplotlib.ft2font import FT2Font, LOAD_FORCE_AUTOHINT, LOAD_NO_HINTING
 from matplotlib.mathtext import MathTextParser
 from matplotlib.path import Path
 from matplotlib.transforms import Bbox, BboxBase
@@ -69,6 +69,12 @@
 if __debug__: verbose.report('RendererAgg.__init__ done',
  'debug-annoying')
 
+def _get_hinting_flag(self):
+if rcParams['text.hinting']:
+return LOAD_FORCE_AUTOHINT
+else:
+return LOAD_NO_HINTING
+
 def draw_markers(self, *kl, **kw):
 # for filtering to work with rastrization, methods needs to be wrapped.
 # maybe there is better way to do it.
@@ -132,14 +138,15 @@
 if ismath:
 return self.draw_mathtext(gc, x, y, s, prop, angle)
 
+flags = self._get_hinting_flag()
 font = self._get_agg_font(prop)
 if font is None: return None
 if len(s) == 1 and ord(s) > 127:
-font.load_char(ord(s), flags=LOAD_FORCE_AUTOHINT)
+font.load_char(ord(s), flags=flags)
 else:
 # We pass '0' for angle here, since it will be rotated (in raster
 # space) in the following call to draw_text_image).
-font.set_text(s, 0, flags=LOAD_FORCE_AUTOHINT)
+font.set_text(s, 0, flags=flags)
 font.draw_glyphs_to_bitmap()
 
 #print x, y, int(x), int(y), s
@@ -168,8 +175,10 @@
 ox, oy, width, height, descent, fonts, used_characters = \
 self.mathtext_parser.parse(s, self.dpi, prop)
 return width, height, descent
+
+flags = self._get_hinting_flag()
 font = self._get_agg_font(prop)
-font.set_text(s, 0.0, flags=LOAD_FORCE_AUTOHINT)  # the width and 
height of unrotated string
+font.set_text(s, 0.0, flags=flags)  # the width and height of 
unrotated string
 w, h = font.get_width_height()
 d = font.get_descent()
 w /= 64.0  # convert from subpixels

Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py
===
--- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2009-09-08 15:13:33 UTC 
(rev 7711)
+++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2009-09-08 15:17:20 UTC 
(rev 7712)
@@ -154,6 +154,7 @@
 class text(TConfig):
 color = T.Trait('black',mplT.ColorHandler())
 usetex = T.false
+hinting = T.true
 
 class latex(TConfig):
 unicode = T.false
@@ -338,6 +339,7 @@
 'text.latex.unicode' : (self.tconfig.text.latex, 'unicode'),
 'text.latex.preamble' : (self.tconfig.text.latex, 'preamble'),
 'text.dvipnghack' : (self.tconfig.text.latex, 'dvipnghack'),
+'text.hinting' : (self.tconfig.text, 'hinting'),
 
 'mathtext.cal': (self.tconfig.mathtext, 'cal'),
 'mathtext.rm' : (self.tconfig.mathtext, 'rm'),

Modified: trunk/matplotlib/lib/matplotlib/config/rcsetup.py
===

SF.net SVN: matplotlib:[7713] trunk/matplotlib

2009-09-08 Thread jdh2358
Revision: 7713
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7713&view=rev
Author:   jdh2358
Date: 2009-09-08 15:23:02 + (Tue, 08 Sep 2009)

Log Message:
---
add test_image to default suite

Modified Paths:
--
trunk/matplotlib/doc/devel/release_guide.rst
trunk/matplotlib/lib/matplotlib/__init__.py

Modified: trunk/matplotlib/doc/devel/release_guide.rst
===
--- trunk/matplotlib/doc/devel/release_guide.rst2009-09-08 15:17:20 UTC 
(rev 7712)
+++ trunk/matplotlib/doc/devel/release_guide.rst2009-09-08 15:23:02 UTC 
(rev 7713)
@@ -122,7 +122,7 @@
 sftp> put matplotlib-0.98.2.tar.gz
 Uploading matplotlib-0.98.2.tar.gz to 
/incoming/j/jd/jdh2358/uploads/matplotlib-0.98.2.tar.gz
 
-* go https://sourceforge.net/project/admin/editpackages.php?group_id=80706 and 
do a
+* go https://sourceforge.net/project/admin/explorer.php?group_id=80706 and do a
   file release.  Click on the "Admin" tab to log in as an admin, and
   then the "File Releases" tab.  Go to the bottom and click "add
   release" and enter the package name but not the version number in

Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===
--- trunk/matplotlib/lib/matplotlib/__init__.py 2009-09-08 15:17:20 UTC (rev 
7712)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2009-09-08 15:23:02 UTC (rev 
7713)
@@ -884,6 +884,7 @@
 'matplotlib.tests.test_axes',
 'matplotlib.tests.test_dates',
 'matplotlib.tests.test_spines',
+'matplotlib.tests.test_image',
 ]
 
 def test(verbosity=0):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7710] trunk/matplotlib/doc/sphinxext/ math_symbol_table.py

2009-09-08 Thread mdboom
Revision: 7710
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7710&view=rev
Author:   mdboom
Date: 2009-09-08 14:30:16 + (Tue, 08 Sep 2009)

Log Message:
---
Update math_symbol_table directive to new Sphinx extension API

Modified Paths:
--
trunk/matplotlib/doc/sphinxext/math_symbol_table.py

Modified: trunk/matplotlib/doc/sphinxext/math_symbol_table.py
===
--- trunk/matplotlib/doc/sphinxext/math_symbol_table.py 2009-09-08 12:13:44 UTC 
(rev 7709)
+++ trunk/matplotlib/doc/sphinxext/math_symbol_table.py 2009-09-08 14:30:16 UTC 
(rev 7710)
@@ -1,4 +1,4 @@
-symbols = [
+nsymbols = [
 ["Lower-case Greek",
  5,
  r"""\alpha \beta \gamma \chi \delta \epsilon \eta \iota \kappa
@@ -128,27 +128,17 @@
 state_machine.insert_input(lines, "Symbol table")
 return []
 
-try:
-from docutils.parsers.rst import Directive
-except ImportError:
-from docutils.parsers.rst.directives import _directives
+def setup(app):
 def math_symbol_table_directive(name, arguments, options, content, lineno,
 content_offset, block_text, state, 
state_machine):
 return run(state_machine)
 math_symbol_table_directive.arguments = None
 math_symbol_table_directive.options = {}
 math_symbol_table_directive.content = False
-_directives['math_symbol_table'] = math_symbol_table_directive
-else:
-class math_symbol_table_directive(Directive):
-has_content = False
-def run(self):
-return run(self.state_machine)
-from docutils.parsers.rst import directives
-directives.register_directive('math_symbol_table',
-  math_symbol_table_directive)
+app.add_directive('math_symbol_table',
+  math_symbol_table_directive)
 
-if __name__ == "__main__":
+if __name__ == '__main__':
 # Do some verification of the tables
 from matplotlib import _mathtext_data
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7715] trunk/matplotlib/test

2009-09-08 Thread astraw
Revision: 7715
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7715&view=rev
Author:   astraw
Date: 2009-09-08 15:54:06 + (Tue, 08 Sep 2009)

Log Message:
---
buildbot: set exit code when running tests

Modified Paths:
--
trunk/matplotlib/test/_buildbot_mac_sage.sh
trunk/matplotlib/test/_buildbot_test.py

Modified: trunk/matplotlib/test/_buildbot_mac_sage.sh
===
--- trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-09-08 15:49:37 UTC (rev 
7714)
+++ trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-09-08 15:54:06 UTC (rev 
7715)
@@ -13,4 +13,4 @@
 
 cd test
 rm -f failed-diff-*.png
-python -c "import matplotlib; matplotlib.test(verbosity=2)"
+python -c "import sys, matplotlib; success = matplotlib.test(verbosity=2); 
sys.exit(not success)"

Modified: trunk/matplotlib/test/_buildbot_test.py
===
--- trunk/matplotlib/test/_buildbot_test.py 2009-09-08 15:49:37 UTC (rev 
7714)
+++ trunk/matplotlib/test/_buildbot_test.py 2009-09-08 15:54:06 UTC (rev 
7715)
@@ -18,5 +18,5 @@
 for fname in previous_test_images:
 os.unlink(fname)
 
-check_call('%s -c "import matplotlib; matplotlib.test(verbosity=2)"'%TARGET_py,
+check_call('%s -c "import sys, matplotlib; success = 
matplotlib.test(verbosity=2); sys.exit(not success)"'%TARGET_py,
cwd='test')


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7716] trunk/matplotlib/lib/matplotlib/tests/ baseline_images

2009-09-08 Thread mdboom
Revision: 7716
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7716&view=rev
Author:   mdboom
Date: 2009-09-08 16:48:12 + (Tue, 08 Sep 2009)

Log Message:
---
Update baseline images for hinting turned off.

Modified Paths:
--

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.png
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/const_xy.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/fill_units.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_001.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/offset_points.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_axes.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_coords.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_units.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_180.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/single_date.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/single_point.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/DateFormatter_fractionalSeconds.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/RRuleLocator_bounds.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_axhline.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_axhspan.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_axvline.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_axvspan.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_empty.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_interps.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/const_xy.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/fill_units.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_001.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/offset_points.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_axes.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_coords.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_units.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_180.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/single_date.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/single_point.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/DateFormatter_fractionalSeconds.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/RRuleLocator_bounds.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_axhline.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_axhspan.png
==

SF.net SVN: matplotlib:[7714] trunk/matplotlib/lib/matplotlib/__init__.py

2009-09-08 Thread jdh2358
Revision: 7714
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7714&view=rev
Author:   jdh2358
Date: 2009-09-08 15:49:37 + (Tue, 08 Sep 2009)

Log Message:
---
store old rc params before tests and then update after

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/__init__.py

Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===
--- trunk/matplotlib/lib/matplotlib/__init__.py 2009-09-08 15:23:02 UTC (rev 
7713)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2009-09-08 15:49:37 UTC (rev 
7714)
@@ -893,7 +893,15 @@
 import nose.plugins.builtin
 from testing.noseclasses import KnownFailure
 from nose.plugins.manager import PluginManager
+
+backend = rcParams['backend']
+
 use('Agg') # use Agg backend for these tests
+
+# store the old values before overriding
+overrides = 'font.family', 'text.hinting'
+stored = dict([(k, rcParams[k]) for k in overrides])
+
 rcParams['font.family'] = 'Bitstream Vera Sans'
 rcParams['text.hinting'] = False
 plugins = []
@@ -906,6 +914,11 @@
 success = nose.run( defaultTest=default_test_modules,
 config=config,
 )
+# restore the old rc values
+rcParams.update(stored)
+
+# restore the old backend
+use(backend)
 return success
 
 test.__test__ = False # nose: this function is not a test


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7717] trunk/toolkits/basemap/lib/mpl_toolkits/ basemap/netcdftime.py

2009-09-08 Thread jswhit
Revision: 7717
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7717&view=rev
Author:   jswhit
Date: 2009-09-08 17:18:53 + (Tue, 08 Sep 2009)

Log Message:
---
adjust netcdftime since fancy indexing doesn't work in pupynere.

Modified Paths:
--
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py

Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py
===
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py   
2009-09-08 16:48:12 UTC (rev 7716)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py   
2009-09-08 17:18:53 UTC (rev 7717)
@@ -958,7 +958,11 @@
 if (indices >= nctime.shape[0]).any():
 return False
 
-t = nctime[indices] 
+#   t = nctime[indices] 
+# fancy indexing not available, fall back on this.
+t=[]
+for ind in indices:
+t.append(nctime[ind])
 return numpy.all( num2date(t, nctime.units, calendar) == dates)
 
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7718] trunk/matplotlib/lib/matplotlib/tests/ baseline_images/test_axes

2009-09-08 Thread jdh2358
Revision: 7718
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7718&view=rev
Author:   jdh2358
Date: 2009-09-08 17:24:07 + (Tue, 08 Sep 2009)

Log Message:
---
add remaining two unhinted baseline images

Modified Paths:
--

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_002.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_360.png

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_002.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_360.png
===
(Binary files differ)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7722] trunk/matplotlib/lib/mpl_toolkits/axes_grid/ axislines.py

2009-09-08 Thread leejjoon
Revision: 7722
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7722&view=rev
Author:   leejjoon
Date: 2009-09-08 17:43:04 + (Tue, 08 Sep 2009)

Log Message:
---
axes_grid: add grid support for rectlinear axes

Modified Paths:
--
trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py

Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py
===
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py2009-09-08 
17:42:58 UTC (rev 7721)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py2009-09-08 
17:43:04 UTC (rev 7722)
@@ -648,8 +648,37 @@
 return axisline
 
 
+def get_gridlines(self):
+"""
+return list of gridline coordinates in data coordinates.
+"""
 
+gridlines = []
 
+locs = []
+y1, y2 = self.axes.get_ylim()
+if self.axes.xaxis._gridOnMajor:
+locs.extend(self.axes.xaxis.major.locator())
+if self.axes.xaxis._gridOnMinor:
+locs.extend(self.axes.xaxis.minor.locator())
+
+for x in locs:
+gridlines.append([[x, x], [y1, y2]])
+
+
+x1, x2 = self.axes.get_xlim()
+locs = []
+if self.axes.yaxis._gridOnMajor:
+locs.extend(self.axes.yaxis.major.locator())
+if self.axes.yaxis._gridOnMinor:
+locs.extend(self.axes.yaxis.minor.locator())
+
+for y in locs:
+gridlines.append([[x1, x2], [y, y]])
+
+return gridlines
+
+
 from matplotlib.lines import Line2D
 
 class Ticks(Line2D):
@@ -1313,13 +1342,13 @@
 
 helper = kw.pop("grid_helper", None)
 
+self._axisline_on = True
+
 if helper:
 self._grid_helper = helper
 else:
 self._grid_helper = GridHelperRectlinear(self)
 
-self._axisline_on = True
-
 super(Axes, self).__init__(*kl, **kw)
 
 self.toggle_axisline(True)
@@ -1371,15 +1400,24 @@
 if grid_helper is None:
 grid_helper = self.get_grid_helper()
 gridlines.set_grid_helper(grid_helper)
-gridlines.set_clip_on(True)
 
+self.axes._set_artist_props(gridlines)
+# gridlines.set_clip_path(self.axes.patch)
+# set_clip_path need to be defered after Axes.cla is completed.
+# It is done inside the cla.
+
 self.gridlines = gridlines
 
 def cla(self):
 # gridlines need to b created before cla() since cla calls grid()
+
 self._init_gridlines()
+super(Axes, self).cla()
 
-super(Axes, self).cla()
+# the clip_path should be set after Axes.cla() since that's
+# when a patch is created.
+self.gridlines.set_clip_path(self.axes.patch)
+
 self._init_axis_artists()
 
 def get_grid_helper(self):
@@ -1387,13 +1425,25 @@
 
 
 def grid(self, b=None, **kwargs):
+"""
+Toggel the gridlines, and optionally set the properties of the lines.
+"""
+# their are some discrepancy between the behavior of grid in
+# axes_grid and the original mpl's grid, because axes_grid
+# explicitly set the visibility of the gridlines.
+
+super(Axes, self).grid(b, **kwargs)
 if not self._axisline_on:
-super(Axes, self).grid(b, **kwargs)
 return
 
 if b is None:
-b = not self.gridlines.get_visible()
 
+if self.axes.xaxis._gridOnMinor or self.axes.xaxis._gridOnMajor or 
\
+   self.axes.yaxis._gridOnMinor or 
self.axes.yaxis._gridOnMajor:
+b=True
+else:
+b=False
+
 self.gridlines.set_visible(b)
 
 if len(kwargs):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7720] trunk/matplotlib/test/TODO

2009-09-08 Thread astraw
Revision: 7720
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7720&view=rev
Author:   astraw
Date: 2009-09-08 17:42:47 + (Tue, 08 Sep 2009)

Log Message:
---
testing: add TODO point

Modified Paths:
--
trunk/matplotlib/test/TODO

Modified: trunk/matplotlib/test/TODO
===
--- trunk/matplotlib/test/TODO  2009-09-08 17:38:14 UTC (rev 7719)
+++ trunk/matplotlib/test/TODO  2009-09-08 17:42:47 UTC (rev 7720)
@@ -16,6 +16,9 @@
 Misc testing stuff
 ==
 
+Make ImageComparisonFailure cause nose to report "fail" (rather than
+"error").
+
 Recreate John's move_good.py script once the better hierarchy of test
 result images is established.
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7721] trunk/matplotlib

2009-09-08 Thread leejjoon
Revision: 7721
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7721&view=rev
Author:   leejjoon
Date: 2009-09-08 17:42:58 + (Tue, 08 Sep 2009)

Log Message:
---
AxesGrid: implemented axisline style

Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py

Added Paths:
---
trunk/matplotlib/examples/axes_grid/demo_axisline_style.py
trunk/matplotlib/lib/mpl_toolkits/axes_grid/axisline_style.py

Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG  2009-09-08 17:42:47 UTC (rev 7720)
+++ trunk/matplotlib/CHANGELOG  2009-09-08 17:42:58 UTC (rev 7721)
@@ -1,3 +1,6 @@
+2009-09-07 AxesGrid : implemented axisline style. 
+   Added a demo examples/axes_grid/demo_axisline_style.py- JJL
+
 2009-09-04 Make the textpath class as a separate moduel 
(textpath.py). Add support for mathtext and tex.- JJL
 

Added: trunk/matplotlib/examples/axes_grid/demo_axisline_style.py
===
--- trunk/matplotlib/examples/axes_grid/demo_axisline_style.py  
(rev 0)
+++ trunk/matplotlib/examples/axes_grid/demo_axisline_style.py  2009-09-08 
17:42:58 UTC (rev 7721)
@@ -0,0 +1,21 @@
+
+from mpl_toolkits.axes_grid.axislines import SubplotZero
+import matplotlib.pyplot as plt
+import numpy as np
+
+if __name__ == "__main__":
+fig = plt.figure(1)
+ax = SubplotZero(fig, 111)
+fig.add_subplot(ax)
+
+for direction in ["xzero", "yzero"]:
+ax.axis[direction].set_axisline_style("->")
+ax.axis[direction].set_visible(True)
+
+for direction in ["left", "right", "bottom", "top"]:
+ax.axis[direction].set_visible(False)
+
+x = np.linspace(-0.5, 1., 100)
+ax.plot(x, np.sin(x*np.pi))
+
+plt.show()

Added: trunk/matplotlib/lib/mpl_toolkits/axes_grid/axisline_style.py
===
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/axisline_style.py   
(rev 0)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/axisline_style.py   
2009-09-08 17:42:58 UTC (rev 7721)
@@ -0,0 +1,148 @@
+from matplotlib.patches import _Style, FancyArrowPatch
+from matplotlib.transforms import IdentityTransform
+from matplotlib.path import Path
+import numpy as np
+
+class AxislineStyle(_Style):
+"""
+:class:`AxislineStyle` is a container class which defines style classes
+for AxisArtists.
+
+An instance of any axisline style class is an callable object,
+whose call signature is ::
+
+   __call__(self, axis_artist, path, transform)
+
+When called, this should return a mpl artist with following
+methods implemented. ::
+
+  def set_path(self, path):
+  # set the path for axisline.
+  
+  def set_line_mutation_scale(self, scale):
+  # set the scale
+  
+  def draw(self, renderer):
+  # draw
+
+   
+"""
+
+_style_list = {}
+
+
+class _Base(object):
+# The derived classes are required to be able to be initialized
+# w/o arguments, i.e., all its argument (except self) must have
+# the default values.
+
+def __init__(self):
+"""
+initializtion.
+"""
+super(AxislineStyle._Base, self).__init__()
+
+
+
+
+def __call__(self, axis_artist, transform):
+"""
+Given the AxisArtist instance, and transform for the path
+(set_path method), return the mpl artist for drawing the axis line.
+"""
+
+return self.new_line(axis_artist, transform)
+
+
+class SimpleArrow(_Base):
+"""
+A simple arrow.
+"""
+
+
+class ArrowAxisline(FancyArrowPatch):
+"""
+The artist class that will be returend for SimpleArrow style.
+"""
+def __init__(self, axis_artist, line_path, transform,
+ line_mutation_scale):
+self._axis_artist = axis_artist
+self._line_transform = transform
+self._line_path = line_path
+self._line_mutation_scale = line_mutation_scale
+
+FancyArrowPatch.__init__(self,
+ path=self._line_path, 
+ arrowstyle="->",
+ arrow_transmuter=None,
+ patchA=None,
+ patchB=None,
+ shrinkA=0.,
+ shrinkB=0.,
+ mutation_scale=line_mutation_scale,
+ mutation_aspect=None,
+

SF.net SVN: matplotlib:[7723] trunk/matplotlib/lib/matplotlib/tests/ baseline_images/test_axes

2009-09-08 Thread jdh2358
Revision: 7723
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7723&view=rev
Author:   jdh2358
Date: 2009-09-08 18:16:38 + (Tue, 08 Sep 2009)

Log Message:
---
update the formatter baselines

Modified Paths:
--

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_003.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_004.png

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_005.png

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_003.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_004.png
===
(Binary files differ)

Modified: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_005.png
===
(Binary files differ)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7719] trunk/matplotlib/test/TODO

2009-09-08 Thread astraw
Revision: 7719
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7719&view=rev
Author:   astraw
Date: 2009-09-08 17:38:14 + (Tue, 08 Sep 2009)

Log Message:
---
testing: add a TODO list

Added Paths:
---
trunk/matplotlib/test/TODO

Added: trunk/matplotlib/test/TODO
===
--- trunk/matplotlib/test/TODO  (rev 0)
+++ trunk/matplotlib/test/TODO  2009-09-08 17:38:14 UTC (rev 7719)
@@ -0,0 +1,50 @@
+Here are a collection of notes about things we want to accomplish with
+the testing infrastructure.
+
+matplotlib.testing.image_comparison decorator
+=
+
+Collect all the failures in the image_comparison() decorator and raise
+one failure that describes all the failed images. Right now the loop
+that iterates over the images raises an exception on the first
+failure, which clearly breaks out of the loop.
+
+Put image comparison results into more hierarchical view to facilitate
+knowing which test module creates which image. (Also, revive John's
+move_good.py script to deal with new image locations.)
+
+Misc testing stuff
+==
+
+Recreate John's move_good.py script once the better hierarchy of test
+result images is established.
+
+Buildbot infrastructure
+===
+
+Put "actual" images online from buildbots, even without failure.
+
+Get a Windows XP 32-bit build slave.
+
+Build nightly binaries for win32 and Mac OS X.
+
+Build nightly source tarballs.
+
+Build nightly docs and put online somewhere.
+
+A note about the hack that is the failed image gathering mechanism
+==
+
+The trouble with the current actual/baseline/diff result gathering
+mechanism is that it uses the filesystem as a means for communication
+withing the nose test running process in addition to communication
+with the buildbot process through hard-coded assumptions about paths
+and filenames. If the only concern was within nose, we could
+presumably re-work some the old MplNoseTester plugin to handle the new
+case, but given the buildbot consideration it gets more difficult to
+get these frameworks talking through supported API calls. Thus,
+although the hardcoded path and filename stuff is a hack, it will
+require some serious nose and buildbot learning to figure out how to
+do it the "right" way. So I'm all for sticking with the hack right
+now, and making a bit nicer by doing things like having a better
+directory hierarchy layout for the actual result images.


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins