Commit 34bbb3ad authored by Tim Hatch's avatar Tim Hatch Committed by Facebook GitHub Bot
Browse files

apply import merging for fbcode/vision/fair (2 of 2)

Summary:
Applies new import merging and sorting from µsort v1.0.

When merging imports, µsort will make a best-effort to move associated
comments to match merged elements, but there are known limitations due to
the diynamic nature of Python and developer tooling. These changes should
not produce any dangerous runtime changes, but may require touch-ups to
satisfy linters and other tooling.

Note that µsort uses case-insensitive, lexicographical sorting, which
results in a different ordering compared to isort. This provides a more
consistent sorting order, matching the case-insensitive order used when
sorting import statements by module name, and ensures that "frog", "FROG",
and "Frog" always sort next to each other.

For details on µsort's sorting and merging semantics, see the user guide:
https://usort.readthedocs.io/en/stable/guide.html#sorting

Reviewed By: bottler

Differential Revision: D35553814

fbshipit-source-id: be49bdb6a4c25264ff8d4db3a601f18736d17be1
parent df08ea8e
......@@ -15,18 +15,18 @@ from os import path
import numpy as np
import torch
from common_testing import (
TestCaseMixin,
get_pytorch3d_dir,
get_tests_dir,
load_rgb_image,
TestCaseMixin,
)
from PIL import Image
from pytorch3d.renderer.cameras import (
FoVOrthographicCameras,
FoVPerspectiveCameras,
look_at_view_transform,
OrthographicCameras,
PerspectiveCameras,
look_at_view_transform,
)
from pytorch3d.renderer.compositing import alpha_composite, norm_weighted_sum
from pytorch3d.renderer.points import (
......
......@@ -20,9 +20,9 @@ from pytorch3d.renderer import (
PointsRenderer,
)
from pytorch3d.renderer.utils import (
TensorProperties,
ndc_grid_sample,
ndc_to_grid_sample_coords,
TensorProperties,
)
from pytorch3d.structures import Pointclouds
......
......@@ -9,10 +9,10 @@ import unittest
import numpy as np
import torch
from common_testing import (
TestCaseMixin,
get_pytorch3d_dir,
get_random_cuda_device,
get_tests_dir,
TestCaseMixin,
)
from pytorch3d.io import load_obj
from pytorch3d.ops.sample_farthest_points import (
......
......@@ -10,10 +10,10 @@ import unittest
import numpy as np
import torch
from common_testing import (
TestCaseMixin,
get_pytorch3d_dir,
get_random_cuda_device,
get_tests_dir,
TestCaseMixin,
)
from PIL import Image
from pytorch3d.io import load_objs_as_meshes
......
......@@ -8,7 +8,7 @@ import unittest
import torch
from common_testing import TestCaseMixin
from pytorch3d.renderer.cameras import PerspectiveCameras, look_at_view_transform
from pytorch3d.renderer.cameras import look_at_view_transform, PerspectiveCameras
from pytorch3d.renderer.mesh.rasterizer import Fragments
from pytorch3d.renderer.mesh.shader import (
HardFlatShader,
......
......@@ -12,14 +12,14 @@ import unittest
import numpy as np
import torch
from common_testing import TestCaseMixin, get_tests_dir, load_rgb_image
from common_testing import get_tests_dir, load_rgb_image, TestCaseMixin
from PIL import Image
from pytorch3d.datasets import ShapeNetCore, collate_batched_meshes
from pytorch3d.datasets import collate_batched_meshes, ShapeNetCore
from pytorch3d.renderer import (
FoVPerspectiveCameras,
look_at_view_transform,
PointLights,
RasterizationSettings,
look_at_view_transform,
)
from torch.utils.data import DataLoader
......
......@@ -8,7 +8,7 @@
import unittest
import torch
from common_testing import TestCaseMixin, get_random_cuda_device
from common_testing import get_random_cuda_device, TestCaseMixin
from pytorch3d.common.workaround import symeig3x3
from pytorch3d.transforms.rotation_conversions import random_rotations
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment