{"action":"created","comment":{"url":"https://api.github.com/repos/lsst/afw/pulls/comments/84552883","pull_request_review_id":5327584,"id":84552883,"diff_hunk":"@@ -21,16 +21,72 @@\n  */\n \n #include <pybind11/pybind11.h>\n-//#include <pybind11/operators.h>\n-//#include <pybind11/stl.h>\n+#include <pybind11/operators.h>\n+#include <pybind11/stl.h>\n+\n+#include \"numpy/arrayobject.h\"\n+#include \"ndarray/pybind11.h\"\n+#include \"ndarray/converter.h\"\n+\n+#include \"lsst/afw/math/BoundedField.h\"\n+#include \"lsst/afw/math/ChebyshevBoundedField.h\"\n \n namespace py = pybind11;\n+PYBIND11_DECLARE_HOLDER_TYPE(MyType, std::shared_ptr<MyType>);\n \n using namespace lsst::afw::math;\n \n PYBIND11_PLUGIN(_chebyshevBoundedField) {\n     py::module mod(\"_chebyshevBoundedField\", \"Python wrapper for afw _chebyshevBoundedField library\");\n+    \n+    if (_import_array() < 0) {\n+            PyErr_SetString(PyExc_ImportError, \"numpy.core.multiarray failed to import\");\n+            return nullptr;\n+    };\n \n+    /* ChebyshevBoundedFieldControl */\n+    py::class_<ChebyshevBoundedFieldControl>\n+        clsChebyshevBoundedFieldControl(mod, \"ChebyshevBoundedFieldControl\");\n+    /* ChebyshevBoundedFieldControl  Constructors */\n+    clsChebyshevBoundedFieldControl.def(py::init<>());\n+    /* ChebyshevBoundedFieldControl Members */\n+    clsChebyshevBoundedFieldControl.def_readwrite(\"orderX\", &ChebyshevBoundedFieldControl::orderX);\n+    clsChebyshevBoundedFieldControl.def_readwrite(\"orderY\", &ChebyshevBoundedFieldControl::orderY);\n+    clsChebyshevBoundedFieldControl.def_readwrite(\"triangular\", &ChebyshevBoundedFieldControl::triangular);\n+    \n+    typedef ChebyshevBoundedFieldControl Control;\n+    \n+    /* ChebyshevBoundedFieldControl */\n+    py::class_<ChebyshevBoundedField, std::shared_ptr<ChebyshevBoundedField>, BoundedField>\n+        clsChebyshevBoundedField(mod, \"ChebyshevBoundedField\");\n+    /* ChebyshevBoundedFieldControl  Constructors */\n+    clsChebyshevBoundedField.def(py::init<lsst::afw::geom::Box2I const &, ndarray::Array<double const,2,2>\n+        const &>());\n+    /* ChebyshevBoundedFieldControl  Operators */\n+    clsChebyshevBoundedField.def(\"__rmul__\", [](ChebyshevBoundedField &bf, double const scale){\n+            return bf*scale;\n+    }, py::is_operator());\n+    clsChebyshevBoundedField.def(\"__mul__\", [](ChebyshevBoundedField &bf, double const scale){\n+            return bf*scale;\n+    }, py::is_operator());","path":"python/lsst/afw/math/chebyshevBoundedField.cc","position":53,"original_position":53,"commit_id":"dc5308cd359e9d47ed32946c42a16b201072216c","original_commit_id":"dc5308cd359e9d47ed32946c42a16b201072216c","user":{"login":"pschella","id":211955,"avatar_url":"https://avatars.githubusercontent.com/u/211955?v=3","gravatar_id":"","url":"https://api.github.com/users/pschella","html_url":"https://github.com/pschella","followers_url":"https://api.github.com/users/pschella/followers","following_url":"https://api.github.com/users/pschella/following{/other_user}","gists_url":"https://api.github.com/users/pschella/gists{/gist_id}","starred_url":"https://api.github.com/users/pschella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pschella/subscriptions","organizations_url":"https://api.github.com/users/pschella/orgs","repos_url":"https://api.github.com/users/pschella/repos","events_url":"https://api.github.com/users/pschella/events{/privacy}","received_events_url":"https://api.github.com/users/pschella/received_events","type":"User","site_admin":false},"body":"In this case we could probably use `.def(py::self += double())` too (with the `pybind11/operators.h` header). But I'm not yet convinced about the nicest strategy for wrapping operators. We need to talk about this at some point. Until then, this is fine.","created_at":"2016-10-21T22:10:41Z","updated_at":"2016-10-21T22:10:41Z","html_url":"https://github.com/lsst/afw/pull/108#discussion_r84552883","pull_request_url":"https://api.github.com/repos/lsst/afw/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/lsst/afw/pulls/comments/84552883"},"html":{"href":"https://github.com/lsst/afw/pull/108#discussion_r84552883"},"pull_request":{"href":"https://api.github.com/repos/lsst/afw/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/lsst/afw/pulls/108","id":90451331,"html_url":"https://github.com/lsst/afw/pull/108","diff_url":"https://github.com/lsst/afw/pull/108.diff","patch_url":"https://github.com/lsst/afw/pull/108.patch","issue_url":"https://api.github.com/repos/lsst/afw/issues/108","number":108,"state":"open","locked":false,"title":"Wrap afw::math with pybind11 instead of swig","user":{"login":"pschella","id":211955,"avatar_url":"https://avatars.githubusercontent.com/u/211955?v=3","gravatar_id":"","url":"https://api.github.com/users/pschella","html_url":"https://github.com/pschella","followers_url":"https://api.github.com/users/pschella/followers","following_url":"https://api.github.com/users/pschella/following{/other_user}","gists_url":"https://api.github.com/users/pschella/gists{/gist_id}","starred_url":"https://api.github.com/users/pschella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pschella/subscriptions","organizations_url":"https://api.github.com/users/pschella/orgs","repos_url":"https://api.github.com/users/pschella/repos","events_url":"https://api.github.com/users/pschella/events{/privacy}","received_events_url":"https://api.github.com/users/pschella/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-21T22:03:13Z","updated_at":"2016-10-21T22:10:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ec85a9fee3a4362f89db08b3be0c04938c0515c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/lsst/afw/pulls/108/commits","review_comments_url":"https://api.github.com/repos/lsst/afw/pulls/108/comments","review_comment_url":"https://api.github.com/repos/lsst/afw/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lsst/afw/issues/108/comments","statuses_url":"https://api.github.com/repos/lsst/afw/statuses/dc5308cd359e9d47ed32946c42a16b201072216c","head":{"label":"lsst:tickets/DM-6298","ref":"tickets/DM-6298","sha":"dc5308cd359e9d47ed32946c42a16b201072216c","user":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"repo":{"id":23013175,"name":"afw","full_name":"lsst/afw","owner":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst/afw","description":"LSST data management: astronomical framework, including images and tables","fork":false,"url":"https://api.github.com/repos/lsst/afw","forks_url":"https://api.github.com/repos/lsst/afw/forks","keys_url":"https://api.github.com/repos/lsst/afw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/afw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/afw/teams","hooks_url":"https://api.github.com/repos/lsst/afw/hooks","issue_events_url":"https://api.github.com/repos/lsst/afw/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/afw/events","assignees_url":"https://api.github.com/repos/lsst/afw/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/afw/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/afw/tags","blobs_url":"https://api.github.com/repos/lsst/afw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/afw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/afw/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/afw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/afw/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/afw/languages","stargazers_url":"https://api.github.com/repos/lsst/afw/stargazers","contributors_url":"https://api.github.com/repos/lsst/afw/contributors","subscribers_url":"https://api.github.com/repos/lsst/afw/subscribers","subscription_url":"https://api.github.com/repos/lsst/afw/subscription","commits_url":"https://api.github.com/repos/lsst/afw/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/afw/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/afw/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/afw/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/afw/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/afw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/afw/merges","archive_url":"https://api.github.com/repos/lsst/afw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/afw/downloads","issues_url":"https://api.github.com/repos/lsst/afw/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/afw/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/afw/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/afw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/afw/labels{/name}","releases_url":"https://api.github.com/repos/lsst/afw/releases{/id}","deployments_url":"https://api.github.com/repos/lsst/afw/deployments","created_at":"2014-08-16T07:37:40Z","updated_at":"2016-01-11T20:52:03Z","pushed_at":"2016-10-21T22:03:13Z","git_url":"git://github.com/lsst/afw.git","ssh_url":"git@github.com:lsst/afw.git","clone_url":"https://github.com/lsst/afw.git","svn_url":"https://github.com/lsst/afw","homepage":"http://dm.lsst.org/","size":40596,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":8,"forks":7,"open_issues":8,"watchers":3,"default_branch":"master"}},"base":{"label":"lsst:tickets/DM-6168","ref":"tickets/DM-6168","sha":"bd9021efdafe0f7fc60eac99de67e61173bc4117","user":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"repo":{"id":23013175,"name":"afw","full_name":"lsst/afw","owner":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst/afw","description":"LSST data management: astronomical framework, including images and tables","fork":false,"url":"https://api.github.com/repos/lsst/afw","forks_url":"https://api.github.com/repos/lsst/afw/forks","keys_url":"https://api.github.com/repos/lsst/afw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/afw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/afw/teams","hooks_url":"https://api.github.com/repos/lsst/afw/hooks","issue_events_url":"https://api.github.com/repos/lsst/afw/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/afw/events","assignees_url":"https://api.github.com/repos/lsst/afw/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/afw/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/afw/tags","blobs_url":"https://api.github.com/repos/lsst/afw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/afw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/afw/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/afw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/afw/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/afw/languages","stargazers_url":"https://api.github.com/repos/lsst/afw/stargazers","contributors_url":"https://api.github.com/repos/lsst/afw/contributors","subscribers_url":"https://api.github.com/repos/lsst/afw/subscribers","subscription_url":"https://api.github.com/repos/lsst/afw/subscription","commits_url":"https://api.github.com/repos/lsst/afw/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/afw/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/afw/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/afw/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/afw/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/afw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/afw/merges","archive_url":"https://api.github.com/repos/lsst/afw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/afw/downloads","issues_url":"https://api.github.com/repos/lsst/afw/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/afw/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/afw/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/afw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/afw/labels{/name}","releases_url":"https://api.github.com/repos/lsst/afw/releases{/id}","deployments_url":"https://api.github.com/repos/lsst/afw/deployments","created_at":"2014-08-16T07:37:40Z","updated_at":"2016-01-11T20:52:03Z","pushed_at":"2016-10-21T22:03:13Z","git_url":"git://github.com/lsst/afw.git","ssh_url":"git@github.com:lsst/afw.git","clone_url":"https://github.com/lsst/afw.git","svn_url":"https://github.com/lsst/afw","homepage":"http://dm.lsst.org/","size":40596,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":8,"forks":7,"open_issues":8,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lsst/afw/pulls/108"},"html":{"href":"https://github.com/lsst/afw/pull/108"},"issue":{"href":"https://api.github.com/repos/lsst/afw/issues/108"},"comments":{"href":"https://api.github.com/repos/lsst/afw/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/lsst/afw/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/lsst/afw/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lsst/afw/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/lsst/afw/statuses/dc5308cd359e9d47ed32946c42a16b201072216c"}}}}
{"actor":{"display_login":"pschella"}}