Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Convert Agg extension to pybind11#27011

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ksunden merged 6 commits intomatplotlib:mainfromQuLogic:agg-pybind11
Sep 19, 2024
Merged

Conversation

QuLogic
Copy link
Member

PR summary

This is somewhat partially implemented, in that the NumPy array parts are not changed yet. I think I'll want to do path first, to make this simpler. I'll leave this as draft until then.

PR checklist

@QuLogic
Copy link
MemberAuthor

I rebased this on top of#27087 so that I can re-use the type casters that it has. However, there is still an issue with theGCAgg type caster, but I'll leave that for when the other PR is in.

@ianthomas23
Copy link
Member

@QuLogic When you have time and motivation to come back to this, ping me and I will review it.

auto should_simplify = src.attr("should_simplify").cast<bool>();
auto simplify_threshold = src.attr("simplify_threshold").cast<double>();

if (!value.set(vertices.ptr(), codes.ptr(),
if (!value.set(vertices.inc_ref().ptr(), codes.inc_ref().ptr(),
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't know why this change is needed now, but otherwise things randomly crash.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We think there are decrements in the iterator destructor there is a decr which we think we need to keep as there are still other usages of the iterators from c++ that we need to remove first.

should_simplify, simplify_threshold)) {
return false;
throw py::error_already_set();
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This was technically wrong before, but otherwise,pybind11 would substitute its own generic "cannot convert type PyType to C++Type" error message, so not fatal.

Comment on lines +286 to +289
/* value.clippath = src.attr("get_clip_path")().cast<ClipPath>(); */
convert_clippath(src.attr("get_clip_path")().ptr(), &value.clippath);
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If I leave the casting version in, then all sorts of memory corruption occurs, and I've yet to figure out why. Instead of wasting even more time on that now, I'd rather get this going, and once we drop NumPy headers, come back to clean this up properly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ok

@QuLogicQuLogicforce-pushed theagg-pybind11 branch 4 times, most recently from11ac056 to83a882bCompareSeptember 13, 2024 09:48
@QuLogic
Copy link
MemberAuthor

I rebased and added the usualnamespace py = pybind11;; this was left out earlier due to conflicts and has been fixed by other cleanup PRs (though I don't remember which now). I also converted the Agg-onlyarray_view usage to pybind11; the ones shared with_path will be left for a later PR (or it could be done here too, but this is large enough, I think?)

This is a _very_ straightforward port, and several parts can be cleanedup in future commits.
This only does the simple ones that are not shared with the pathextension. Those more complex ones will be done separately.
@ksundenksunden merged commitd4ea011 intomatplotlib:mainSep 19, 2024
44 checks passed
@QuLogicQuLogic deleted the agg-pybind11 branchSeptember 19, 2024 20:39
@QuLogicQuLogic mentioned this pull requestSep 21, 2024
1 task
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.10.0
Development

Successfully merging this pull request may close these issues.

5 participants
@QuLogic@ianthomas23@tacaswell@justinjhendrick@ksunden

[8]ページ先頭

©2009-2025 Movatter.jp