Convert directory fbcode/vision to use the Ruff Formatter

Summary:
Converts the directory specified to use the Ruff formatter in pyfmt

ruff_dog

If this diff causes merge conflicts when rebasing, please run
`hg status -n -0 --change . -I '**/*.{py,pyi}' | xargs -0 arc pyfmt`
on your diff, and amend any changes before rebasing onto latest.
That should help reduce or eliminate any merge conflicts.

allow-large-files

Reviewed By: bottler

Differential Revision: D66472063

fbshipit-source-id: 35841cb397e4f8e066e2159550d2f56b403b1bef
This commit is contained in:
Thomas Polasek
2024-11-26 02:38:20 -08:00
committed by Facebook GitHub Bot
parent f6c2ca6bfc
commit 055ab3a2e3
92 changed files with 121 additions and 191 deletions

View File

@@ -576,7 +576,6 @@ class TestConfig(unittest.TestCase):
a: int = 9
for Unprocessed in [UnprocessedConfigurable, UnprocessedReplaceable]:
self.assertFalse(_is_actually_dataclass(Unprocessed))
unprocessed = Unprocessed()
self.assertTrue(_is_actually_dataclass(Unprocessed))

View File

@@ -71,7 +71,6 @@ class TestEvaluation(unittest.TestCase):
for diff in 10 ** torch.linspace(-5, 0, 6):
for crop in (0, 5):
pred = gt + (torch.rand_like(gt) - 0.5) * 2 * diff
# scaled prediction test

View File

@@ -74,7 +74,6 @@ class TestGenericModel(unittest.TestCase):
eval_test: bool = True,
bw_test: bool = True,
):
R, T = look_at_view_transform(azim=torch.rand(n_train_cameras) * 360)
cameras = PerspectiveCameras(R=R, T=T, device=device)

View File

@@ -171,9 +171,7 @@ def _make_random_json_dataset_map_provider_v2_data(
Image.fromarray(
(mask * 255.0).astype(np.uint8),
mode="L",
).convert(
"L"
).save(mask_path)
).convert("L").save(mask_path)
fa = FrameAnnotation(
sequence_name=seq_name,

View File

@@ -65,7 +65,6 @@ class TestModelVisualize(unittest.TestCase):
visdom_show_preds = Visdom().check_connection()
for load_dataset_pointcloud in [True, False]:
model = _PointcloudRenderingModel(
train_dataset,
show_sequence_name,

View File

@@ -142,7 +142,6 @@ class TestViewsampling(unittest.TestCase):
expand_args_fields(ViewSampler)
for masked_sampling in (True, False):
view_sampler = ViewSampler(masked_sampling=masked_sampling)
feats_sampled, masks_sampled = view_sampler(

View File

@@ -275,7 +275,6 @@ class TestVoxelGrids(TestCaseMixin, unittest.TestCase):
return torch.cat(result)
def test_interpolation(self):
with self.subTest("1D interpolation"):
points = self.get_random_normalized_points(
n_grids=4, n_points=5, dimension=1