pytroll / aggdraw

Python package wrapping AGG2 drawing functionality
https://aggdraw.readthedocs.io/en/latest/
Other
98 stars 47 forks source link

Convert wrapper to Cython #45

Open djhoese opened 5 years ago

djhoese commented 5 years ago

As discussed in #37, one option to clean up the aggdraw code is to use cython. As mentioned in #43, I recently noticed that all of the classes in aggdraw are actually declared as factory functions instead of real classes. I don't think any of the aggdraw functionality requires this design so it would be nice if the classes were declared as real classes.

I think the best idea would be to convert the C++ file to cython. This should:

  1. Make the code easier to read
  2. Avoid compatibility issues with new versions of python
  3. Limit unicode/bytes issues and handling

I think this rewrite could wait until aggdraw 2.0 and could look at adding #3's functionality/updating the agg version.

ismaelharunid commented 4 years ago

Sounds great. Let's do this. However it might be worthwhile attempting an implementation in the current version just to get a better idea of strategy and functional redesign, I mean not as changing it but as in how it's implemented.