8000 Retool the setup.py infrastructure by mdboom · Pull Request #1454 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Retool the setup.py infrastructure #1454

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
merged 24 commits into from
Feb 26, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6aa7b29
First pass at making setup more sane.
mdboom Oct 8, 2012
4ae2fd2
Removing dateutils, pytz and six (external Python dependencies)
mdboom Oct 9, 2012
04a73b4
Fix a few bugs in the build.
mdboom Oct 9, 2012
bae0859
More fixes
mdboom Oct 9, 2012
9b408cd
setupegg.py is now redundant.
mdboom Nov 6, 2012
6f64971
Fix type in dates docs
mdboom Nov 6, 2012
088a267
Update INSTALL document to reflect new reality
mdboom Nov 6, 2012
7018842
Handle dateutil and pyparsing in the same manner as everything else.
mdboom Nov 6, 2012
49bd70a
Raise exception early if pyparsing and/or dateutil are not installed.
mdboom Nov 6, 2012
4d8c846
Fix pyparsing on python 3 check
mdboom Nov 6, 2012
7db8fe2
Fix build on Python 2.6
mdboom Nov 16, 2012
b81c917
Update Travis dependencies
mdboom Nov 16, 2012
4301543
Implement a better way to handle overflow in the Agg backend.
mdboom Nov 19, 2012
d93226e
Fix agg overflow test
mdboom Nov 19, 2012
5f41835
Make using an external PyCXX possible on != Python 2.7
mdboom Nov 19, 2012
ce1da9b
Fix infinite process recursion on Windows
mdboom Nov 20, 2012
e0735bf
Update to PyCXX 6.2.4
mdboom Nov 26, 2012
ee2f3f4
Update the CXX detection code to use the system PyCXX in more cases
mdboom Nov 26, 2012
8f95f1c
Fix compiler warnings about compare_handler
mdboom Nov 26, 2012
da76037
Attempting to fix Travis tests
mdboom Dec 7, 2012
b5443e2
Windows fixes from cgohlke
mdboom Dec 19, 2012
009b1a0
Fixups after rebase
mdboom Jan 16, 2013
0ed7228
multiprocessing doesn't work with Travis, so just skip the things tha…
mdboom Feb 25, 2013
5934e0e
Properly install the pylab module
mdboom Feb 25, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implement a better way to handle overflow in the Agg backend.
  • Loading branch information
mdboom committed Feb 25, 2013
commit 4301543c3df4990a9200d60ca94697f81205e863
9 changes: 4 additions & 5 deletions agg24/include/agg_rasterizer_cells_aa.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
#ifndef AGG_RASTERIZER_CELLS_AA_INCLUDED
#define AGG_RASTERIZER_CELLS_AA_INCLUDED

