SF.net SVN: matplotlib: [4435] trunk/matplotlib/lib/matplotlib/ _mathtext_data.py
Revision: 4435 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4435&view=rev Author: mdboom Date: 2007-11-26 06:06:57 -0800 (Mon, 26 Nov 2007) Log Message: --- Fix stixsans mode: Upper case Greek should be non-slanted. Modified Paths: -- trunk/matplotlib/lib/matplotlib/_mathtext_data.py Modified: trunk/matplotlib/lib/matplotlib/_mathtext_data.py === --- trunk/matplotlib/lib/matplotlib/_mathtext_data.py 2007-11-26 04:06:01 UTC (rev 4434) +++ trunk/matplotlib/lib/matplotlib/_mathtext_data.py 2007-11-26 14:06:57 UTC (rev 4435) @@ -2439,7 +2439,7 @@ (0x0030, 0x0039, 'rm', 0x1d7e2), # 0-9 (0x0041, 0x005a, 'it', 0x1d608), # A-Z (0x0061, 0x007a, 'it', 0x1d622), # a-z -(0x0391, 0x03a9, 'it', 0xe1bf), # \Alpha-\Omega +(0x0391, 0x03a9, 'rm', 0xe17d), # \Alpha-\Omega (0x03b1, 0x03c9, 'it', 0xe1d8), # \alpha-\omega (0x03d1, 0x03d1, 'it', 0xe1f2), # theta variant (0x03d5, 0x03d5, 'it', 0xe1f3), # phi variant This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4436] trunk/matplotlib/lib/matplotlib/ _mathtext_data.py
Revision: 4436 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4436&view=rev Author: mdboom Date: 2007-11-26 06:08:30 -0800 (Mon, 26 Nov 2007) Log Message: --- Fix stixsans mode: Circled numerals should never be slanted. Modified Paths: -- trunk/matplotlib/lib/matplotlib/_mathtext_data.py Modified: trunk/matplotlib/lib/matplotlib/_mathtext_data.py === --- trunk/matplotlib/lib/matplotlib/_mathtext_data.py 2007-11-26 14:06:57 UTC (rev 4435) +++ trunk/matplotlib/lib/matplotlib/_mathtext_data.py 2007-11-26 14:08:30 UTC (rev 4436) @@ -2298,7 +2298,7 @@ [ (0x0041, 0x0041, 'it', 0xe154), # A-B (0x0043, 0x0043, 'it', 0x2102), # C (missing in beta STIX fonts) -(0x0044, 0x0044, 'it', 0x2145), # D +(0x0044, 0x0044, 'it', 0x2145), # D (0x0045, 0x0047, 'it', 0xe156), # E-G (0x0048, 0x0048, 'it', 0x210d), # H (missing in beta STIX fonts) (0x0049, 0x004d, 'it', 0xe159), # I-M @@ -2346,8 +2346,8 @@ ], 'it': [ -(0x0030, 0x0030, 'it', 0x24ea), # 0 -(0x0031, 0x0039, 'it', 0x2460), # 1-9 +(0x0030, 0x0030, 'rm', 0x24ea), # 0 +(0x0031, 0x0039, 'rm', 0x2460), # 1-9 (0x0041, 0x005a, 'it', 0x24b6), # A-Z (0x0061, 0x007a, 'it', 0x24d0) # a-z ], @@ -2436,7 +2436,7 @@ [ # These numerals are actually upright. We don't actually # want italic numerals ever. -(0x0030, 0x0039, 'rm', 0x1d7e2), # 0-9 +(0x0030, 0x0039, 'rm', 0x1d7e2), # 0-9 (0x0041, 0x005a, 'it', 0x1d608), # A-Z (0x0061, 0x007a, 'it', 0x1d622), # a-z (0x0391, 0x03a9, 'rm', 0xe17d), # \Alpha-\Omega This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4437] branches/transforms
Revision: 4437
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4437&view=rev
Author: mdboom
Date: 2007-11-26 06:10:11 -0800 (Mon, 26 Nov 2007)
Log Message:
---
Merged revisions 4406-4436 via svnmerge from
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib
r4407 | mdboom | 2007-11-21 11:35:38 -0500 (Wed, 21 Nov 2007) | 2 lines
Mathtext speed improvement.
r4434 | jdh2358 | 2007-11-25 23:06:01 -0500 (Sun, 25 Nov 2007) | 1 line
added x11 to default darwin list
r4435 | mdboom | 2007-11-26 09:06:57 -0500 (Mon, 26 Nov 2007) | 2 lines
Fix stixsans mode: Upper case Greek should be non-slanted.
r4436 | mdboom | 2007-11-26 09:08:30 -0500 (Mon, 26 Nov 2007) | 2 lines
Fix stixsans mode: Circled numerals should never be slanted.
Modified Paths:
--
branches/transforms/lib/matplotlib/_mathtext_data.py
branches/transforms/lib/matplotlib/mathtext.py
branches/transforms/setupext.py
Property Changed:
branches/transforms/
Property changes on: branches/transforms
___
Name: svnmerge-integrated
- /trunk/matplotlib:1-4405
+ /trunk/matplotlib:1-4436
Modified: branches/transforms/lib/matplotlib/_mathtext_data.py
===
--- branches/transforms/lib/matplotlib/_mathtext_data.py2007-11-26
14:08:30 UTC (rev 4436)
+++ branches/transforms/lib/matplotlib/_mathtext_data.py2007-11-26
14:10:11 UTC (rev 4437)
@@ -2296,7 +2296,7 @@
[
(0x0041, 0x0041, 'it', 0xe154), # A-B
(0x0043, 0x0043, 'it', 0x2102), # C (missing in beta STIX fonts)
-(0x0044, 0x0044, 'it', 0x2145), # D
+(0x0044, 0x0044, 'it', 0x2145), # D
(0x0045, 0x0047, 'it', 0xe156), # E-G
(0x0048, 0x0048, 'it', 0x210d), # H (missing in beta STIX fonts)
(0x0049, 0x004d, 'it', 0xe159), # I-M
@@ -2344,8 +2344,8 @@
],
'it':
[
-(0x0030, 0x0030, 'it', 0x24ea), # 0
-(0x0031, 0x0039, 'it', 0x2460), # 1-9
+(0x0030, 0x0030, 'rm', 0x24ea), # 0
+(0x0031, 0x0039, 'rm', 0x2460), # 1-9
(0x0041, 0x005a, 'it', 0x24b6), # A-Z
(0x0061, 0x007a, 'it', 0x24d0) # a-z
],
@@ -2434,10 +2434,10 @@
[
# These numerals are actually upright. We don't actually
# want italic numerals ever.
-(0x0030, 0x0039, 'rm', 0x1d7e2), # 0-9
+(0x0030, 0x0039, 'rm', 0x1d7e2), # 0-9
(0x0041, 0x005a, 'it', 0x1d608), # A-Z
(0x0061, 0x007a, 'it', 0x1d622), # a-z
-(0x0391, 0x03a9, 'it', 0xe1bf), # \Alpha-\Omega
+(0x0391, 0x03a9, 'rm', 0xe17d), # \Alpha-\Omega
(0x03b1, 0x03c9, 'it', 0xe1d8), # \alpha-\omega
(0x03d1, 0x03d1, 'it', 0xe1f2), # theta variant
(0x03d5, 0x03d5, 'it', 0xe1f3), # phi variant
Modified: branches/transforms/lib/matplotlib/mathtext.py
===
--- branches/transforms/lib/matplotlib/mathtext.py 2007-11-26 14:08:30 UTC
(rev 4436)
+++ branches/transforms/lib/matplotlib/mathtext.py 2007-11-26 14:10:11 UTC
(rev 4437)
@@ -503,6 +503,7 @@
(through ft2font)
"""
basepath = os.path.join( get_data_path(), 'fonts' )
+_fonts = {}
class CachedFont:
def __init__(self, font):
@@ -517,21 +518,17 @@
def __init__(self, default_font_prop, mathtext_backend):
Fonts.__init__(self, default_font_prop, mathtext_backend)
self.glyphd = {}
-self.fonts= {}
-filename = findfont(default_font_prop)
-default_font = self.CachedFont(FT2Font(str(filename)))
+if self._fonts == {}:
+filename = findfont(default_font_prop)
+default_font = self.CachedFont(FT2Font(str(filename)))
-self.fonts['default'] = default_font
+self._fonts['default'] = default_font
def destroy(self):
self.glyphd = None
-for cached_font in self.fonts.values():
-cached_font.charmap = None
-cached_font.glyphmap = None
-cached_font.font = None
Fonts.destroy(self)
-
+
def _get_font(self, font):
"""Looks up a CachedFont with its charmap and inverse charmap.
font may be a TeX font name (cal, rm, it etc.), or postscript name."""
@@ -540,16 +537,16 @@
else:
basename = font
-cached_font = self.fonts.get(basename)
+cached_font = self._fonts.get(basename)
if cached_font is None:
try:
font = FT2Font(basename)
except RuntimeError:
return None
cached_font = self
SF.net SVN: matplotlib: [4438] trunk/matplotlib/lib/matplotlib/mathtext.py
Revision: 4438
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4438&view=rev
Author: mdboom
Date: 2007-11-26 06:29:49 -0800 (Mon, 26 Nov 2007)
Log Message:
---
Minor speed improvements in mathtext. Removing trailing whitespace.
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-26 14:10:11 UTC (rev
4437)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-26 14:29:49 UTC (rev
4438)
@@ -210,7 +210,7 @@
class MathtextBackendBbox(MathtextBackend):
"""A backend whose only purpose is to get a precise bounding box.
Only required for the Agg backend."""
-
+
def __init__(self, real_backend):
MathtextBackend.__init__(self)
self.bbox = [0, 0, 0, 0]
@@ -221,7 +221,7 @@
min(self.bbox[1], y1),
max(self.bbox[2], x2),
max(self.bbox[3], y2)]
-
+
def render_glyph(self, ox, oy, info):
self._update_bbox(ox + info.metrics.xmin,
oy - info.metrics.ymax,
@@ -253,14 +253,14 @@
self.real_backend.fonts_object = self.fonts_object
self.real_backend.ox = self.bbox[0]
self.real_backend.oy = self.bbox[1]
-
+
class MathtextBackendAggRender(MathtextBackend):
def __init__(self):
self.ox = 0
self.oy = 0
self.image = None
MathtextBackend.__init__(self)
-
+
def set_canvas_size(self, w, h, d):
MathtextBackend.set_canvas_size(self, w, h, d)
self.image = FT2Image(ceil(w), ceil(h + d))
@@ -286,11 +286,11 @@
def MathtextBackendAgg():
return MathtextBackendBbox(MathtextBackendAggRender())
-
+
class MathtextBackendBitmapRender(MathtextBackendAggRender):
def get_results(self, box):
return self.image
-
+
def MathtextBackendBitmap():
return MathtextBackendBbox(MathtextBackendBitmapRender())
@@ -312,7 +312,7 @@
""" % locals()
self.lastfont = postscript_name, fontsize
self.pswriter.write(ps)
-
+
ps = """%(ox)f %(oy)f moveto
/%(symbol_name)s glyphshow\n
""" % locals()
@@ -428,7 +428,7 @@
"""Fix any cyclical references before the object is about
to be destroyed."""
self.used_characters = None
-
+
def get_kern(self, font1, sym1, fontsize1,
font2, sym2, fontsize2, dpi):
"""
@@ -739,7 +739,7 @@
fontmap = {}
use_cmex = True
-
+
def __init__(self, *args, **kwargs):
# This must come first so the backend's owner is set correctly
if rcParams['mathtext.fallback_to_cm']:
@@ -760,7 +760,7 @@
def _map_virtual_font(self, fontname, font_class, uniindex):
return fontname, uniindex
-
+
def _get_glyph(self, fontname, font_class, sym, fontsize):
found_symbol = False
@@ -769,7 +769,7 @@
if uniindex is not None:
fontname = 'ex'
found_symbol = True
-
+
if not found_symbol:
try:
uniindex = get_unicode_index(sym)
@@ -782,7 +782,7 @@
fontname, uniindex = self._map_virtual_font(
fontname, font_class, uniindex)
-
+
# Only characters in the "Letter" class should be italicized in 'it'
# mode. Greek capital letters should be Roman.
if found_symbol:
@@ -832,13 +832,16 @@
return [(fontname, sym)]
class StixFonts(UnicodeFonts):
+"""
+A font handling class for the STIX fonts
+"""
_fontmap = { 'rm' : 'STIXGeneral',
'it' : 'STIXGeneralItalic',
'bf' : 'STIXGeneralBol',
'nonunirm' : 'STIXNonUni',
'nonuniit' : 'STIXNonUniIta',
'nonunibf' : 'STIXNonUniBol',
-
+
0 : 'STIXGeneral',
1 : 'STIXSiz1Sym',
2 : 'STIXSiz2Sym',
@@ -851,7 +854,6 @@
cm_fallback = False
def __init__(self, *args, **kwargs):
-self._sans = kwargs.pop("sans", False)
TruetypeFonts.__init__(self, *args, **kwargs)
if not len(self.fontmap):
for key, name in self._fontmap.iteritems():
@@ -893,14 +895,14 @@
# This will generate a dummy character
uniindex = 0x1
fontname = 'it'
-
+
# Handle private use area glyphs
if (fontname in ('it', 'rm', 'bf') and
uniindex >= 0xe000 and uniindex <= 0xf8ff):
fontname = 'nonuni' + fontname
return fontname, uniindex
-
+
_size_alternatives = {}
def get_sized_alternatives_for_symbol(self, fontname, sym):
alternatives = self._size_alter
SF.net SVN: matplotlib: [4439] branches/transforms/lib/matplotlib/backends/ backend_template.py
Revision: 4439 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4439&view=rev Author: mdboom Date: 2007-11-26 07:18:40 -0800 (Mon, 26 Nov 2007) Log Message: --- Remove draw_arc (which isn't in the new backend renderer interface). Modified Paths: -- branches/transforms/lib/matplotlib/backends/backend_template.py Modified: branches/transforms/lib/matplotlib/backends/backend_template.py === --- branches/transforms/lib/matplotlib/backends/backend_template.py 2007-11-26 14:29:49 UTC (rev 4438) +++ branches/transforms/lib/matplotlib/backends/backend_template.py 2007-11-26 15:18:40 UTC (rev 4439) @@ -62,10 +62,6 @@ writing a new backend. Refer to backend_bases.RendererBase for documentation of the classes methods. """ -def draw_arc(self, gc, rgbFace, x, y, width, height, angle1, angle2, - rotation): -pass - def draw_path(self, gc, path, transform, rgbFace=None): pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4440] branches/transforms/lib/matplotlib
Revision: 4440
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4440&view=rev
Author: mdboom
Date: 2007-11-26 07:30:12 -0800 (Mon, 26 Nov 2007)
Log Message:
---
Support mixed-mode rendering in the SVG backend.
Modified Paths:
--
branches/transforms/lib/matplotlib/backend_bases.py
branches/transforms/lib/matplotlib/backends/backend_mixed.py
branches/transforms/lib/matplotlib/backends/backend_svg.py
Modified: branches/transforms/lib/matplotlib/backend_bases.py
===
--- branches/transforms/lib/matplotlib/backend_bases.py 2007-11-26 15:18:40 UTC
(rev 4439)
+++ branches/transforms/lib/matplotlib/backend_bases.py 2007-11-26 15:30:12 UTC
(rev 4440)
@@ -380,6 +380,8 @@
Return the alpha value used for blending - not supported on
all backends
"""
+if len(self._rgb) == 4:
+return self._rgb[3]
return self._alpha
def get_antialiased(self):
Modified: branches/transforms/lib/matplotlib/backends/backend_mixed.py
===
--- branches/transforms/lib/matplotlib/backends/backend_mixed.py
2007-11-26 15:18:40 UTC (rev 4439)
+++ branches/transforms/lib/matplotlib/backends/backend_mixed.py
2007-11-26 15:30:12 UTC (rev 4440)
@@ -41,11 +41,11 @@
self._set_current_renderer(vector_renderer)
_methods = """
-open_group close_group draw_path draw_markers
-draw_path_collection draw_quad_mesh get_image_magnification
-draw_image draw_tex draw_text flipy option_image_nocomposite
-get_texmanager get_text_width_height_descent new_gc
-points_to_pixels strip_math finalize
+close_group draw_image draw_markers draw_path
+draw_path_collection draw_quad_mesh draw_tex draw_text
+finalize flipy get_canvas_width_height get_image_magnification
+get_texmanager get_text_width_height_descent new_gc open_group
+option_image_nocomposite points_to_pixels strip_math
""".split()
def _set_current_renderer(self, renderer):
self._renderer = renderer
@@ -93,7 +93,3 @@
self._renderer.draw_image(l, height - b - h, image, None)
self._raster_renderer = None
self._rasterizing = False
-
-def get_canvas_width_height(self):
-'return the canvas width and height in display coords'
-return self._width, self._height
Modified: branches/transforms/lib/matplotlib/backends/backend_svg.py
===
--- branches/transforms/lib/matplotlib/backends/backend_svg.py 2007-11-26
15:18:40 UTC (rev 4439)
+++ branches/transforms/lib/matplotlib/backends/backend_svg.py 2007-11-26
15:30:12 UTC (rev 4440)
@@ -5,6 +5,7 @@
from matplotlib import verbose, __version__, rcParams
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
FigureManagerBase, FigureCanvasBase
+from matplotlib.backends.backend_mixed import MixedModeRenderer
from matplotlib.cbook import is_string_like, is_writable_file_like
from matplotlib.colors import rgb2hex
from matplotlib.figure import Figure
@@ -93,7 +94,7 @@
return 'fill: %s; stroke: %s; stroke-width: %s; ' \
'stroke-linejoin: %s; stroke-linecap: %s; %s opacity: %s' % (
fill,
- rgb2hex(gc.get_rgb()),
+ rgb2hex(gc.get_rgb()[:3]),
linewidth,
gc.get_joinstyle(),
_capstyle_d[gc.get_capstyle()],
@@ -288,14 +289,12 @@
font.set_text(s, 0.0, flags=LOAD_NO_HINTING)
y -= font.get_descent() / 64.0
-thetext = escape_xml_text(s)
-fontfamily = font.family_name
-fontstyle = prop.get_style()
fontsize = prop.get_size_in_points()
-color = rgb2hex(gc.get_rgb())
+color = rgb2hex(gc.get_rgb()[:3])
if rcParams['svg.embed_char_paths']:
-svg = ['\n')
@@ -501,34 +504,23 @@
'svgz': 'Scalable Vector Graphics'}
def print_svg(self, filename, *args, **kwargs):
-if is_string_like(filename):
-fh_to_close = svgwriter = codecs.open(filename, 'w', 'utf-8')
-elif is_writable_file_like(filename):
-svgwriter = codecs.EncodedFile(filename, 'utf-8')
-fh_to_close = None
-else:
-raise ValueError("filename must be a path or a file-like object")
-return self._print_svg(filename, svgwriter, fh_to_close)
-
+svgwriter = codecs.open(filename, 'w', 'utf-8')
+return self._print_svg(filename, svgwriter)
+
def print_svgz(self, filename, *args, **kwargs):
-if is_string_like(filename):
-gzipwriter = gzip.GzipFile(filename, 'w')
-fh_to_close = svgwriter =
SF.net SVN: matplotlib: [4441] trunk/matplotlib/lib/matplotlib/backends/ backend_svg.py
Revision: 4441 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4441&view=rev Author: mdboom Date: 2007-11-26 07:31:54 -0800 (Mon, 26 Nov 2007) Log Message: --- Fix colored text in SVG backend. Modified Paths: -- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py === --- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2007-11-26 15:30:12 UTC (rev 4440) +++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2007-11-26 15:31:54 UTC (rev 4441) @@ -246,14 +246,11 @@ font.set_text(s, 0.0, flags=LOAD_NO_HINTING) y -= font.get_descent() / 64.0 -thetext = escape_xml_text(s) -fontfamily = font.family_name -fontstyle = prop.get_style() fontsize = prop.get_size_in_points() color = rgb2hex(gc.get_rgb()) if rcParams['svg.embed_char_paths']: -svg = ['http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4442] trunk/matplotlib/lib/matplotlib/backends/ backend_svg.py
Revision: 4442
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4442&view=rev
Author: mdboom
Date: 2007-11-26 07:42:10 -0800 (Mon, 26 Nov 2007)
Log Message:
---
Reduce SVG file sizes.
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2007-11-26
15:31:54 UTC (rev 4441)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2007-11-26
15:42:10 UTC (rev 4442)
@@ -26,7 +26,7 @@
_capstyle_d = {'projecting' : 'square', 'butt' : 'butt', 'round': 'round',}
class RendererSVG(RendererBase):
-FONT_SCALE = 1200.0
+FONT_SCALE = 100.0
def __init__(self, width, height, svgwriter, basename=None):
self.width=width
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4443] trunk/matplotlib/lib/matplotlib/backends/ backend_svg.py
Revision: 4443
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4443&view=rev
Author: mdboom
Date: 2007-11-26 07:43:26 -0800 (Mon, 26 Nov 2007)
Log Message:
---
One more SVG color detail (in mathtext)
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2007-11-26
15:42:10 UTC (rev 4442)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2007-11-26
15:43:26 UTC (rev 4443)
@@ -409,7 +409,7 @@
svg.append('\n')
if len(svg_rects):
-style = "fill: black; stroke: none"
+style = "fill: %s; stroke: none" % color
svg.append('http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4444] branches/transforms
Revision:
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=&view=rev
Author: mdboom
Date: 2007-11-26 07:46:17 -0800 (Mon, 26 Nov 2007)
Log Message:
---
Merged revisions 4437-4443 via svnmerge from
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib
r4438 | mdboom | 2007-11-26 09:29:49 -0500 (Mon, 26 Nov 2007) | 2 lines
Minor speed improvements in mathtext. Removing trailing whitespace.
r4441 | mdboom | 2007-11-26 10:31:54 -0500 (Mon, 26 Nov 2007) | 2 lines
Fix colored text in SVG backend.
r4442 | mdboom | 2007-11-26 10:42:10 -0500 (Mon, 26 Nov 2007) | 2 lines
Reduce SVG file sizes.
r4443 | mdboom | 2007-11-26 10:43:26 -0500 (Mon, 26 Nov 2007) | 2 lines
One more SVG color detail (in mathtext)
Modified Paths:
--
branches/transforms/lib/matplotlib/backends/backend_svg.py
branches/transforms/lib/matplotlib/mathtext.py
Property Changed:
branches/transforms/
Property changes on: branches/transforms
___
Name: svnmerge-integrated
- /trunk/matplotlib:1-4436
+ /trunk/matplotlib:1-4443
Modified: branches/transforms/lib/matplotlib/backends/backend_svg.py
===
--- branches/transforms/lib/matplotlib/backends/backend_svg.py 2007-11-26
15:43:26 UTC (rev 4443)
+++ branches/transforms/lib/matplotlib/backends/backend_svg.py 2007-11-26
15:46:17 UTC (rev )
@@ -29,7 +29,7 @@
_capstyle_d = {'projecting' : 'square', 'butt' : 'butt', 'round': 'round',}
class RendererSVG(RendererBase):
-FONT_SCALE = 1200.0
+FONT_SCALE = 100.0
def __init__(self, width, height, svgwriter, basename=None):
self.width=width
@@ -293,7 +293,6 @@
color = rgb2hex(gc.get_rgb()[:3])
if rcParams['svg.embed_char_paths']:
-
svg = ['= 0xe000 and uniindex <= 0xf8ff):
fontname = 'nonuni' + fontname
return fontname, uniindex
-
+
_size_alternatives = {}
def get_sized_alternatives_for_symbol(self, fontname, sym):
alternatives = self._size_alternatives.get(sym)
@@ -919,7 +921,14 @@
self._size_alternatives[sym] = alternatives
return alternatives
-
+
+class StixSansFonts(StixFonts):
+"""
+A font handling class for the STIX fonts (using sans-serif
+characters by default).
+"""
+_sans = True
+
class StandardPsFonts(Fonts):
"""
Use the standard postscript fonts for rendering to backend_ps
@@ -1085,7 +1094,8 @@
# Note that (as TeX) y increases downward, unlike many other parts of
# matplotlib.
-# How much text shrinks when going to the next-smallest level
+# How much text shrinks when going to the next-smallest level. GROW_FACTOR
+# must be the inverse of SHRINK_FACTOR.
SHRINK_FACTOR = 0.7
GROW_FACTOR = 1.0 / SHRINK_FACTOR
# The number of different sizes of chars to use, beyond which they will not
@@ -1160,10 +1170,16 @@
pass
class Vbox(Box):
+"""
+A box with only height (zero width).
+"""
def __init__(self, height, depth):
Box.__init__(self, 0., height, depth)
class Hbox(Box):
+"""
+A box with only width (zero height and depth).
+"""
def __init__(self, width):
Box.__init__(self, width, 0., 0.)
@@ -1241,8 +1257,9 @@
self.depth*= GROW_FACTOR
class Accent(Char):
-"""The font metrics need to be dealt with differently for accents, since
they
-are already offset correctly from the baseline in TrueType fonts."""
+"""The font metrics need to be dealt with differently for accents,
+since they are already offset correctly from the baseline in
+TrueType fonts."""
def _update_metrics(self):
metrics = self._metrics = self.font_output.get_metrics(
self.font, self.font_class, self.c, self.fontsize, self.dpi)
@@ -1741,7 +1758,7 @@
self.cur_s+= 1
self.max_push = max(self.cur_s, self.max_push)
clamp = self.clamp
-
+
for p in box.children:
if isinstance(p, Char):
p.render(self.cur_h + self.off_h, self.cur_v + self.off_v)
@@ -1864,7 +1881,7 @@
empty = Empty()
empty.setParseAction(raise_error)
return empty
-
+
class Parser(object):
_binary_operators = Set(r'''
+ *
@@ -1922,7 +1939,7 @@
_dropsub_symbols = Set(r'''\int \oint'''.split())
_fontnames = Set("rm cal it tt sf bf default bb frak circled scr".split())
-
+
_function_names = Set("""
arccos csc ker min arcsin deg lg Pr arctan det lim sec arg dim
liminf sin cos exp limsup sinh cosh gcd ln sup cot hom log tan
@@ -1935,7 +1952,7 @@
_leftDelim = Set(r"( [ { \lfloor \langle \lceil".split())
_rightDelim = Set(r") ] } \rfloor \rangle \rceil".split())
-
+
SF.net SVN: matplotlib: [4445] branches/transforms/src/_path.cpp
Revision: 4445
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4445&view=rev
Author: mdboom
Date: 2007-11-26 08:43:19 -0800 (Mon, 26 Nov 2007)
Log Message:
---
Fix compilation error on 64-bit platforms.
Modified Paths:
--
branches/transforms/src/_path.cpp
Modified: branches/transforms/src/_path.cpp
===
--- branches/transforms/src/_path.cpp 2007-11-26 15:46:17 UTC (rev )
+++ branches/transforms/src/_path.cpp 2007-11-26 16:43:19 UTC (rev 4445)
@@ -696,8 +696,9 @@
f = *(double*)(row1);
}
-result = (PyArrayObject*)PyArray_FromDims
- (PyArray_NDIM(vertices), PyArray_DIMS(vertices), PyArray_DOUBLE);
+result = (PyArrayObject*)PyArray_FromDimsAndDataAndDescr
+ (PyArray_NDIM(vertices), PyArray_DIMS(vertices),
+ PyArray_DescrFromType(PyArray_DOUBLE), NULL);
if (PyArray_NDIM(vertices) == 2) {
size_t n = PyArray_DIM(vertices, 0);
char* vertex_in = PyArray_BYTES(vertices);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4446] branches/transforms/lib/matplotlib/backends
Revision: 4446 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4446&view=rev Author: mdboom Date: 2007-11-26 08:52:53 -0800 (Mon, 26 Nov 2007) Log Message: --- Fix zooming with bounding box in Gtk and Qt backends (others seem to already work). Fix text rotation in Wx (non-Agg) backend. Modified Paths: -- branches/transforms/lib/matplotlib/backends/backend_gtk.py branches/transforms/lib/matplotlib/backends/backend_qt.py branches/transforms/lib/matplotlib/backends/backend_qt4.py branches/transforms/lib/matplotlib/backends/backend_wx.py Modified: branches/transforms/lib/matplotlib/backends/backend_gtk.py === --- branches/transforms/lib/matplotlib/backends/backend_gtk.py 2007-11-26 16:43:19 UTC (rev 4445) +++ branches/transforms/lib/matplotlib/backends/backend_gtk.py 2007-11-26 16:52:53 UTC (rev 4446) @@ -549,7 +549,7 @@ return ax = event.inaxes -l,b,w,h = [int(val) for val in ax.bbox.get_bounds()] +l,b,w,h = [int(val) for val in ax.bbox.bounds] b = int(height)-(b+h) axrect = l,b,w,h self._imageBack = axrect, drawable.get_image(*axrect) Modified: branches/transforms/lib/matplotlib/backends/backend_qt.py === --- branches/transforms/lib/matplotlib/backends/backend_qt.py 2007-11-26 16:43:19 UTC (rev 4445) +++ branches/transforms/lib/matplotlib/backends/backend_qt.py 2007-11-26 16:52:53 UTC (rev 4446) @@ -102,7 +102,7 @@ def mousePressEvent( self, event ): x = event.pos().x() # flipy so y=0 is bottom of canvas -y = self.figure.bbox.height() - event.pos().y() +y = self.figure.bbox.height - event.pos().y() button = self.buttond[event.button()] FigureCanvasBase.button_press_event( self, x, y, button ) if DEBUG: print 'button pressed:', event.button() Modified: branches/transforms/lib/matplotlib/backends/backend_qt4.py === --- branches/transforms/lib/matplotlib/backends/backend_qt4.py 2007-11-26 16:43:19 UTC (rev 4445) +++ branches/transforms/lib/matplotlib/backends/backend_qt4.py 2007-11-26 16:52:53 UTC (rev 4446) @@ -359,7 +359,7 @@ QtGui.QApplication.setOverrideCursor( QtGui.QCursor( cursord[cursor] ) ) def draw_rubberband( self, event, x0, y0, x1, y1 ): -height = self.canvas.figure.bbox.height() +height = self.canvas.figure.bbox.height y1 = height - y1 y0 = height - y0 Modified: branches/transforms/lib/matplotlib/backends/backend_wx.py === --- branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-11-26 16:43:19 UTC (rev 4445) +++ branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-11-26 16:52:53 UTC (rev 4446) @@ -343,10 +343,10 @@ if angle == 0.0: gfx_ctx.DrawText(s, x, y) else: -angle = angle / 180.0 * math.pi +rads = angle / 180.0 * math.pi xo = h * math.sin(rads) yo = h * math.cos(rads) -gfx_ctx.DrawRotatedText(s, x - xo, y - yo, angle) +gfx_ctx.DrawRotatedText(s, x - xo, y - yo, rads) gc.unselect() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4447] branches/transforms/src/_path.cpp
Revision: 4447
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4447&view=rev
Author: mdboom
Date: 2007-11-26 08:59:29 -0800 (Mon, 26 Nov 2007)
Log Message:
---
Fix compile error on 64-bit platforms.
Modified Paths:
--
branches/transforms/src/_path.cpp
Modified: branches/transforms/src/_path.cpp
===
--- branches/transforms/src/_path.cpp 2007-11-26 16:52:53 UTC (rev 4446)
+++ branches/transforms/src/_path.cpp 2007-11-26 16:59:29 UTC (rev 4447)
@@ -696,9 +696,10 @@
f = *(double*)(row1);
}
-result = (PyArrayObject*)PyArray_FromDimsAndDataAndDescr
- (PyArray_NDIM(vertices), PyArray_DIMS(vertices),
- PyArray_DescrFromType(PyArray_DOUBLE), NULL);
+result = (PyArrayObject*)PyArray_NewFromDescr
+ (&PyArray_Type, PyArray_DescrFromType(PyArray_DOUBLE),
+ PyArray_NDIM(vertices), PyArray_DIMS(vertices),
+ NULL, NULL, 0, NULL);
if (PyArray_NDIM(vertices) == 2) {
size_t n = PyArray_DIM(vertices, 0);
char* vertex_in = PyArray_BYTES(vertices);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4448] branches/transforms/src
Revision: 4448
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4448&view=rev
Author: mdboom
Date: 2007-11-26 09:23:18 -0800 (Mon, 26 Nov 2007)
Log Message:
---
Still trying to fix compile error on 64-bit platforms...
Modified Paths:
--
branches/transforms/src/_backend_agg.cpp
branches/transforms/src/_path.cpp
Modified: branches/transforms/src/_backend_agg.cpp
===
--- branches/transforms/src/_backend_agg.cpp2007-11-26 16:59:29 UTC (rev
4447)
+++ branches/transforms/src/_backend_agg.cpp2007-11-26 17:23:18 UTC (rev
4448)
@@ -1203,14 +1203,14 @@
antialiaseds[0] = Py::Int(antialiased ? 1 : 0);
if (showedges) {
-int dims[] = { 1, 4, 0 };
+npy_intp dims[] = { 1, 4, 0 };
double data[] = { 0, 0, 0, 1 };
edgecolors_obj = PyArray_SimpleNewFromData(2, dims, PyArray_DOUBLE,
(char*)data);
} else {
if (antialiased) {
edgecolors_obj = facecolors_obj;
} else {
- int dims[] = { 0, 0 };
+ npy_intp dims[] = { 0, 0 };
edgecolors_obj = PyArray_SimpleNew(1, dims, PyArray_DOUBLE);
}
}
Modified: branches/transforms/src/_path.cpp
===
--- branches/transforms/src/_path.cpp 2007-11-26 16:59:29 UTC (rev 4447)
+++ branches/transforms/src/_path.cpp 2007-11-26 17:23:18 UTC (rev 4448)
@@ -696,10 +696,12 @@
f = *(double*)(row1);
}
-result = (PyArrayObject*)PyArray_NewFromDescr
- (&PyArray_Type, PyArray_DescrFromType(PyArray_DOUBLE),
- PyArray_NDIM(vertices), PyArray_DIMS(vertices),
- NULL, NULL, 0, NULL);
+// I would have preferred to use PyArray_FromDims here, but on
+// 64-bit platforms, PyArray_DIMS() does not return the same thing
+// that PyArray_FromDims wants, requiring a copy, which I would
+// like to avoid in this critical section.
+result = (PyArrayObject*)PyArray_SimpleNew
+ (PyArray_NDIM(vertices), PyArray_DIMS(vertices), PyArray_DOUBLE);
if (PyArray_NDIM(vertices) == 2) {
size_t n = PyArray_DIM(vertices, 0);
char* vertex_in = PyArray_BYTES(vertices);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4450] trunk/toolkits/basemap/lib/dap/proxy.py
Revision: 4450
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4450&view=rev
Author: jswhit
Date: 2007-11-26 10:48:01 -0800 (Mon, 26 Nov 2007)
Log Message:
---
add missing file to dap package
Added Paths:
---
trunk/toolkits/basemap/lib/dap/proxy.py
Added: trunk/toolkits/basemap/lib/dap/proxy.py
===
--- trunk/toolkits/basemap/lib/dap/proxy.py (rev 0)
+++ trunk/toolkits/basemap/lib/dap/proxy.py 2007-11-26 18:48:01 UTC (rev
4450)
@@ -0,0 +1,147 @@
+from __future__ import division
+
+"""Proxy class to DAP data.
+
+This module implements a proxy object that behaves like an array and
+downloads data transparently from a DAP server when sliced. It is used
+when building a representation of the dataset, and should be not
+directly used.
+"""
+
+__author__ = "Roberto De Almeida <[EMAIL PROTECTED]>"
+
+import sys
+
+from dap.xdr import DapUnpacker
+from dap.helper import fix_slice
+from dap.util.http import openurl
+
+try:
+from numpy import ndarray as ndarray_
+except ImportError:
+ndarray_ = None
+
+
+class Proxy(object):
+"""
+A proxy to data stored in a DODS server.
+"""
+def __init__(self, url, id, shape, type, filters=None, cache=None,
username=None, password=None):
+self.url = url
+self.id = id
+self.shape = shape
+self.type = type
+
+self.filters = filters or []
+
+self.cache = cache
+self.username = username
+self.password = password
+
+def __iter__(self):
+return iter(self[:])
+
+def __getitem__(self, index):
+"""
+Download data from DAP server.
+
+When the proxy object is sliced, it build an URL from the slice
+and retrieves the data from the DAP server.
+"""
+# Build the base URL.
+url = '%s.dods?%s' % (self.url, self.id)
+
+if self.shape:
+# Fix the index for incomplete slices or ellipsis.
+index = fix_slice(len(self.shape), index)
+
+# Force index to tuple, to iterate over the slices.
+if not isinstance(index, tuple):
+index = index,
+
+# Iterate over the sliced dimensions.
+i = 0
+outshape = []
+for dimension in index:
+# If dimension is a slice, get start, step and stop.
+if isinstance(dimension, slice):
+start = dimension.start or 0
+step = dimension.step or 1
+if dimension.stop:
+stop = dimension.stop-1
+else:
+stop = self.shape[i]-1
+
+# Otherwise, retrieve a single value.
+else:
+start = dimension
+stop = dimension
+step = 1
+
+# When stop is not specified, use the shape.
+if stop == sys.maxint or stop > self.shape[i]-1:
+stop = self.shape[i]-1
+# Negative slices.
+elif stop < 0:
+stop = self.shape[i]+stop
+
+# Negative starting slices.
+if start < 0: start = self.shape[i]+start
+
+# Build the URL used to retrieve the data.
+url = '%s[%s:%s:%s]' % (url, str(start), str(step), str(stop))
+
+# outshape is a list of the slice dimensions.
+outshape.append(1+(stop-start)//step)
+
+# Update to next dimension.
+i += 1
+
+else:
+# No need to resize the data.
+outshape = None
+
+# Make the outshape consistent with the numpy and pytables conventions.
+if outshape is not None:
+outshape = self._reduce_outshape(outshape)
+
+# Check for filters.
+if self.filters:
+ce = '&'.join(self.filters)
+url = '%s&%s' % (url, ce)
+
+# Fetch data.
+resp, data = openurl(url, self.cache, self.username, self.password)
+
+# First lines are ASCII information that end with 'Data:\n'.
+start = data.index('Data:\n') + len('Data:\n')
+xdrdata = data[start:]
+
+# Unpack data.
+output = DapUnpacker(xdrdata, self.shape, self.type,
outshape).getvalue()
+
+# Convert length 1 arrays to scalars
+if ndarray_:
+if outshape == () and isinstance(output, ndarray_):
+output = output[0]
+
+return output
+
+
+def _reduce_outshape(self, outshape):
+"""Make the outshape consistent with the numpy and pytables
conventions.
+
+(1, N) -> (N,)
+(N, 1) -> (N,)
+(N, M, 1) -> (N, M)
+
+Basically, all ones are removed from the shape.
+"""
+return tuple([index for index
SF.net SVN: matplotlib: [4451] trunk/toolkits/basemap
Revision: 4451 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4451&view=rev Author: jswhit Date: 2007-11-26 10:58:41 -0800 (Mon, 26 Nov 2007) Log Message: --- add httplib2, since dap requires it. Modified Paths: -- trunk/toolkits/basemap/MANIFEST.in trunk/toolkits/basemap/setup.py Added Paths: --- trunk/toolkits/basemap/lib/httplib2/ trunk/toolkits/basemap/lib/httplib2/__init__.py trunk/toolkits/basemap/lib/httplib2/iri2uri.py Modified: trunk/toolkits/basemap/MANIFEST.in === --- trunk/toolkits/basemap/MANIFEST.in 2007-11-26 18:48:01 UTC (rev 4450) +++ trunk/toolkits/basemap/MANIFEST.in 2007-11-26 18:58:41 UTC (rev 4451) @@ -75,6 +75,7 @@ include MANIFEST.in recursive-include geos-2.2.3 * recursive-include lib/dap * +recursive-include lib/httplib2 * recursive-include lib/dbflib * recursive-include lib/shapelib * include lib/matplotlib/toolkits/basemap/data/5minmask.bin Added: trunk/toolkits/basemap/lib/httplib2/__init__.py === --- trunk/toolkits/basemap/lib/httplib2/__init__.py (rev 0) +++ trunk/toolkits/basemap/lib/httplib2/__init__.py 2007-11-26 18:58:41 UTC (rev 4451) @@ -0,0 +1,1123 @@ +from __future__ import generators +""" +httplib2 + +A caching http interface that supports ETags and gzip +to conserve bandwidth. + +Requires Python 2.3 or later + +Changelog: +2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. + +""" + +__author__ = "Joe Gregorio ([EMAIL PROTECTED])" +__copyright__ = "Copyright 2006, Joe Gregorio" +__contributors__ = ["Thomas Broyer ([EMAIL PROTECTED])", +"James Antill", +"Xavier Verges Farrero", +"Jonathan Feinberg", +"Blair Zajac", +"Sam Ruby", +"Louis Nyffenegger"] +__license__ = "MIT" +__version__ = "$Rev: 259 $" + +import re +import sys +import md5 +import email +import email.Utils +import email.Message +import StringIO +import gzip +import zlib +import httplib +import urlparse +import base64 +import os +import copy +import calendar +import time +import random +import sha +import hmac +from gettext import gettext as _ +import socket + +try: +import socks +except ImportError: +socks = None + +if sys.version_info >= (2,3): +from iri2uri import iri2uri +else: +def iri2uri(uri): +return uri + +__all__ = ['Http', 'Response', 'ProxyInfo', 'HttpLib2Error', + 'RedirectMissingLocation', 'RedirectLimit', 'FailedToDecompressContent', + 'UnimplementedDigestAuthOptionError', 'UnimplementedHmacDigestAuthOptionError', + 'debuglevel'] + + +# The httplib debug level, set to a non-zero value to get debug output +debuglevel = 0 + +# Python 2.3 support +if sys.version_info < (2,4): +def sorted(seq): +seq.sort() +return seq + +# Python 2.3 support +def HTTPResponse__getheaders(self): +"""Return list of (header, value) tuples.""" +if self.msg is None: +raise httplib.ResponseNotReady() +return self.msg.items() + +if not hasattr(httplib.HTTPResponse, 'getheaders'): +httplib.HTTPResponse.getheaders = HTTPResponse__getheaders + +# All exceptions raised here derive from HttpLib2Error +class HttpLib2Error(Exception): pass + +# Some exceptions can be caught and optionally +# be turned back into responses. +class HttpLib2ErrorWithResponse(HttpLib2Error): +def __init__(self, desc, response, content): +self.response = response +self.content = content +HttpLib2Error.__init__(self, desc) + +class RedirectMissingLocation(HttpLib2ErrorWithResponse): pass +class RedirectLimit(HttpLib2ErrorWithResponse): pass +class FailedToDecompressContent(HttpLib2ErrorWithResponse): pass +class UnimplementedDigestAuthOptionError(HttpLib2ErrorWithResponse): pass +class UnimplementedHmacDigestAuthOptionError(HttpLib2ErrorWithResponse): pass + +class RelativeURIError(HttpLib2Error): pass +class ServerNotFoundError(HttpLib2Error): pass + +# Open Items: +# --- +# Proxy support + +# Are we removing the cached content too soon on PUT (only delete on 200 Maybe?) + +# Pluggable cache storage (supports storing the cache in +# flat files by default. We need a plug-in architecture +# that can support Berkeley DB and Squid) + +# == Known Issues == +# Does not handle a resource that uses conneg and Last-Modified but no ETag as a cache validator. +# Does not handle Cache-Control: max-stale +# Does not use Age: headers when calculating cache freshness. + + +# The number of redirections to follow before giving up. +# Note that only GET redirects are automatically followed. +# Will also honor 301 requests by saving that info and never +# requesting that URI again. +DEFAULT_MAX_REDIRECTS = 5 + +# Which headers are hop-by-hop headers by default +HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers'
SF.net SVN: matplotlib: [4452] trunk/toolkits/basemap/setup.py
Revision: 4452
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4452&view=rev
Author: jswhit
Date: 2007-11-26 11:02:33 -0800 (Mon, 26 Nov 2007)
Log Message:
---
only install dap and httplib2 if not already available
Modified Paths:
--
trunk/toolkits/basemap/setup.py
Modified: trunk/toolkits/basemap/setup.py
===
--- trunk/toolkits/basemap/setup.py 2007-11-26 18:58:41 UTC (rev 4451)
+++ trunk/toolkits/basemap/setup.py 2007-11-26 19:02:33 UTC (rev 4452)
@@ -102,16 +102,17 @@
define_macros = dbf_macros()) ]
# install dap and httplib2, if not already available.
-#try:
-#from dap import client
-#except ImportError:
-packages = packages + ['dap','dap.util','dap.parsers']
-package_dirs['dap'] = os.path.join('lib','dap')
-#try:
-#import httplib2
-#except ImportError:
-packages = packages + ['httplib2']
-package_dirs['httlib2'] = os.path.join('lib','httplib2')
+# only a subset of dap is installed (the client, not the server)
+try:
+from dap import client
+except ImportError:
+packages = packages + ['dap','dap.util','dap.parsers']
+package_dirs['dap'] = os.path.join('lib','dap')
+try:
+import httplib2
+except ImportError:
+packages = packages + ['httplib2']
+package_dirs['httlib2'] = os.path.join('lib','httplib2')
if 'setuptools' in sys.modules:
# Are we running with setuptools?
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4453] trunk/toolkits/basemap/examples/README
Revision: 4453 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4453&view=rev Author: jswhit Date: 2007-11-26 11:03:56 -0800 (Mon, 26 Nov 2007) Log Message: --- update fcstmaps Modified Paths: -- trunk/toolkits/basemap/examples/README Modified: trunk/toolkits/basemap/examples/README === --- trunk/toolkits/basemap/examples/README 2007-11-26 19:02:33 UTC (rev 4452) +++ trunk/toolkits/basemap/examples/README 2007-11-26 19:03:56 UTC (rev 4453) @@ -48,10 +48,10 @@ geos_demo_2.py demonstrates how to read in a geostationary satellite image from a jpeg file, then plot only a portion of the full earth (contributed by Scott Sinclair, requires PIL). -fcstmaps.py is a sample multi-panel plot. Care is taken to preserve the aspect ratio of the map in each panel, and a common title and colorbar is created. -Requires the opendap module (http://opendap.oceanografia.org) and an -active internet connection to fetch the data to be plotted. +fcstmaps.py is a sample multi-panel plot that accesses +data over http using the dap module. An internet connection is required. + wiki_example.py is the example from the MatplotlibCookbook scipy wiki page (http://www.scipy.org/wikis/topical_software/MatplotlibCookbook/wikipage_view). @@ -104,4 +104,4 @@ run_all.py is a driver script that runs all the examples except fcstmaps.py, testgdal.py, geos_demo_2.py, warpimage.py, and pnganim.py (which -rely on external dependencies). +rely on external dependencies and/or an internet connection). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4454] trunk/toolkits/basemap
Revision: 4454
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4454&view=rev
Author: jswhit
Date: 2007-11-26 11:08:46 -0800 (Mon, 26 Nov 2007)
Log Message:
---
bump version number
Modified Paths:
--
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
trunk/toolkits/basemap/setup.py
Modified: trunk/toolkits/basemap/Changelog
===
--- trunk/toolkits/basemap/Changelog2007-11-26 19:03:56 UTC (rev 4453)
+++ trunk/toolkits/basemap/Changelog2007-11-26 19:08:46 UTC (rev 4454)
@@ -1,5 +1,6 @@
+version 0.9.8 (not yet released)
* modify NetCDFFile to use dap module to read remote
- datasets over http. Include dap module.
+ datasets over http. Include dap and httplib2 modules.
* modify NetCDFFile to automatically apply scale_factor
and add_offset, and return masked arrays masked where
data == missing_value or _FillValue.
Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
2007-11-26 19:03:56 UTC (rev 4453)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
2007-11-26 19:08:46 UTC (rev 4454)
@@ -19,7 +19,7 @@
# basemap data files now installed in lib/matplotlib/toolkits/basemap/data
basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
-__version__ = '0.9.7'
+__version__ = '0.9.8'
# supported map projections.
_projnames = {'cyl' : 'Cylindrical Equidistant',
Modified: trunk/toolkits/basemap/setup.py
===
--- trunk/toolkits/basemap/setup.py 2007-11-26 19:03:56 UTC (rev 4453)
+++ trunk/toolkits/basemap/setup.py 2007-11-26 19:08:46 UTC (rev 4454)
@@ -134,7 +134,7 @@
package_data =
{'matplotlib.toolkits.basemap':pyproj_datafiles+basemap_datafiles}
setup(
name = "basemap",
- version = "0.9.7",
+ version = "0.9.8",
description = "Plot data on map projections with matplotlib",
long_description = """
An add-on toolkit for matplotlib that lets you plot data
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4455] trunk/toolkits/basemap/examples/fcstmaps.py
Revision: 4455 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4455&view=rev Author: jswhit Date: 2007-11-26 11:14:29 -0800 (Mon, 26 Nov 2007) Log Message: --- adjust map projection region Modified Paths: -- trunk/toolkits/basemap/examples/fcstmaps.py Modified: trunk/toolkits/basemap/examples/fcstmaps.py === --- trunk/toolkits/basemap/examples/fcstmaps.py 2007-11-26 19:08:46 UTC (rev 4454) +++ trunk/toolkits/basemap/examples/fcstmaps.py 2007-11-26 19:14:29 UTC (rev 4455) @@ -84,9 +84,7 @@ t2min = t2mvar[0:ntimes,:,:] t2m = numpy.zeros((ntimes,nlats,nlons+1),t2min.dtype) # create Basemap instance for Orthographic projection. -m = Basemap(lon_0=-105,lat_0=40, -rsphere=6371200., -resolution='c',area_thresh=5000.,projection='ortho') +m = Basemap(lon_0=-90,lat_0=60,projection='ortho') # add wrap-around point in longitude. for nt in range(ntimes): t2m[nt,:,:], lons = addcyclic(t2min[nt,:,:], lons1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4456] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/pupynere.py
Revision: 4456
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4456&view=rev
Author: jswhit
Date: 2007-11-26 11:21:23 -0800 (Mon, 26 Nov 2007)
Log Message:
---
add docstring.
Modified Paths:
--
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
2007-11-26 19:14:29 UTC (rev 4455)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
2007-11-26 19:21:23 UTC (rev 4456)
@@ -52,10 +52,13 @@
_typecodes = dict([[_v,_k] for _k,_v in typemap.items()])
def NetCDFFile(file):
+"""NetCDF File reader. API is the same as Scientific.IO.NetCDF.
+if 'file' is a URL that starts with 'http', the pydap client is
+is used to read the data over http."""
if file.startswith('http'):
-return RemoteFile(file)
+return _RemoteFile(file)
else:
-return LocalFile(file)
+return _LocalFile(file)
def _maskandscale(var,datout):
if hasattr(var, 'missing_value') and (datout == var.missing_value).any():
@@ -68,7 +71,7 @@
pass
return datout
-class RemoteFile(object):
+class _RemoteFile(object):
"""A NetCDF file reader. API is the same as Scientific.IO.NetCDF."""
def __init__(self, file):
@@ -108,13 +111,13 @@
for k,d in self._buffer.iteritems():
if isinstance(d, GridType) or isinstance(d, ArrayType):
name = k
-self.variables[name] = RemoteVariable(d)
+self.variables[name] = _RemoveVariable(d)
def close(self):
self._buffer.close()
-class RemoteVariable(object):
+class _RemoveVariable(object):
def __init__(self, var):
self._var = var
self.dtype = var.type
@@ -134,7 +137,7 @@
return _typecodes[self.dtype]
-class LocalFile(object):
+class _LocalFile(object):
"""A NetCDF file reader. API is the same as Scientific.IO.NetCDF."""
def __init__(self, file):
@@ -266,7 +269,7 @@
# Read offset.
begin = [self._unpack_int, self._unpack_int64][self.version_byte-1]()
-return LocalVariable(self._buffer.fileno(), nc_type, vsize, begin,
shape, dimensions, attributes, isrec, self._recsize)
+return _LocalVariable(self._buffer.fileno(), nc_type, vsize, begin,
shape, dimensions, attributes, isrec, self._recsize)
def _read_values(self, n, nc_type):
bytes = [1, 1, 2, 4, 4, 8]
@@ -305,7 +308,7 @@
self._buffer.close()
-class LocalVariable(object):
+class _LocalVariable(object):
def __init__(self, fileno, nc_type, vsize, begin, shape, dimensions,
attributes, isrec=False, recsize=0):
self._nc_type = nc_type
self._vsize = vsize
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4457] trunk/matplotlib/lib/matplotlib
Revision: 4457 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4457&view=rev Author: jdh2358 Date: 2007-11-26 13:53:01 -0800 (Mon, 26 Nov 2007) Log Message: --- fixed a bug in unit processing -- thanks chris Modified Paths: -- trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/mlab.py Modified: trunk/matplotlib/lib/matplotlib/axes.py === --- trunk/matplotlib/lib/matplotlib/axes.py 2007-11-26 19:21:23 UTC (rev 4456) +++ trunk/matplotlib/lib/matplotlib/axes.py 2007-11-26 21:53:01 UTC (rev 4457) @@ -182,7 +182,7 @@ def __call__(self, *args, **kwargs): -if self.axes.xaxis is not None and self.axes.xaxis is not None: +if self.axes.xaxis is not None and self.axes.yaxis is not None: xunits = kwargs.pop( 'xunits', self.axes.xaxis.units) yunits = kwargs.pop( 'yunits', self.axes.yaxis.units) if xunits!=self.axes.xaxis.units: @@ -1289,6 +1289,8 @@ if self.axison and self._frameon: self.axesPatch.draw(renderer) artists = [] + + if len(self.images)<=1 or renderer.option_image_nocomposite(): for im in self.images: im.draw(renderer) @@ -3313,7 +3315,7 @@ self.hold(holdstate) # restore previous hold state if adjust_xlim: -xmin, xmax = self.dataLim.intervalx().get_bounds() +xmin, xmax = self.dataLim.intervalx().get_bounds() xmin = npy.amin(width) if xerr is not None: xmin = xmin - npy.amax(xerr) Modified: trunk/matplotlib/lib/matplotlib/mlab.py === --- trunk/matplotlib/lib/matplotlib/mlab.py 2007-11-26 19:21:23 UTC (rev 4456) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2007-11-26 21:53:01 UTC (rev 4457) @@ -14,10 +14,7 @@ * find - Return the indices where some condition is true; numpy.nonzero is similar but more general. -* polyfit - least squares best polynomial fit of x to y -* polyval - evaluate a vector for a vector of polynomial coeffs - * prctile - find the percentiles of a sequence * prepca - Principal Component Analysis @@ -29,11 +26,14 @@ The following are deprecated; please import directly from numpy (with care--function signatures may differ): + * conv - convolution (numpy.convolve) * corrcoef - The matrix of correlation coefficients * hist -- Histogram (numpy.histogram) * linspace -- Linear spaced array from min to max * meshgrid +* polyfit - least squares best polynomial fit of x to y +* polyval - evaluate a vector for a vector of polynomial coeffs * trapz - trapeziodal integration (trapz(x,y) -> numpy.trapz(y,x)) * vander - the Vandermonde matrix @@ -46,13 +46,13 @@ = record array helper functions = - rec2csv : store record array in CSV file - rec2excel: store record array in excel worksheet - required pyExcelerator - rec2gtk : put record array in GTK treeview - requires gtk - csv2rec : import record array from CSV file with type inspection - rec_append_field : add a field/array to record array - rec_drop_fields : drop fields from record array - rec_join : join two record arrays on sequence of fields + * rec2csv : store record array in CSV file + * rec2excel: store record array in excel worksheet - required pyExcelerator + * rec2gtk : put record array in GTK treeview - requires gtk + * csv2rec : import record array from CSV file with type inspection + * rec_append_field : add a field/array to record array + * rec_drop_fields : drop fields from record array + * rec_join : join two record arrays on sequence of fields For the rec viewer clases (rec2csv, rec2excel and rec2gtk), there are a bunch of Format objects you can pass into the functions that will do This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4458] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/pupynere.py
Revision: 4458 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4458&view=rev Author: jswhit Date: 2007-11-26 14:53:37 -0800 (Mon, 26 Nov 2007) Log Message: --- make close method a no-op for remote datasets. Modified Paths: -- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py === --- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py 2007-11-26 21:53:01 UTC (rev 4457) +++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py 2007-11-26 22:53:37 UTC (rev 4458) @@ -114,7 +114,8 @@ self.variables[name] = _RemoveVariable(d) def close(self): -self._buffer.close() +# this is a no-op provided for compatibility +pass class _RemoveVariable(object): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4459] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/pupynere.py
Revision: 4459
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4459&view=rev
Author: jswhit
Date: 2007-11-26 15:06:15 -0800 (Mon, 26 Nov 2007)
Log Message:
---
docstring modifications.
Modified Paths:
--
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
2007-11-26 22:53:37 UTC (rev 4458)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
2007-11-26 23:06:15 UTC (rev 4459)
@@ -53,8 +53,11 @@
def NetCDFFile(file):
"""NetCDF File reader. API is the same as Scientific.IO.NetCDF.
-if 'file' is a URL that starts with 'http', the pydap client is
-is used to read the data over http."""
+If 'file' is a URL that starts with 'http', it is assumed
+to be a remote OPenDAP dataest, and the python dap client is used
+to retrieve the data. Only the OPenDAP Array and Grid data
+types are recognized. If file does not start with 'http', it
+is assumed to be a local NetCDF file."""
if file.startswith('http'):
return _RemoteFile(file)
else:
@@ -361,8 +364,3 @@
def typecode(self):
return ['b', 'c', 'h', 'i', 'f', 'd'][self._nc_type-1]
-
-
-def _test():
-import doctest
-doctest.testmod()
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4460] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/pupynere.py
Revision: 4460 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4460&view=rev Author: jswhit Date: 2007-11-26 15:08:55 -0800 (Mon, 26 Nov 2007) Log Message: --- fix typo. Modified Paths: -- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py === --- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py 2007-11-26 23:06:15 UTC (rev 4459) +++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py 2007-11-26 23:08:55 UTC (rev 4460) @@ -114,14 +114,14 @@ for k,d in self._buffer.iteritems(): if isinstance(d, GridType) or isinstance(d, ArrayType): name = k -self.variables[name] = _RemoveVariable(d) +self.variables[name] = _RemoteVariable(d) def close(self): # this is a no-op provided for compatibility pass -class _RemoveVariable(object): +class _RemoteVariable(object): def __init__(self, var): self._var = var self.dtype = var.type This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4461] trunk/matplotlib/lib/matplotlib/axes.py
Revision: 4461 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4461&view=rev Author: efiring Date: 2007-11-26 18:24:22 -0800 (Mon, 26 Nov 2007) Log Message: --- Fixed pcolormesh bug Integer X input was causing Y to be turned into an integer as well. Modified Paths: -- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py === --- trunk/matplotlib/lib/matplotlib/axes.py 2007-11-26 23:08:55 UTC (rev 4460) +++ trunk/matplotlib/lib/matplotlib/axes.py 2007-11-27 02:24:22 UTC (rev 4461) @@ -4728,7 +4728,7 @@ X = X.ravel() Y = Y.ravel() -coords = npy.zeros(((Nx * Ny), 2), X.dtype) +coords = npy.zeros(((Nx * Ny), 2), dtype=float) coords[:, 0] = X coords[:, 1] = Y This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
