apply import merging for fbcode (11 of 11)

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: lisroach

Differential Revision: D36402260

fbshipit-source-id: 7cb52f09b740ccc580e61e6d1787d27381a8ce00
This commit is contained in:
John Reese 2022-05-15 12:53:03 -07:00 committed by Facebook GitHub Bot
parent b5f3d3ce12
commit 3b2300641a
9 changed files with 13 additions and 15 deletions

View File

@ -8,8 +8,8 @@
import dataclasses import dataclasses
import gzip import gzip
import json import json
from dataclasses import MISSING, Field, dataclass from dataclasses import dataclass, Field, MISSING
from typing import IO, Any, Optional, Tuple, Type, TypeVar, Union, cast from typing import Any, cast, IO, Optional, Tuple, Type, TypeVar, Union
import numpy as np import numpy as np
from pytorch3d.common.datatypes import get_args, get_origin from pytorch3d.common.datatypes import get_args, get_origin

View File

@ -9,7 +9,7 @@ from typing import Optional, Tuple
import torch import torch
from pytorch3d.implicitron.tools import camera_utils from pytorch3d.implicitron.tools import camera_utils
from pytorch3d.implicitron.tools.config import ReplaceableBase, registry from pytorch3d.implicitron.tools.config import registry, ReplaceableBase
from pytorch3d.renderer import NDCMultinomialRaysampler, RayBundle from pytorch3d.renderer import NDCMultinomialRaysampler, RayBundle
from pytorch3d.renderer.cameras import CamerasBase from pytorch3d.renderer.cameras import CamerasBase

View File

@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Tuple
import torch import torch
from pytorch3d.implicitron.models.renderer.base import RendererOutput from pytorch3d.implicitron.models.renderer.base import RendererOutput
from pytorch3d.implicitron.tools.config import ReplaceableBase, registry from pytorch3d.implicitron.tools.config import registry, ReplaceableBase
from pytorch3d.renderer.implicit.raymarching import _check_raymarcher_inputs from pytorch3d.renderer.implicit.raymarching import _check_raymarcher_inputs

View File

@ -4,7 +4,7 @@
# This source code is licensed under the BSD-style license found in the # This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
from typing import TYPE_CHECKING, Tuple, Union from typing import Tuple, TYPE_CHECKING, Union
import torch import torch
from pytorch3d.common.compat import eigh from pytorch3d.common.compat import eigh

View File

@ -4,7 +4,7 @@
# This source code is licensed under the BSD-style license found in the # This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
from typing import TYPE_CHECKING, Optional, Tuple from typing import Optional, Tuple, TYPE_CHECKING
import torch import torch
from pytorch3d import _C from pytorch3d import _C

View File

@ -14,7 +14,7 @@ import torch.nn.functional as F
from pytorch3d.common.datatypes import Device from pytorch3d.common.datatypes import Device
from pytorch3d.transforms import Rotate, Transform3d, Translate from pytorch3d.transforms import Rotate, Transform3d, Translate
from .utils import TensorProperties, convert_to_tensors_and_broadcast from .utils import convert_to_tensors_and_broadcast, TensorProperties
# Default values for rotation and translation matrices. # Default values for rotation and translation matrices.

View File

@ -6,7 +6,7 @@
import itertools import itertools
import warnings import warnings
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union from typing import Dict, List, Optional, Tuple, TYPE_CHECKING, Union
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F
@ -14,7 +14,7 @@ from pytorch3d.ops import interpolate_face_attributes
from pytorch3d.structures.utils import list_to_packed, list_to_padded, padded_to_list from pytorch3d.structures.utils import list_to_packed, list_to_padded, padded_to_list
from torch.nn.functional import interpolate from torch.nn.functional import interpolate
from .utils import PackedRectangle, Rectangle, pack_unique_rectangles from .utils import pack_unique_rectangles, PackedRectangle, Rectangle
# This file contains classes and helper functions for texturing. # This file contains classes and helper functions for texturing.

View File

@ -18,9 +18,7 @@ from pytorch3d.implicitron.dataset.implicitron_dataset import (
FrameData, FrameData,
ImplicitronDataset, ImplicitronDataset,
) )
from pytorch3d.implicitron.evaluation.evaluate_new_view_synthesis import ( from pytorch3d.implicitron.evaluation.evaluate_new_view_synthesis import eval_batch
eval_batch,
)
from pytorch3d.implicitron.models.base_model import ImplicitronModelBase from pytorch3d.implicitron.models.base_model import ImplicitronModelBase
from pytorch3d.implicitron.models.generic_model import GenericModel # noqa from pytorch3d.implicitron.models.generic_model import GenericModel # noqa
from pytorch3d.implicitron.models.model_dbir import ModelDBIR # noqa from pytorch3d.implicitron.models.model_dbir import ModelDBIR # noqa

View File

@ -12,17 +12,17 @@ import torch.nn.functional as F
from common_testing import TestCaseMixin from common_testing import TestCaseMixin
from pytorch3d.renderer.mesh.rasterizer import Fragments from pytorch3d.renderer.mesh.rasterizer import Fragments
from pytorch3d.renderer.mesh.textures import ( from pytorch3d.renderer.mesh.textures import (
_list_to_padded_wrapper,
TexturesAtlas, TexturesAtlas,
TexturesUV, TexturesUV,
TexturesVertex, TexturesVertex,
_list_to_padded_wrapper,
) )
from pytorch3d.renderer.mesh.utils import ( from pytorch3d.renderer.mesh.utils import (
Rectangle,
pack_rectangles, pack_rectangles,
pack_unique_rectangles, pack_unique_rectangles,
Rectangle,
) )
from pytorch3d.structures import Meshes, list_to_packed, packed_to_list from pytorch3d.structures import list_to_packed, Meshes, packed_to_list
from test_meshes import init_mesh from test_meshes import init_mesh