#include "CXX/Exception.hxx"
#include <exception>
#include <stdexcept>
#include <string.h>
#include <math.h>
#include "agg_math.h"
Expand Down Expand Up @@ -183,9 +182,9 @@ namespace agg
{
if((m_num_cells & cell_block_mask) == 0)
{
if(m_num_blocks >= cell_block_limit) {
throw Py::OverflowError(
"Agg rendering complexity exceeded. Consider downsampling or decimating your data.");
if (m_num_blocks >= cell_block_limit)
{
throw std::overflow_error("Allocated too many blocks");
}
allocate_block();
}
Expand Down
79 changes: 66 additions & 13 deletions src/_backend_agg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,11 @@ RendererAgg::render_clippath(const Py::Object& clippath,
rendererBaseAlphaMask.clear(agg::gray8(0, 0));
transformed_path_t transformed_clippath(clippath_iter, trans);
agg::conv_curve<transformed_path_t> curved_clippath(transformed_clippath);
theRasterizer.add_path(curved_clippath);
try {
theRasterizer.add_path(curved_clippath);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
rendererAlphaMask.color(agg::gray8(255, 255));
agg::render_scanlines(theRasterizer, scanlineAlphaMask, rendererAlphaMask);
lastclippath = clippath;
Expand Down Expand Up @@ -698,7 +702,11 @@ RendererAgg::draw_markers(const Py::Tuple& args)
unsigned fillSize = 0;
if (face.first)
{
theRasterizer.add_path(marker_path_curve);
try {
theRasterizer.add_path(marker_path_curve);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
agg::render_scanlines(theRasterizer, slineP8, scanlines);
fillSize = scanlines.byte_size();
if (fillSize >= MARKER_CACHE_SIZE)
Expand All @@ -713,7 +721,11 @@ RendererAgg::draw_markers(const Py::Tuple& args)
stroke.line_cap(gc.cap);
stroke.line_join(gc.join);
theRasterizer.reset();
theRasterizer.add_path(stroke);
try {
theRasterizer.add_path(stroke);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
agg::render_scanlines(theRasterizer, slineP8, scanlines);
unsigned strokeSize = scanlines.byte_size();
if (strokeSize >= MARKER_CACHE_SIZE)
Expand Down Expand Up @@ -980,7 +992,11 @@ RendererAgg::draw_text_image(const Py::Tuple& args)
span_gen_type output_span_generator(&image_span_generator, gc.color);
renderer_type ri(rendererBase, sa, output_span_generator);

theRasterizer.add_path(rect2);
try {
theRasterizer.add_path(rect2);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
agg::render_scanlines(theRasterizer, slineP8, ri);

return Py::Object();
Expand Down Expand Up @@ -1117,7 +1133,11 @@ RendererAgg::draw_image(const Py::Tuple& args)
amask_ren_type r(pfa);
renderer_type_alpha ri(r, sa, spans);

theRasterizer.add_path(rect2);
try {
theRasterizer.add_path(rect2);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
agg::render_scanlines(theRasterizer, slineP8, ri);
}
else
Expand All @@ -1131,7 +1151,11 @@ RendererAgg::draw_image(const Py::Tuple& args)
ren_type r(pixFmt);
renderer_type ri(r, sa, spans);

theRasterizer.add_path(rect2);
try {
theRasterizer.add_path(rect2);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
agg::render_scanlines(theRasterizer, slineP8, ri);
}

Expand Down Expand Up @@ -1166,7 +1190,11 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath,
// Render face
if (face.first)
{
theRasterizer.add_path(path);
try {
theRasterizer.add_path(path);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}

if (gc.isaa)
{
Expand Down Expand Up @@ -1233,9 +1261,17 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath,
rb.clear(agg::rgba(0.0, 0.0, 0.0, 0.0));
rs.color(gc.color);

theRasterizer.add_path(hatch_path_curve);
try {
theRasterizer.add_path(hatch_path_curve);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
agg::render_scanlines(theRasterizer, slineP8, rs);
theRasterizer.add_path(hatch_path_stroke);
try {
theRasterizer.add_path(hatch_path_stroke);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
agg::render_scanlines(theRasterizer, slineP8, rs);

// Put clipping back on, if originally set on entry to this
Expand All @@ -1252,7 +1288,11 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath,
agg::span_allocator<agg::rgba8> sa;
img_source_type img_src(hatch_img_pixf);
span_gen_type sg(img_src, 0, 0);
theRasterizer.add_path(path);
try {
theRasterizer.add_path(path);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
agg::render_scanlines_aa(theRasterizer, slineP8, rendererBase, sa, sg);
}

Expand All @@ -1270,7 +1310,11 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath,
stroke.width(linewidth);
stroke.line_cap(gc.cap);
stroke.line_join(gc.join);
theRasterizer.add_path(stroke);
try {
theRasterizer.add_path(stroke);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
}
else
{
Expand All @@ -1291,7 +1335,11 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath,
stroke.line_cap(gc.cap);
stroke.line_join(gc.join);
stroke.width(linewidth);
theRasterizer.add_path(stroke);
try {
theRasterizer.add_path(stroke);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what());
}
}

if (gc.isaa)
Expand Down Expand Up @@ -1888,7 +1936,12 @@ RendererAgg::_draw_gouraud_triangle(const double* points,
tpoints[4], tpoints[5],
0.5);

theRasterizer.add_path(span_gen);
try {
theRasterizer.add_path(span_gen);
} catch (std::overflow_error &e) {
throw Py::OverflowError(e.what()
);
}

if (has_clippath)
{
Expand Down
0