Skip to content

Commit

Permalink
pydrake autodiff: Ensure NumPy deprecations are also filtered
Browse files Browse the repository at this point in the history
  • Loading branch information
EricCousineau-TRI committed Apr 8, 2018
1 parent c244138 commit d2f7255
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bindings/pydrake/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ drake_pybind_library(
py_deps = [
":common_py",
":math_py",
"//bindings/pydrake/util:deprecation_py",
],
py_srcs = [
"autodiffutils.py",
Expand Down Expand Up @@ -132,6 +133,7 @@ drake_pybind_library(
py_deps = [
":common_py",
":math_py",
"//bindings/pydrake/util:deprecation_py",
],
py_srcs = ["symbolic.py"],
)
Expand Down
6 changes: 6 additions & 0 deletions bindings/pydrake/autodiffutils_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ namespace pydrake {
PYBIND11_MODULE(_autodiffutils_py, m) {
m.doc() = "Bindings for Eigen AutoDiff Scalars";

// Install NumPy warning filtres.
// N.B. This may interfere with other code, but until that is a confirmed
// issue, we should agressively try to avoid these warnings.
py::module::import("pydrake.util.deprecation")
.attr("install_numpy_warning_filters")();

py::class_<AutoDiffXd> autodiff(m, "AutoDiffXd");
autodiff
.def(py::init<const double&, const Eigen::VectorXd&>())
Expand Down

0 comments on commit d2f7255

Please sign in to comment.