Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merge v0.98.x into v0.99.x #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
664 commits merged into from
Feb 20, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
664 commits
Select commit Hold shift + click to select a range
f7af8a3
special case 0,0 for atan2
jdh2358 Jun 8, 2009
f706540
Improve alignment of markers.
mdboom Jun 8, 2009
742dec4
Pixel-align even long sequences of rectilinear lines.
mdboom Jun 8, 2009
e89fc42
add video lecture link to nav bar
jdh2358 Jun 8, 2009
ad98851
mplot3d: really add docs
heeres Jun 8, 2009
77490a2
applied Goekhan's installation FAQ patch
jdh2358 Jun 8, 2009
46ba810
add rec_keep_fields w/ support for rec2txt
jdh2358 Jun 9, 2009
81be3d6
mplot3d: make Poly3DCollection ScalarMappable, support in Axes3D.plot…
heeres Jun 9, 2009
4b7cd92
Bug: 2671465 quiver plot adds unwanted lines to image
mdboom Jun 10, 2009
a505369
attempt to build win32 installers
jdh2358 Jun 10, 2009
cd5a2d7
jdh2358 Jun 10, 2009
b8cb4e7
Merged revisions 7209,7211 via svnmerge from
mdboom Jun 12, 2009
e66091d
readded the long lost IndexFormatter
jdh2358 Jun 12, 2009
e03489b
Call current mplot3d demos from backend_driver.py
jkseppan Jun 13, 2009
e3559d0
Introduce a rotation_mode property for the Text artist
leejjoon Jun 13, 2009
270a907
mplot3d: fix Axes3D.grid(), add axes3d.grid to matplotlibrc
heeres Jun 13, 2009
732fba5
partial cleanup of mlab and of the pylab imports from mlab
efiring Jun 14, 2009
c3ee376
Extend backend_driver.py to support running only some test directories
jkseppan Jun 14, 2009
3c782fc
added variant of sf patch 2805653 for specgram kwargs pass thru to im…
jdh2358 Jun 14, 2009
01518ca
fixed errorbar Nx2 docstring bug as described in sf bug 2804502
jdh2358 Jun 14, 2009
1a78c40
fixed a press/release pan bug when mouse button=2 as described in sf …
jdh2358 Jun 14, 2009
0e47038
Remove axes3d.py
heeres Jun 16, 2009
98bf3e9
fix sf bug 2806283 (patch by Joonas Paalasmaa)
leejjoon Jun 19, 2009
be69cd1
Merged revisions 7227 via svnmerge from
leejjoon Jun 19, 2009
55b8834
Merged revisions 7229 via svnmerge from
leejjoon Jun 21, 2009
4b147b4
axes_grid: floating_axis support added
leejjoon Jun 24, 2009
8002de5
backend_agg.draw_marker quantizes the main path
leejjoon Jun 24, 2009
c144376
backend_agg.draw_marker quantizes the main path (checking in a missed…
leejjoon Jun 24, 2009
89635df
some tweaks to csv2rec and rec2csv
jdh2358 Jun 24, 2009
fa3dc1f
legend supports CircleCollection.
leejjoon Jun 25, 2009
60ce564
axes_grid: doc update
leejjoon Jun 25, 2009
434b07e
axes_grid: doc update
leejjoon Jun 29, 2009
60e543d
Merged revisions 7245 via svnmerge from
mdboom Jul 1, 2009
eb7b8f1
axes_grid: respect angle and alignment of ticklabels
leejjoon Jul 3, 2009
3cc43b3
[2687673] Fix problems with Mollweide projection, enable it, and add …
mdboom Jul 6, 2009
1f46ee1
[2687673] Add abs() to delta check in Mollweide projection.
mdboom Jul 7, 2009
aa81be7
improve resizing behavior of qt4 backend
ddale Jul 8, 2009
b5ce8fa
Allow for broken wxversion in backend_wx
efiring Jul 10, 2009
788e117
Another fix for wxversion problem (thanks, Gael Varoquaux)
efiring Jul 10, 2009
8c15177
Merged revisions 7253 via svnmerge from
jdh2358 Jul 11, 2009
c8bbe29
added fillstyle property to Line2D
jdh2358 Jul 11, 2009
3209a77
Yet another iteration on the version checking in backend_wx
efiring Jul 11, 2009
accbd28
centered ticklabel examples
jdh2358 Jul 11, 2009
cc6fb08
use png icon on gtk for win32
jdh2358 Jul 12, 2009
16c4aec
Fix a few bugs in ConnectionStyle classes. Add ConnectionPatch.
leejjoon Jul 14, 2009
d1b07c0
Fix mplot3d bug with empty lists
heeres Jul 14, 2009
d7894c1
axes_grid : minor improvements in anchored_artists and inset_locator.
leejjoon Jul 14, 2009
e671b63
initial submission of the annotation guide.
leejjoon Jul 14, 2009
5a46304
mplot3d: add bar3d, improve z-sort, hist3d example
heeres Jul 17, 2009
8783111
Remove swig fossils remaining from old version of agg wrapper
efiring Jul 17, 2009
25f5a2d
Fix support for hatches without color fills to pdf and svg backends.
jkseppan Jul 18, 2009
1ce5984
fixed Axes.step docstring per sf bug 2823304
jdh2358 Jul 19, 2009
4794d80
Add translucent legend example from John Hunter's mailing list example.
dopplershift Jul 21, 2009
9d85c4a
Improved boilerplate.py so that it generates the correct signatures f…
jkseppan Jul 22, 2009
c2f00f4
add 'interp' keyword to griddata. Can be set to 'linear' to get faster
jswhit Jul 23, 2009
e714e7c
check for nonuniform grid spacing when using inter='linear' in griddata.
jswhit Jul 23, 2009
a16ad75
axes_grid: axisline respect rcParam's tick.direction
leejjoon Jul 23, 2009
611d429
axes_grid: tick_out support for axisline.AxisArtist
leejjoon Jul 23, 2009
3fc0407
merge from scikits.delaunay trunk
jswhit Jul 24, 2009
42ff471
Plot accepts scalar coordinates, e.g. plot(1, 2, 'r*')
efiring Jul 26, 2009
fffd84a
In findobj_demo, exclude patches from objects to be colored blue.
efiring Jul 27, 2009
9cfa335
Simplify plot argument handling code.
efiring Jul 27, 2009
2734a2a
axes_zoom_effect.py modified to use floats (instead of strings) for a…
leejjoon Jul 27, 2009
808b46b
added Tony's radar chart demo
jdh2358 Jul 28, 2009
c6bf0f7
Speed up quiver for large numbers of arrows; key tip given by Ray Speth.
efiring Jul 28, 2009
075e336
legend doc. update
leejjoon Jul 30, 2009
75ede62
User-generated colormaps are handled more easily.
efiring Jul 30, 2009
b8e5ec0
Cache the color data to reduce startup time.
efiring Jul 31, 2009
7974ec1
Removed the colormap data caching--it was trying to solve a non-problem.
efiring Jul 31, 2009
b0eaa13
make rgrids return grid, not tick, lines
jdh2358 Jul 31, 2009
858cab9
fixed pyplot typo in gridlines
jdh2358 Jul 31, 2009
ac387d1
Tagging 0.99.0.rc1 release
mdboom Jul 31, 2009
563a376
apply sf patches 2830233 and 2823885 for osx setup and 64 bit; thank…
jdh2358 Jul 31, 2009
de2cc28
revert setupext.py patch for osx; breaks my osx test build
jdh2358 Jul 31, 2009
a77613f
added miktex win32 patch from sf patch 2820194
jdh2358 Jul 31, 2009
2e80056
update the makefile for win32 build
jdh2358 Jul 31, 2009
82d4ef2
Applied Michiel's sf patch 2823885 to remove the /usr/X11R6 dirs from…
jdh2358 Aug 1, 2009
100ad8b
some fixes for the binary builds
jdh2358 Aug 1, 2009
2102885
more fixes for osx
jdh2358 Aug 1, 2009
7aa827f
update the readme with build requirements
jdh2358 Aug 1, 2009
a447613
handled sf bugs 2831556 and 2830525; better bar error messages and ba…
jdh2358 Aug 3, 2009
452dcc2
added two examples from Josh Hemann
jdh2358 Aug 3, 2009
9f46dc4
fixed rec2csv win32 file handle bug from sf patch 2831018
jdh2358 Aug 3, 2009
520f85a
removed a couple of cases of mlab.load
jdh2358 Aug 3, 2009
a400c35
Fixed boilerplate.py so it doesn't break the ReST docs.
jkseppan Aug 3, 2009
d0eb9fe
applied sf patch 2815064 (middle button events for wx) and patch 281…
jdh2358 Aug 4, 2009
48d7f3a
attach gtk events to mpl events -- fixes sf bug 2816580
jdh2358 Aug 4, 2009
54508af
some fixes for osx builds on rc2
jdh2358 Aug 5, 2009
7bd2748
remove dup gui event in enter/leave events in gtk
jdh2358 Aug 5, 2009
0cfc45d
fix typo in axes_divider.py. use nanmin, nanmax in angle_helper.py (p…
leejjoon Aug 5, 2009
dce0739
fixed an alpha colormapping bug posted on sf 2832575
jdh2358 Aug 5, 2009
8539b65
removed pylab load and save
jdh2358 Aug 6, 2009
3f1a8dd
tagging for 0.99 release
jdh2358 Aug 6, 2009
48df6e7
final build of 0.99.0
jdh2358 Aug 6, 2009
0ecfb47
update whats new
jdh2358 Aug 6, 2009
d659f5f
update whats new
jdh2358 Aug 6, 2009
bacfb89
some updates for the release docs
jdh2358 Aug 6, 2009
f5ae89a
fix legend bug ignoring CircleCollection
leejjoon Aug 6, 2009
6285c5e
some updates to site docs for release
jdh2358 Aug 6, 2009
f9867b0
hide colorbar_doc a bit
jdh2358 Aug 6, 2009
34e8a8f
Tweak solution for hiding colorbar_doc to sync with trunk.
dopplershift Aug 6, 2009
5130aa5
some doc fixes
jdh2358 Aug 7, 2009
ff1d270
don't fail on window icon load
jdh2358 Aug 7, 2009
a54cbfa
Restore default colormap behavior: no color (alpha = 0) for masked data
efiring Aug 8, 2009
862da50
replace list comps w/ numpy in mplot3d
jdh2358 Aug 8, 2009
aca89b1
clean up mplot3d examples: use pyplot noy pylab and numpy rather than…
jdh2358 Aug 8, 2009
cd88e29
two new examples using a compund path for a histogram; one animated
jdh2358 Aug 8, 2009
6433e8e
two new examples using a compund path for a histogram; one animated
jdh2358 Aug 8, 2009
f415347
use a class helper method to make the compound path from polys
jdh2358 Aug 8, 2009
bccaca5
simplify poly array in example
jdh2358 Aug 8, 2009
52f7369
Fix excessive line length in annotations.rst
efiring Aug 8, 2009
18a6e9c
patch from sage project: make unicode_safe safer
efiring Aug 10, 2009
04aedbb
Patch from Jason, sage project: prevent failure with tiny arrows.
efiring Aug 10, 2009
5c132e2
Sage patch, slightly modified, to improve tk/tcl detection.
efiring Aug 10, 2009
905bfd7
Fix bugs: #2830483 (axis scaling), 2834105 (z order problem)
heeres Aug 11, 2009
feaca46
update the contributing faq
jdh2358 Aug 12, 2009
a863457
do case insensitive color string matching, as suggested in sf bug 283…
jdh2358 Aug 12, 2009
b70182b
Typo in navigation_toolbar.rst.
efiring Aug 12, 2009
98e2869
add the pngs referenced by sphinx css; closes sf bug 2834121
jdh2358 Aug 13, 2009
33e86b8
Remove older versions of some functions in mlab.py; closes bug 2806535
efiring Aug 14, 2009
3949c80
Prevent exception when image is off screen and out of the axes.
efiring Aug 14, 2009
485ac24
Fix documentation about Axis.transAxis (thanks Jason Sage)
mdboom Aug 14, 2009
ff12479
some doc reorg
jdh2358 Aug 15, 2009
0473bb1
added transformations tut, did some reorg
jdh2358 Aug 15, 2009
ad423bd
added path tut
jdh2358 Aug 18, 2009
6cdfb53
added looking glass demo
jdh2358 Aug 18, 2009
daff5df
Fix some minor typos in the transforms tutorial
mdboom Aug 18, 2009
87ce331
Fix some minor typos in the transforms tutorial
mdboom Aug 18, 2009
3bd6415
Fix some minor typos in the paths tutorial
mdboom Aug 18, 2009
88cddc4
Remove calls to np.asarray(). This was breaking the use of masked ar…
dopplershift Aug 19, 2009
24eba09
fixed a fifo bug for the new transforms infrastructure
jdh2358 Aug 22, 2009
8bb2616
Fix typos found by Marc Desmarais and Nicolas Pinto
jkseppan Aug 22, 2009
4d6d9ff
added Ariel's max install patch
jdh2358 Aug 22, 2009
b7ad379
applied Ariel's mlab.cohere_pairs fixes
jdh2358 Aug 22, 2009
29f82f2
fix osx epd formatting bug in rest
jdh2358 Aug 22, 2009
a4b170c
added new makefile for osx builds
jdh2358 Aug 23, 2009
d4464b7
removed darwin lookup in setupext -- use make.osx install
jdh2358 Aug 23, 2009
a4bd1ca
removed darwin lookup in setupext -- use make.osx install
jdh2358 Aug 23, 2009
2da4663
tweaks to os x
jdh2358 Aug 23, 2009
c9ef229
fix some typos in the docs
jdh2358 Aug 23, 2009
6be06d2
more harness around locale
jdh2358 Aug 23, 2009
c817ae0
Support Line2D objects without associated Axes objects.
mdboom Aug 25, 2009
634e98d
Fix cohere_pairs docstring so it builds with new versions of Sphinx
mdboom Aug 25, 2009
cee6fe1
added Michael Sarahan's image tutorial from the scipy mpl sprint
jdh2358 Aug 29, 2009
369a15c
minor tweaks to the image tut
jdh2358 Aug 29, 2009
1d9fba6
Semilogx, semilogy ensure one axis is linear; patch by Tony Yu
efiring Aug 29, 2009
8e977f9
added minor kwarg to get_?ticklines and applied ginpu patch
jdh2358 Aug 30, 2009
0f125a7
applied Gael's ginput patch
jdh2358 Aug 30, 2009
7d4f37a
some unit cleanup; fix sf bug 2846058
jdh2358 Aug 30, 2009
3df6dfa
fix sf bug #2839919
leejjoon Aug 31, 2009
5051ae7
Update barb_demo.py with an example using masked arrays.
dopplershift Aug 31, 2009
f3dc262
Pull _parse_args out of Quiver and Barbs classes, as we have multiple…
dopplershift Aug 31, 2009
c5c1d65
Use atleast_1d instead of asanyarray. This allows passing in scalars…
dopplershift Aug 31, 2009
3e91b78
fix a bug in axes_grid.inset_locator.inset_axes
leejjoon Sep 4, 2009
42aa8a8
spines: fix 'axes' position bug (closes SF#2852168)
astraw Sep 5, 2009
13375bf
fix a bug in lib/matplotlib/bezier.py
leejjoon Sep 7, 2009
0ffefca
Include 'top' keyword argument in docstring for Figure.subplots_adjus…
dopplershift Sep 9, 2009
60be8fd
Fix some documentation warnings.
mdboom Sep 9, 2009
dc4908a
fix a bug in Line2D.draw method that produces invalid svg when the li…
leejjoon Sep 10, 2009
cfbcc83
bugfix: bounds checking in hexbin with extent specified (SF#2856228)
astraw Sep 11, 2009
569c6bb
minor tweaks to licensing devel doc
jdh2358 Sep 11, 2009
b152212
Fix bug in quiver angle kwarg, found when input angle array is not 1-D
efiring Sep 11, 2009
4ceb3fa
Backported quiver bug fix from trunk
efiring Sep 11, 2009
da75707
tagging for 99.1 release candiate
jdh2358 Sep 12, 2009
dea1147
Minor doc fixes
mdboom Sep 14, 2009
dc5175f
Don't fail on AFM files containing floating-point bounding boxes
jkseppan Sep 15, 2009
f7a2a21
Don't use wxversion with py2exe; fix by Werner Bruhin
efiring Sep 16, 2009
c8edcdd
Fix clip path in SVG backend.
mdboom Sep 17, 2009
30ba93f
Fix bug whereby non-finite values in the path were not being ignored …
mdboom Sep 17, 2009
2543b01
add make.osx to manifest
jdh2358 Sep 17, 2009
6354764
fix the legend bug that dash-style for LineCollections handle is set …
leejjoon Sep 17, 2009
55a5cfa
Fix garbled getp output
efiring Sep 18, 2009
1a987aa
Fix bug where subslicing was cutting polar lines off (because it was …
mdboom Sep 18, 2009
9c7ee1e
Fix bug in maxdict when replacing an existing item
efiring Sep 19, 2009
04198bf
Fix bug in mlab.demean, with axis = -1
efiring Sep 19, 2009
6688edb
Fix bug in bar affecting autoscaling with log axis
efiring Sep 19, 2009
737acdf
Prevent exception in case of missing height and depth information in …
jkseppan Sep 20, 2009
ab6cba9
Fix off-by-one error in dviread.Tfm
jkseppan Sep 20, 2009
8fd76a5
Fix usetex spacing errors in pdf backend.
jkseppan Sep 20, 2009
364d3e4
Fix 'variable used before defined' errors in backend_pdf.py building …
mdboom Sep 21, 2009
2fdec7b
Correct typo of subtitle() -> suptitle().
dopplershift Sep 21, 2009
b867cc3
tag for 0.99.1 release
jdh2358 Sep 21, 2009
027891b
try statically linking in the deps for OSX
jdh2358 Sep 24, 2009
77ddd83
applied a fix for sf bug 2865490; is there something more elegant?
jdh2358 Sep 24, 2009
b27a3bc
Clip markers in draw_marker outside of the image rectangle with an ex…
mdboom Sep 24, 2009
5f53c0a
Fix bug in quiver handling of masked U, V
efiring Sep 25, 2009
3c11f76
Fix Grouper docstring -- it only supports weak-referenceable objects.
mdboom Sep 30, 2009
44b00fe
Fix alpha of Shadow patch.
mdboom Oct 1, 2009
02ea0e6
image created by imshow support remove method
leejjoon Oct 5, 2009
c337d9e
Tk directory-finding patch by Benjamin Drung.
efiring Oct 5, 2009
c233d0f
Add more platforms to setupext.py; patch by Benjamin Drung
efiring Oct 5, 2009
5b129b7
Don't do "make.py clean" in terms of svn-clean, since that doesn't wo…
mdboom Oct 6, 2009
c42d839
Don't perform path simplification when hatch is drawn.
mdboom Oct 9, 2009
d94b421
docstring fixup: LinearSegmentedColormap.from_list
efiring Oct 11, 2009
8c6bd9a
allow already transformed clip path in artist set_clip_path()
astraw Oct 11, 2009
eac5520
imshow: only apply axes patch clipping if image doesn't clip itself
astraw Oct 11, 2009
a67ea63
Don't simplify hatched paths in PDF, PS and SVG backends.
mdboom Oct 12, 2009
b488354
fix plot_directive.py that generated incorrect links for some cases
leejjoon Oct 12, 2009
daeeebb
Add AutoDateFormatter and AutoDateLocator to __all__ and to the modul…
dopplershift Oct 14, 2009
268fd73
fix Text.get_prop_tup omitting _rotation_mode. patch by Stan West
leejjoon Oct 16, 2009
f8fcc7f
fix a bug in plot_directive
leejjoon Oct 19, 2009
0b23945
Fix bug in simplification code that was clipping peaks.
mdboom Oct 21, 2009
166f870
Fix path simplification so the path always starts with a MOVETO.
mdboom Oct 22, 2009
9e09883
Support \# in mathtext.
mdboom Oct 23, 2009
3b149f1
axes_divider.py : fix a bug that axes has a wrong size when pack_star…
leejjoon Oct 25, 2009
f39e082
[2890345] pylab.thetagrids() does not accept fmt
mdboom Nov 2, 2009
08d18a5
[2890979] Close paths correctly in PolyCollection
mdboom Nov 3, 2009
6b7152f
[2880836] Save from toolbar changes directory with WX backend
mdboom Nov 3, 2009
d3bb176
[2889193] Rasterized output offset in pdf and ps
mdboom Nov 3, 2009
6e1071c
backport afm fix to branch
jdh2358 Nov 6, 2009
3b91de3
Add support for \widebar{} in mathtext (Thanks Sean Arms)
mdboom Nov 6, 2009
8c256b5
[2853659] Patch to fix EMF backend
mdboom Nov 12, 2009
4d4df54
Fix Normalize bug: ensure scalar output for scalar input.
efiring Nov 16, 2009
1751afd
Fix plot directive so it handles source files in various encodings.
mdboom Nov 18, 2009
f6c466e
make IndexFormatter derive from Formatter
jdh2358 Nov 23, 2009
63a39a0
[2902715] artist.set_clip_path does not handle tuple
mdboom Nov 24, 2009
1baad1b
Fix SF-2903596 on the 0.99.x branch
mdboom Nov 30, 2009
015b530
Fix bug in usage of "contains"
mdboom Nov 30, 2009
d12f935
[2906157] Let sphinx reference matplotlib-created plots (backport)
mdboom Dec 1, 2009
7bacaa6
[2903460] _path.pyd crashes in 0.99.1.win32-py2.6 on PIII CPU
mdboom Dec 3, 2009
80451bc
[2896454] subscripts and \mathrm don't get along, aka the long-standi…
mdboom Dec 3, 2009
1131d05
Mplot3d: fix scatter3d markers bug
heeres Dec 10, 2009
92181af
add mpl book to index sidebar
jdh2358 Dec 16, 2009
063dd0a
[2916753] Wrong API signature- yscale
mdboom Dec 31, 2009
8f703d3
Fix bug in PDF, PS, SVG and OS-X backends: do not simplify filled paths.
mdboom Jan 4, 2010
9673250
Fix doc 'clean'
mdboom Jan 4, 2010
c492ff8
update annotate documentation to explain *annotation_clip* parameter
leejjoon Jan 19, 2010
64b3b06
Fix for libpng-1.4 compatibility
mdboom Feb 8, 2010
24ccb6e
added Ariels csd patch for proper scaling at the dc component
jdh2358 Feb 8, 2010
4b2b829
fix a bug in Text._get_layout that returns an incorrect information f…
leejjoon Feb 16, 2010
90bf7a7
fix setters for regular polygon
jdh2358 Feb 22, 2010
19873d1
Backporting numpy version check fix to 0.99 branch
mdboom Feb 22, 2010
2ae4682
Fix offset_copy: the fig argument should be optional.
mdboom Feb 26, 2010
c13a681
added favicon
jdh2358 Mar 3, 2010
4f6f588
fix svnmerge download instructions
jdh2358 Mar 3, 2010
669153a
applied Mattias get_bounds patch
jdh2358 Mar 3, 2010
31f0f09
added support for favicon in docs build
jdh2358 Mar 3, 2010
94b7538
fix arguments of allow_rasterization.draw_wrapper
leejjoon Mar 3, 2010
9961ea4
fix a bug in SubplotDivider.new_horizontal that gave incrroect result…
leejjoon Mar 5, 2010
28c1572
dates.py: fix num2jul, jul2num; fixes bug 2963391; thanks to G. Licht…
efiring Mar 8, 2010
08d6b40
tagging for branch release candidate
jdh2358 Mar 9, 2010
f304ef5
remove micromicro version num
jdh2358 Mar 9, 2010
cfe5ca6
fix the bug that handles for scatter are incorrectly set when dpi!=72…
leejjoon Mar 13, 2010
3249383
fix ticker docstring bug
jdh2358 Mar 15, 2010
b60d7d8
patches.py: correct docstring in set_color
efiring Mar 16, 2010
bb8675c
Add 3d surface plot example (radial coordinates)
heeres Mar 19, 2010
da95d9e
added get_children offsetTex patch; closes sf 3001208
jdh2358 May 19, 2010
d559f6b
update version num for release
jdh2358 May 30, 2010
76448c8
fix the web page archive link to point to sf rather than nabble
jdh2358 Jun 4, 2010
df25e31
Merge branch 'v0.98.x' into v0.99.x
jkseppan Feb 20, 2011
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
412 changes: 399 additions & 13 deletions CHANGELOG

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions CXX/Config.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,20 @@
typedef int Py_ssize_t;
#endif

// hash_map container usage selection
// 1) if PYCXX_USING_STD_MAP is defined PyCXX will be using std::map<> container
// implementation only.
// 2) if compilers are used other than MS Visual Studio (7.1+) or GCC 3.x
// STANDARD_LIBRARY_HAS_HASH_MAP must be defined before compilation to
// make PyCXX using hash_map container.
#if !defined( PYCXX_USING_STD_MAP )
#if defined( _MSC_VER ) || defined( __INTEL_COMPILER ) || defined ( __ICC ) || (defined( __GNUC__ ) && ( __GNUC__ > 3 ))
# define PYCXX_USING_HASH_MAP
#else
# if defined( STANDARD_LIBRARY_HAS_HASH_MAP ) && !defined( PYCXX_USING_HASH_MAP )
# define PYCXX_USING_HASH_MAP
# endif
#endif
#endif

#endif // __PyCXX_config_hh__
155 changes: 146 additions & 9 deletions CXX/Extensions.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,108 @@ extern "C"
}

#include <vector>

// std::map / hash_map selection and declarations ----------------------------
#if !defined( PYCXX_USING_HASH_MAP )

#include <map>

#else

#if defined( __GNUC__) && !defined( _STLPORT_VERSION )
#include <ext/hash_map>
#else
#include <hash_map>
#endif
#if defined( _STLPORT_VERSION )
#define __PYCXX_HASHMAP_NAMESPACE std
using namespace std;
#elif defined ( _MSC_VER ) && !defined( __INTEL_COMPILER ) && !defined( __ICC ) && !defined( __ICL ) && !defined( __ECC )
#define __PYCXX_HASHMAP_NAMESPACE stdext
using namespace stdext;
#elif defined( __INTEL_COMPILER ) || defined( __ICC ) || defined( __ICL ) || defined( __ECC )
#define __PYCXX_HASHMAP_NAMESPACE stdext
using namespace stdext;
#elif defined( __GNUC__ )
#define __PYCXX_HASHMAP_NAMESPACE __gnu_cxx
using namespace __gnu_cxx;
#else
#define __PYCXX_HASHMAP_NAMESPACE std
using namespace std;
#endif

class __pycxx_str_hash_func
{
public:
enum
{
// parameters for hash table
bucket_size = 4, // 0 < bucket_size
min_buckets = 8 // min_buckets = 2 ^^ N, 0 < N
};

// http://www.azillionmonkeys.com/qed/hash.html
size_t operator()( const std::string &str ) const
{
const unsigned char * data = reinterpret_cast<const unsigned char *>( str.c_str() );
int len = (int)str.length();
unsigned int hash = len;
unsigned int tmp;
int rem;

if (len <= 0 || data == NULL)
return 0;

rem = len & 3;
len >>= 2;

/* Main loop */
for (;len > 0; len--)
{
hash += (data[1] << 8) | data[0];
tmp = (((data[3] << 8) | data[2]) << 11) ^ hash;
hash = (hash << 16) ^ tmp;
data += 2*sizeof (unsigned short);
hash += hash >> 11;
}

/* Handle end cases */
switch (rem)
{
case 3: hash += (data[1] << 8) | data[0];
hash ^= hash << 16;
hash ^= data[sizeof (unsigned short)] << 18;
hash += hash >> 11;
break;
case 2: hash += (data[1] << 8) | data[0];
hash ^= hash << 11;
hash += hash >> 17;
break;
case 1: hash += *data;
hash ^= hash << 10;
hash += hash >> 1;
}

/* Force "avalanching" of final 127 bits */
hash ^= hash << 3;
hash += hash >> 5;
hash ^= hash << 4;
hash += hash >> 17;
hash ^= hash << 25;
hash += hash >> 6;

return hash;
}

bool operator()(const std::string &str_1, const std::string &str_2) const
{
// test if str_1 ordered before str_2
return str_1 < str_2;
}
};
#endif // PYCXX_USING_HASH_MAP
// ----------------------------------------------------------------------

namespace Py
{
class ExtensionModuleBase;
Expand Down Expand Up @@ -205,7 +305,12 @@ namespace Py
protected:
typedef Object (T::*method_varargs_function_t)( const Tuple &args );
typedef Object (T::*method_keyword_function_t)( const Tuple &args, const Dict &kws );

#if defined( PYCXX_USING_HASH_MAP )
typedef __PYCXX_HASHMAP_NAMESPACE::hash_map<std::string, MethodDefExt<T> *, __pycxx_str_hash_func> method_map_t;
#else
typedef std::map<std::string,MethodDefExt<T> *> method_map_t;
#endif

static void add_varargs_method( const char *name, method_varargs_function_t function, const char *doc="" )
{
Expand Down Expand Up @@ -247,7 +352,7 @@ namespace Py
// so that we get called back at the function in T.
//
method_map_t &mm = methods();
EXPLICIT_TYPENAME method_map_t::iterator i;
EXPLICIT_TYPENAME method_map_t::const_iterator i;

for( i=mm.begin(); i != mm.end(); ++i )
{
Expand Down Expand Up @@ -349,6 +454,9 @@ namespace Py
PythonType & supportGetattro(void);
PythonType & supportSetattro(void);
PythonType & supportCompare(void);
#if PY_MAJOR_VERSION > 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 1)
PythonType & supportRichCompare(void);
#endif
PythonType & supportRepr(void);
PythonType & supportStr(void);
PythonType & supportHash(void);
Expand Down Expand Up @@ -416,6 +524,7 @@ namespace Py
virtual Object getattro( const Object & );
virtual int setattro( const Object &, const Object & );
virtual int compare( const Object & );
virtual Object rich_compare( const Object &, int op );
virtual Object repr();
virtual Object str();
virtual long hash();
Expand Down Expand Up @@ -539,7 +648,12 @@ namespace Py

typedef Object (T::*method_varargs_function_t)( const Tuple &args );
typedef Object (T::*method_keyword_function_t)( const Tuple &args, const Dict &kws );

#if defined( PYCXX_USING_HASH_MAP )
typedef __PYCXX_HASHMAP_NAMESPACE::hash_map<std::string, MethodDefExt<T> *, __pycxx_str_hash_func> method_map_t;
#else
typedef std::map<std::string,MethodDefExt<T> *> method_map_t;
#endif

// support the default attributes, __name__, __doc__ and methods
virtual Object getattr_default( const char *_name )
Expand Down Expand Up @@ -579,26 +693,29 @@ namespace Py

method_map_t &mm = methods();

EXPLICIT_TYPENAME method_map_t::const_iterator i;

if( name == "__methods__" )
{
List methods;

for( EXPLICIT_TYPENAME method_map_t::iterator i = mm.begin(); i != mm.end(); ++i )
for( i = mm.begin(); i != mm.end(); ++i )
methods.append( String( (*i).first ) );

return methods;
}

// see if name exists
if( mm.find( name ) == mm.end() )
// see if name exists and get entry with method
i = mm.find( name );
if( i == mm.end() )
throw AttributeError( name );

Tuple self( 2 );

self[0] = Object( this );
self[1] = String( name );

MethodDefExt<T> *method_definition = mm[ name ];
MethodDefExt<T> *method_definition = i->second;

PyObject *func = PyCFunction_New( &method_definition->ext_meth_def, self.ptr() );

Expand All @@ -609,6 +726,12 @@ namespace Py
{
method_map_t &mm = methods();

// check that all methods added are unique
EXPLICIT_TYPENAME method_map_t::const_iterator i;
i = mm.find( name );
if( i != mm.end() )
throw AttributeError( name );

MethodDefExt<T> *method_definition = new MethodDefExt<T>
(
name,
Expand All @@ -624,6 +747,12 @@ namespace Py
{
method_map_t &mm = methods();

// check that all methods added are unique
EXPLICIT_TYPENAME method_map_t::const_iterator i;
i = mm.find( name );
if( i != mm.end() )
throw AttributeError( name );

MethodDefExt<T> *method_definition = new MethodDefExt<T>
(
name,
Expand Down Expand Up @@ -657,10 +786,14 @@ namespace Py
String name( self_and_name_tuple[1] );

method_map_t &mm = methods();
MethodDefExt<T> *meth_def = mm[ name ];
if( meth_def == NULL )

EXPLICIT_TYPENAME method_map_t::const_iterator i;
i = mm.find( name );
if( i == mm.end() )
return 0;

MethodDefExt<T> *meth_def = i->second;

Tuple args( _args );

// _keywords may be NULL so be careful about the way the dict is created
Expand Down Expand Up @@ -690,10 +823,14 @@ namespace Py
String name( self_and_name_tuple[1] );

method_map_t &mm = methods();
MethodDefExt<T> *meth_def = mm[ name ];
if( meth_def == NULL )

EXPLICIT_TYPENAME method_map_t::const_iterator i;
i = mm.find( name );
if( i == mm.end() )
return 0;

MethodDefExt<T> *meth_def = i->second;

Tuple args( _args );

Object result;
Expand Down
14 changes: 14 additions & 0 deletions CXX/IndirectPythonInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ bool _File_Check( PyObject *op ) { return (op)->ob_type == _File_Type(); }
bool _Float_Check( PyObject *op ) { return (op)->ob_type == _Float_Type(); }
bool _Function_Check( PyObject *op ) { return (op)->ob_type == _Function_Type(); }
bool _Instance_Check( PyObject *op ) { return (op)->ob_type == _Instance_Type(); }
bool _Boolean_Check( PyObject *op ) { return (op)->ob_type == _Bool_Type(); }
bool _Int_Check( PyObject *op ) { return (op)->ob_type == _Int_Type(); }
bool _List_Check( PyObject *o ) { return o->ob_type == _List_Type(); }
bool _Long_Check( PyObject *op ) { return (op)->ob_type == _Long_Type(); }
Expand Down Expand Up @@ -116,6 +117,9 @@ static PyObject *ptr__Exc_UnicodeError = NULL;

static PyObject *ptr__PyNone = NULL;

static PyObject *ptr__PyFalse = NULL;
static PyObject *ptr__PyTrue = NULL;

static PyTypeObject *ptr__Buffer_Type = NULL;
static PyTypeObject *ptr__CFunction_Type = NULL;
static PyTypeObject *ptr__Class_Type = NULL;
Expand Down Expand Up @@ -300,6 +304,9 @@ bool InitialisePythonIndirectInterface()
#endif
ptr__PyNone = GetPyObject_As_PyObjectPointer( "_Py_NoneStruct" );

ptr__PyFalse = GetPyObject_As_PyObjectPointer( "_Py_ZeroStruct" );
ptr__PyTrue = GetPyObject_As_PyObjectPointer( "_Py_TrueStruct" );

ptr__Buffer_Type = GetPyTypeObject_As_PyTypeObjectPointer( "PyBuffer_Type" );
ptr__CFunction_Type = GetPyTypeObject_As_PyTypeObjectPointer( "PyCFunction_Type" );
ptr__Class_Type = GetPyTypeObject_As_PyTypeObjectPointer( "PyClass_Type" );
Expand Down Expand Up @@ -385,6 +392,8 @@ PyObject * _Exc_UnicodeError() { return ptr__Exc_UnicodeError; }
//
PyObject * _None() { return ptr__PyNone; }

PyObject * _False() { return ptr__PyFalse; }
PyObject * _True() { return ptr__PyTrue; }

PyTypeObject * _Buffer_Type() { return ptr__Buffer_Type; }
PyTypeObject * _CFunction_Type(){ return ptr__CFunction_Type; }
Expand All @@ -396,6 +405,7 @@ PyTypeObject * _File_Type() { return ptr__File_Type; }
PyTypeObject * _Float_Type() { return ptr__Float_Type; }
PyTypeObject * _Function_Type() { return ptr__Function_Type; }
PyTypeObject * _Instance_Type() { return ptr__Instance_Type; }
PyTypeObject * _Bool_Type() { return ptr__Bool_Type; }
PyTypeObject * _Int_Type() { return ptr__Int_Type; }
PyTypeObject * _List_Type() { return ptr__List_Type; }
PyTypeObject * _Long_Type() { return ptr__Long_Type; }
Expand Down Expand Up @@ -526,6 +536,9 @@ PyObject * _Exc_UnicodeError() { return ::PyExc_UnicodeError; }
//
PyObject * _None() { return &::_Py_NoneStruct; }

PyObject * _False() { return Py_False; }
PyObject * _True() { return Py_True; }

PyTypeObject * _Buffer_Type() { return &PyBuffer_Type; }
PyTypeObject * _CFunction_Type() { return &PyCFunction_Type; }
PyTypeObject * _Class_Type() { return &PyClass_Type; }
Expand All @@ -536,6 +549,7 @@ PyTypeObject * _File_Type() { return &PyFile_Type; }
PyTypeObject * _Float_Type() { return &PyFloat_Type; }
PyTypeObject * _Function_Type() { return &PyFunction_Type; }
PyTypeObject * _Instance_Type() { return &PyInstance_Type; }
PyTypeObject * _Bool_Type() { return &PyBool_Type; }
PyTypeObject * _Int_Type() { return &PyInt_Type; }
PyTypeObject * _List_Type() { return &PyList_Type; }
PyTypeObject * _Long_Type() { return &PyLong_Type; }
Expand Down
7 changes: 6 additions & 1 deletion CXX/IndirectPythonInterface.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ PyObject * _Exc_UnicodeError();
//
PyObject * _None();

PyObject * _False();
PyObject * _True();

//
// Wrap Type variables as function calls
Expand Down Expand Up @@ -132,6 +134,9 @@ bool _Frame_Check( PyObject *op );
PyTypeObject * _Function_Type();
bool _Function_Check( PyObject *op );

PyTypeObject * _Bool_Type();
bool _Boolean_Check( PyObject *op );

PyTypeObject * _Int_Type();
bool _Int_Check( PyObject *op );

Expand Down Expand Up @@ -188,6 +193,6 @@ void _XINCREF( PyObject *op );
void _XDECREF( PyObject *op );

char *__Py_PackageContext();
};
}

#endif // __CXX_INDIRECT_PYTHON_INTERFACE__HXX__
Loading