Skip to content

Commit

Permalink
Remove most usage of __future__ (RobotLocomotion#12247)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiesnape authored Oct 28, 2019
1 parent d0678e4 commit 3c9ef6d
Show file tree
Hide file tree
Showing 71 changed files with 1 addition and 116 deletions.
1 change: 0 additions & 1 deletion bindings/pydrake/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Python bindings for Drake.
"""

from __future__ import absolute_import, division, print_function
import os
import sys
import warnings
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
To see example usages, please see `doc/python_bindings.rst`.
"""

from __future__ import absolute_import

# Legacy symbols.
from .attic.all import *
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/attic/multibody/test/parsers_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest
import os.path

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/attic/multibody/test/rigid_body_tree_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import numpy as np
import os
from os.path import join
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/attic/solvers/_ik_extra.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# See `ExecuteExtraPythonCode` in `pydrake_pybind.h` for usage details and
# rationale.
from __future__ import absolute_import, division, print_function

import numpy as np

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/attic/solvers/test/pr2_ik_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import os
import numpy as np
import pydrake
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/attic/solvers/test/rbt_ik_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest
import numpy as np
import pydrake
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/attic/systems/all.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from __future__ import absolute_import
from .controllers import *
from .sensors import *
2 changes: 0 additions & 2 deletions bindings/pydrake/attic/systems/test/controllers_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

# Module under test.
import pydrake.attic.systems.controllers as mut

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/common/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from __future__ import absolute_import, division, print_function

from ._module_py import *
2 changes: 0 additions & 2 deletions bindings/pydrake/common/cpp_param.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, print_function

import ctypes
import numpy as np

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/common/test/cpp_param_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

"""
Tests the pure Python functionality of `cpp_param`: (a) idempotent mapping for
unaliased types, and (b) correct mapping for aliased types (as the aliases
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/common/test/cpp_template_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, print_function

import unittest
from types import ModuleType

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/common/test/deprecation_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import rlcompleter
import six
import sys
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/common/test/module_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import os
import unittest

Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/common/test/pybind11_version_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Tests `pybind11` version information available from Drake.
"""

from __future__ import print_function

import pydrake.common.pybind11_version as mut

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/common/test/wrap_pybind_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import copy
import gc
import unittest
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/doc/pydrake_sphinx_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# e.g. `LeafSystem` only consists of private things to overload, but it's
# important to be user-visible.

from __future__ import print_function

from collections import namedtuple
import re
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
with LQR.
"""

from __future__ import print_function

import argparse

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/examples/test/acrobot_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import copy
import unittest
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/examples/test/compass_gait_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import unittest

from pydrake.examples.compass_gait import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import unittest
import numpy as np

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/examples/test/pendulum_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import copy
import unittest
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/examples/test/quadrotor_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import unittest
import numpy as np

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/examples/test/rimless_wheel_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import unittest

from pydrake.examples.rimless_wheel import (
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/examples/test/van_der_pol_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import numpy as np
import unittest

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/forwarddiff.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import numpy as np

from .autodiffutils import AutoDiffXd
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/solvers/all.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import warnings

from .mathematicalprogram import * # noqa
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/solvers/test/gurobi_solver_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest
import numpy as np
from pydrake.solvers import mathematicalprogram as mp
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/solvers/test/ipopt_solver_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest
import warnings

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/solvers/test/mathematicalprogram_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, absolute_import

from pydrake.solvers import mathematicalprogram as mp
from pydrake.solvers.gurobi import GurobiSolver
from pydrake.solvers.snopt import SnoptSolver
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/solvers/test/mosek_solver_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest
import numpy as np
from pydrake.solvers import mathematicalprogram as mp
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/solvers/test/nlopt_solver_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest
import warnings

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/solvers/test/osqp_solver_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest
import numpy as np
from pydrake.solvers import mathematicalprogram as mp
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/solvers/test/scs_solver_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/solvers/test/snopt_solver_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/systems/meshcat_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package, Meshcat:
https://github.com/rdeits/meshcat
"""
from __future__ import print_function
import argparse
import math
import os
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/systems/test/controllers_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import math
import unittest

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/systems/test/custom_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import print_function

import copy
import unittest
import warnings
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/systems/test/general_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import print_function

import pydrake.systems.framework as mut

import copy
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/systems/test/lifetime_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
lifetime of objects, eventually lock down capabilities as they are introduced.
"""

from __future__ import print_function

import unittest
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/systems/test/monte_carlo_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import print_function

import copy
import time
import unittest
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/systems/test/sensors_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import division

import pydrake.systems.sensors as mut

import unittest
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/systems/test/trajectory_optimization_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import math
import unittest
import warnings
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/systems/test/value_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import print_function

import copy
import unittest
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/test/all_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import sys
import unittest
import warnings
Expand Down
4 changes: 0 additions & 4 deletions bindings/pydrake/test/autodiffutils_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from __future__ import print_function
# N.B. We are purposely not importing `division` to test nominal Python2
# behavior.

import pydrake.autodiffutils as mut
from pydrake.autodiffutils import (
autoDiffToGradientMatrix,
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/test/forward_diff_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import unittest
import numpy as np
from pydrake.forwarddiff import sin, cos, derivative
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/test/math_overloads_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Test math overloads.
"""

from __future__ import print_function

import math
import unittest
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/test/math_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import pydrake.math as mut
import pydrake.math._test as mtest
from pydrake.math import (BarycentricMesh, wrap_to)
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/test/odr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
@see #6465
"""

from __future__ import absolute_import, division, print_function

import unittest

Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/test/polynomial_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import numpy as np
import unittest

Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/test/symbolic_monomial_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function

import unittest
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/test/symbolic_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function

import copy
import unittest
Expand Down
1 change: 0 additions & 1 deletion bindings/pydrake/test/symbolic_variables_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function

import unittest
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/test/trajectories_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import numpy as np
import unittest

Expand Down
2 changes: 1 addition & 1 deletion common/proto/call_python_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
Occasionally, the plotting will not come through on the notebook. I (Eric)
am unsure why.
"""
from __future__ import print_function

import argparse
import os
import signal
Expand Down
1 change: 0 additions & 1 deletion common/test/cpplint_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
to run multiple linters in parallel.
"""

from __future__ import print_function

import argparse
import functools
Expand Down
1 change: 0 additions & 1 deletion doc/doxygen_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
See also drake/doc/documentation_instructions.rst.
"""

from __future__ import print_function

import argparse
from collections import OrderedDict
Expand Down
2 changes: 0 additions & 2 deletions doc/sphinx_base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import argparse
import os
from os import listdir, symlink, mkdir
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import argparse

try:
Expand Down
1 change: 0 additions & 1 deletion lcm/test/import_lcm_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import unittest


Expand Down
Loading

0 comments on commit 3c9ef6d

Please sign in to comment.