From a3b720d6eab2e70c602d2e0118ab7138fc2fc113 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 13 Mar 2024 15:12:16 -0700 Subject: [PATCH] [dartpy] Format code using isort --- python/examples/biped_stand/main.py | 2 +- python/examples/drag_and_drop/main.py | 2 +- python/examples/operational_space_control/main.py | 2 +- python/examples/rigid_chain/main.py | 2 +- python/examples/rigid_cubes/main.py | 2 +- python/examples/rigid_loop/main.py | 3 ++- .../tests/integration/test_joint_force_torque.py | 5 +++-- python/tests/unit/collision/test_collision.py | 3 ++- python/tests/unit/common/test_logging.py | 2 +- python/tests/unit/common/test_stopwatch.py | 2 +- python/tests/unit/common/test_string.py | 2 +- python/tests/unit/common/test_uri.py | 1 + python/tests/unit/constraint/test_constraint.py | 3 ++- python/tests/unit/dynamics/test_aspect.py | 2 +- python/tests/unit/dynamics/test_body_node.py | 5 +++-- python/tests/unit/dynamics/test_inertia.py | 7 ++++--- .../tests/unit/dynamics/test_inverse_kinematics.py | 7 ++++--- python/tests/unit/dynamics/test_joint.py | 5 +++-- python/tests/unit/dynamics/test_meta_skeleton.py | 4 ++-- python/tests/unit/dynamics/test_simple_frame.py | 5 +++-- python/tests/unit/dynamics/test_skeleton.py | 5 +++-- python/tests/unit/math/test_random.py | 1 + python/tests/unit/optimizer/test_optimizer.py | 3 ++- python/tests/unit/simulation/test_world.py | 3 ++- python/tests/unit/utils/test_dart_loader.py | 5 ++--- python/tests/unit/utils/test_mjcf_parser.py | 5 ++--- python/tests/unit/utils/test_sdf_parser.py | 2 +- python/tests/unit/utils/test_skel_parser.py | 2 +- python/tutorials/chain/main.py | 4 ++-- python/tutorials/chain/main_finished.py | 4 ++-- setup.py | 14 +++++++------- 31 files changed, 63 insertions(+), 51 deletions(-) diff --git a/python/examples/biped_stand/main.py b/python/examples/biped_stand/main.py index 002e7b1f66464..c2a97657a260c 100644 --- a/python/examples/biped_stand/main.py +++ b/python/examples/biped_stand/main.py @@ -1,5 +1,5 @@ -import numpy as np import dartpy as dart +import numpy as np class InputHandler(dart.gui.osg.GUIEventHandler): diff --git a/python/examples/drag_and_drop/main.py b/python/examples/drag_and_drop/main.py index d183f9380dcc7..02d3f32039fd5 100644 --- a/python/examples/drag_and_drop/main.py +++ b/python/examples/drag_and_drop/main.py @@ -1,5 +1,5 @@ -import numpy as np import dartpy as dart +import numpy as np def main(): diff --git a/python/examples/operational_space_control/main.py b/python/examples/operational_space_control/main.py index 7c5dd7ce5b6ed..b3ee872273129 100644 --- a/python/examples/operational_space_control/main.py +++ b/python/examples/operational_space_control/main.py @@ -1,5 +1,5 @@ -import numpy as np import dartpy as dart +import numpy as np class HelloWorldNode(dart.gui.osg.RealTimeWorldNode): diff --git a/python/examples/rigid_chain/main.py b/python/examples/rigid_chain/main.py index af8285c293a2b..18132d9bd345b 100644 --- a/python/examples/rigid_chain/main.py +++ b/python/examples/rigid_chain/main.py @@ -1,5 +1,5 @@ -import numpy as np import dartpy as dart +import numpy as np class MyWorldNode(dart.gui.osg.RealTimeWorldNode): diff --git a/python/examples/rigid_cubes/main.py b/python/examples/rigid_cubes/main.py index 06a69fa0b31b3..09a985b8b8204 100644 --- a/python/examples/rigid_cubes/main.py +++ b/python/examples/rigid_cubes/main.py @@ -1,5 +1,5 @@ -import numpy as np import dartpy as dart +import numpy as np class MyWorldNode(dart.gui.osg.RealTimeWorldNode): diff --git a/python/examples/rigid_loop/main.py b/python/examples/rigid_loop/main.py index 4d1f095249d41..94d3e41132d3a 100644 --- a/python/examples/rigid_loop/main.py +++ b/python/examples/rigid_loop/main.py @@ -1,6 +1,7 @@ import math -import numpy as np + import dartpy as dart +import numpy as np class MyWorldNode(dart.gui.osg.RealTimeWorldNode): diff --git a/python/tests/integration/test_joint_force_torque.py b/python/tests/integration/test_joint_force_torque.py index 43c1eed0e27d2..45bb722a5a371 100644 --- a/python/tests/integration/test_joint_force_torque.py +++ b/python/tests/integration/test_joint_force_torque.py @@ -1,7 +1,8 @@ -import pytest import math -import numpy as np + import dartpy as dart +import numpy as np +import pytest def read_world(uri: dart.common.Uri): diff --git a/python/tests/unit/collision/test_collision.py b/python/tests/unit/collision/test_collision.py index f7d8c9d13dec3..7644d204ca83b 100644 --- a/python/tests/unit/collision/test_collision.py +++ b/python/tests/unit/collision/test_collision.py @@ -1,7 +1,8 @@ import platform -import pytest + import dartpy as dart import numpy as np +import pytest def collision_groups_tester(cd): diff --git a/python/tests/unit/common/test_logging.py b/python/tests/unit/common/test_logging.py index 4397742139164..994a93b048252 100644 --- a/python/tests/unit/common/test_logging.py +++ b/python/tests/unit/common/test_logging.py @@ -1,5 +1,5 @@ -import pytest import dartpy as dart +import pytest def test_basics(): diff --git a/python/tests/unit/common/test_stopwatch.py b/python/tests/unit/common/test_stopwatch.py index 47a52d1cd5e75..5e1baa62f3805 100644 --- a/python/tests/unit/common/test_stopwatch.py +++ b/python/tests/unit/common/test_stopwatch.py @@ -1,5 +1,5 @@ -import pytest import dartpy as dart +import pytest def test_basics(): diff --git a/python/tests/unit/common/test_string.py b/python/tests/unit/common/test_string.py index 03cb1fc36c63c..1ea78b6053bb3 100644 --- a/python/tests/unit/common/test_string.py +++ b/python/tests/unit/common/test_string.py @@ -6,8 +6,8 @@ # # This file is provided under the "BSD-style" License -import pytest import dartpy as dart +import pytest def test_case_conversions(): diff --git a/python/tests/unit/common/test_uri.py b/python/tests/unit/common/test_uri.py index e74481d15e69f..bc575728acf02 100644 --- a/python/tests/unit/common/test_uri.py +++ b/python/tests/unit/common/test_uri.py @@ -1,4 +1,5 @@ import platform + import pytest from dartpy.common import Uri diff --git a/python/tests/unit/constraint/test_constraint.py b/python/tests/unit/constraint/test_constraint.py index a6407637fec25..9498232dccbbf 100644 --- a/python/tests/unit/constraint/test_constraint.py +++ b/python/tests/unit/constraint/test_constraint.py @@ -1,7 +1,8 @@ import platform -import pytest + import dartpy as dart import numpy as np +import pytest def test_ball_joint_constraint(): diff --git a/python/tests/unit/dynamics/test_aspect.py b/python/tests/unit/dynamics/test_aspect.py index 3baf56edd8603..4095b49ee1f33 100644 --- a/python/tests/unit/dynamics/test_aspect.py +++ b/python/tests/unit/dynamics/test_aspect.py @@ -1,5 +1,5 @@ -import pytest import dartpy as dart +import pytest def test_simple_frame(): diff --git a/python/tests/unit/dynamics/test_body_node.py b/python/tests/unit/dynamics/test_body_node.py index 6321ad45c0864..32298668f9be4 100644 --- a/python/tests/unit/dynamics/test_body_node.py +++ b/python/tests/unit/dynamics/test_body_node.py @@ -1,7 +1,8 @@ import platform -import pytest -import numpy as np + import dartpy as dart +import numpy as np +import pytest def test_basic(): diff --git a/python/tests/unit/dynamics/test_inertia.py b/python/tests/unit/dynamics/test_inertia.py index 12ac71c8fa2d2..a67a720044c95 100644 --- a/python/tests/unit/dynamics/test_inertia.py +++ b/python/tests/unit/dynamics/test_inertia.py @@ -1,8 +1,9 @@ -import platform -import pytest import math -import numpy as np +import platform + import dartpy as dart +import numpy as np +import pytest def test_inertia_init(): diff --git a/python/tests/unit/dynamics/test_inverse_kinematics.py b/python/tests/unit/dynamics/test_inverse_kinematics.py index 71c63f03152ec..56a9d873819c0 100644 --- a/python/tests/unit/dynamics/test_inverse_kinematics.py +++ b/python/tests/unit/dynamics/test_inverse_kinematics.py @@ -1,8 +1,9 @@ -import platform -import pytest import math -import numpy as np +import platform + import dartpy as dart +import numpy as np +import pytest def test_solve_for_free_joint(): diff --git a/python/tests/unit/dynamics/test_joint.py b/python/tests/unit/dynamics/test_joint.py index 2b6d9a7190e02..e0d0d83b49c32 100644 --- a/python/tests/unit/dynamics/test_joint.py +++ b/python/tests/unit/dynamics/test_joint.py @@ -1,7 +1,8 @@ import math -import pytest -import numpy as np + import dartpy as dart +import numpy as np +import pytest def kinematics_tester(joint): diff --git a/python/tests/unit/dynamics/test_meta_skeleton.py b/python/tests/unit/dynamics/test_meta_skeleton.py index edd28cb0e1779..94e7d72874bfe 100644 --- a/python/tests/unit/dynamics/test_meta_skeleton.py +++ b/python/tests/unit/dynamics/test_meta_skeleton.py @@ -1,7 +1,7 @@ import platform -import pytest -import dartpy as dart +import dartpy as dart +import pytest # TODO(JS): Move this to integration category once created diff --git a/python/tests/unit/dynamics/test_simple_frame.py b/python/tests/unit/dynamics/test_simple_frame.py index 203076fb56294..9cae032fb8227 100644 --- a/python/tests/unit/dynamics/test_simple_frame.py +++ b/python/tests/unit/dynamics/test_simple_frame.py @@ -1,7 +1,8 @@ import platform -import pytest -import numpy as np + import dartpy as dart +import numpy as np +import pytest def test_basic(): diff --git a/python/tests/unit/dynamics/test_skeleton.py b/python/tests/unit/dynamics/test_skeleton.py index a77089028cef2..74222b1198508 100644 --- a/python/tests/unit/dynamics/test_skeleton.py +++ b/python/tests/unit/dynamics/test_skeleton.py @@ -1,7 +1,8 @@ import platform -import pytest -import numpy as np + import dartpy as dart +import numpy as np +import pytest def test_basic(): diff --git a/python/tests/unit/math/test_random.py b/python/tests/unit/math/test_random.py index e72ac12485455..735541f4f7f53 100644 --- a/python/tests/unit/math/test_random.py +++ b/python/tests/unit/math/test_random.py @@ -1,4 +1,5 @@ import platform + import pytest from dartpy.math import Random diff --git a/python/tests/unit/optimizer/test_optimizer.py b/python/tests/unit/optimizer/test_optimizer.py index 0abca3f577d70..fbccf64ed73d4 100644 --- a/python/tests/unit/optimizer/test_optimizer.py +++ b/python/tests/unit/optimizer/test_optimizer.py @@ -1,6 +1,7 @@ -import pytest import math + import dartpy as dart +import pytest # Problem reference: http://ab-initio.mit.edu/wiki/index.php/NLopt_Tutorial diff --git a/python/tests/unit/simulation/test_world.py b/python/tests/unit/simulation/test_world.py index b27c98c4ab355..c0fe4856a04aa 100644 --- a/python/tests/unit/simulation/test_world.py +++ b/python/tests/unit/simulation/test_world.py @@ -1,6 +1,7 @@ import platform -import pytest + import dartpy as dart +import pytest def test_empty_world(): diff --git a/python/tests/unit/utils/test_dart_loader.py b/python/tests/unit/utils/test_dart_loader.py index 81112c41c9e37..22602bb514c4e 100644 --- a/python/tests/unit/utils/test_dart_loader.py +++ b/python/tests/unit/utils/test_dart_loader.py @@ -1,10 +1,9 @@ +import os import platform -import pytest import dartpy +import pytest from dartpy.utils import DartLoader -import os - from tests.util import get_asset_path diff --git a/python/tests/unit/utils/test_mjcf_parser.py b/python/tests/unit/utils/test_mjcf_parser.py index 4067a47cfae47..259f9c0eec07d 100644 --- a/python/tests/unit/utils/test_mjcf_parser.py +++ b/python/tests/unit/utils/test_mjcf_parser.py @@ -1,9 +1,8 @@ +import os import platform -import pytest import dartpy as dart -import os - +import pytest from tests.util import get_asset_path diff --git a/python/tests/unit/utils/test_sdf_parser.py b/python/tests/unit/utils/test_sdf_parser.py index bcfc57955c508..d205830c65a01 100644 --- a/python/tests/unit/utils/test_sdf_parser.py +++ b/python/tests/unit/utils/test_sdf_parser.py @@ -6,8 +6,8 @@ # # This file is provided under the "BSD-style" License -import pytest import dartpy as dart +import pytest def test_read_world(): diff --git a/python/tests/unit/utils/test_skel_parser.py b/python/tests/unit/utils/test_skel_parser.py index 798587995eb34..6541b9810d370 100644 --- a/python/tests/unit/utils/test_skel_parser.py +++ b/python/tests/unit/utils/test_skel_parser.py @@ -6,8 +6,8 @@ # # This file is provided under the "BSD-style" License -import pytest import dartpy as dart +import pytest def test_read_world(): diff --git a/python/tutorials/chain/main.py b/python/tutorials/chain/main.py index 5e992cdc51275..ef38abd1ff632 100644 --- a/python/tutorials/chain/main.py +++ b/python/tutorials/chain/main.py @@ -1,7 +1,7 @@ import math -import numpy as np -import dartpy as dart +import dartpy as dart +import numpy as np default_height = 1.0 # m default_width = 0.2 # m diff --git a/python/tutorials/chain/main_finished.py b/python/tutorials/chain/main_finished.py index 5e992cdc51275..ef38abd1ff632 100644 --- a/python/tutorials/chain/main_finished.py +++ b/python/tutorials/chain/main_finished.py @@ -1,7 +1,7 @@ import math -import numpy as np -import dartpy as dart +import dartpy as dart +import numpy as np default_height = 1.0 # m default_width = 0.2 # m diff --git a/setup.py b/setup.py index 718d277b35882..e3f090ac7441d 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,16 @@ import contextlib +import distutils.log +import glob import os -import re -import sys import platform +import re import subprocess -import glob - +import sys from codecs import open # To use a consistent encoding -from setuptools import setup, Extension -from setuptools.command.build_ext import build_ext from distutils.version import LooseVersion -import distutils.log + +from setuptools import Extension, setup +from setuptools.command.build_ext import build_ext # Get the current directory path. dart_root = os.path.abspath(os.path.dirname(__file__))