Skip to content

Commit

Permalink
apply import merging for fbcode/torchrecipes/audio/source_separation …
Browse files Browse the repository at this point in the history
…(1 of 1)

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

Differential Revision: D35560359

fbshipit-source-id: 1c9d95aae32366ac1fb71e7204ddbb45b6486819
  • Loading branch information
thatch authored and facebook-github-bot committed Apr 13, 2022
1 parent 5f6233e commit 1bb4522
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
9 changes: 2 additions & 7 deletions torchrecipes/audio/source_separation/datamodule/librimix.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
from dataclasses import dataclass
from typing import (
Optional,
)
from typing import Optional

import pytorch_lightning as pl
from hydra.core.config_store import ConfigStore
from omegaconf import MISSING
from torch.utils.data import DataLoader
from torchaudio.datasets import LibriMix
from torchrecipes.core.conf import DataModuleConf
from torchrecipes.utils.config_utils import (
config_entry,
get_class_config_method,
)
from torchrecipes.utils.config_utils import config_entry, get_class_config_method

from .test_dataset import TestDataset
from .utils import CollateFn
Expand Down
5 changes: 1 addition & 4 deletions torchrecipes/audio/source_separation/datamodule/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from typing import (
List,
Tuple,
)
from typing import List, Tuple

import torch
from torch import Tensor
Expand Down
5 changes: 1 addition & 4 deletions torchrecipes/audio/source_separation/metrics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/usr/bin/env python3

from torchrecipes.audio.source_separation.metrics.sdr import (
sdri_metric,
sisdri_metric,
)
from torchrecipes.audio.source_separation.metrics.sdr import sdri_metric, sisdri_metric


__all__ = [
Expand Down
13 changes: 2 additions & 11 deletions torchrecipes/audio/source_separation/module/conv_tasnet.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
from dataclasses import dataclass, field
from typing import (
Any,
Callable,
Dict,
Mapping,
List,
Optional,
Tuple,
Union,
)
from typing import Any, Callable, Dict, List, Mapping, Optional, Tuple, Union

import hydra
import pytorch_lightning as pl
Expand All @@ -19,7 +10,7 @@
from torchrecipes.audio.source_separation.loss import si_sdr_loss
from torchrecipes.audio.source_separation.metrics import sdri_metric, sisdri_metric
from torchrecipes.core.conf import ModuleConf
from torchrecipes.utils.config_utils import get_class_config_method, config_entry
from torchrecipes.utils.config_utils import config_entry, get_class_config_method


def _get_model(
Expand Down

0 comments on commit 1bb4522

Please sign in to comment.