Skip to content

Commit

Permalink
DNM pydrake: Use custom dtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
EricCousineau-TRI committed Jan 28, 2019
1 parent 04e66c8 commit b809fa6
Show file tree
Hide file tree
Showing 55 changed files with 3,836 additions and 893 deletions.
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ install(
docs = ["LICENSE.TXT"],
deps = [
"//automotive/models:install_data",
"//bindings/pybind11_ext:install",
"//bindings/pydrake:install",
"//common:install",
"//common/proto:install",
Expand Down
50 changes: 50 additions & 0 deletions bindings/pybind11_ext/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- python -*-

load("@drake//tools/install:install.bzl", "install")
load("//tools/lint:lint.bzl", "add_lint_tests")
load("@drake//tools/skylark:drake_cc.bzl", "drake_cc_library")
load("@drake//tools/skylark:drake_py.bzl", "drake_py_unittest")
load("@drake//tools/skylark:pybind.bzl", "pybind_py_library")

package(default_visibility = [
"//bindings:__subpackages__",
])

drake_cc_library(
name = "numpy_dtypes_user",
hdrs = [
"numpy_dtypes_user.h",
"numpy_ufunc.h",
],
declare_installed_headers = 0,
deps = [
"//bindings/pydrake/util:type_pack",
"//bindings/pydrake/util:wrap_function",
"@pybind11",
],
)

install(
name = "install",
targets = ["numpy_dtypes_user"],
visibility = ["//visibility:public"],
)

pybind_py_library(
name = "numpy_dtypes_user_test_util_py",
testonly = 1,
cc_deps = [
":numpy_dtypes_user",
"@fmt",
],
cc_so_name = "numpy_dtypes_user_test_util",
cc_srcs = ["test/numpy_dtypes_user_test_util_py.cc"],
py_imports = ["."],
)

drake_py_unittest(
name = "numpy_dtypes_user_test",
deps = [":numpy_dtypes_user_test_util_py"],
)

add_lint_tests()
3 changes: 3 additions & 0 deletions bindings/pybind11_ext/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pybind11 extensions

Provides the ability to provide uesr-defined dtypes in NumPy.
Loading

0 comments on commit b809fa6

Please sign in to comment.