Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isort breaks the code with sort_reexports = true #2268

Closed
hwpang opened this issue May 24, 2024 · 2 comments
Closed

isort breaks the code with sort_reexports = true #2268

hwpang opened this issue May 24, 2024 · 2 comments

Comments

@hwpang
Copy link

hwpang commented May 24, 2024

Thanks for making this amazing package!

I use isort to sort the following file with isort --sort-reexports <file/path>. The results break the file.

Original file:

from .agg import (
    Aggregation,
    AggregationRegistry,
    AttentiveAggregation,
    MeanAggregation,
    NormAggregation,
    SumAggregation,
)
from .loss import (
    BCELoss,
    BinaryDirichletLoss,
    BinaryMCCLoss,
    BoundedMSELoss,
    CrossEntropyLoss,
    DirichletMixin,
    EvidentialLoss,
    LossFunction,
    LossFunctionRegistry,
    MccMixin,
    MSELoss,
    MulticlassDirichletLoss,
    MulticlassMCCLoss,
    MVELoss,
    SIDLoss,
    WassersteinLoss,
)
from .message_passing import (
    AtomMessagePassing,
    BondMessagePassing,
    MessagePassing,
    MulticomponentMessagePassing,
)
from .metrics import (
    BCEMetric,
    BinaryAccuracyMetric,
    BinaryAUPRCMetric,
    BinaryAUROCMetric,
    BinaryF1Metric,
    BinaryMCCMetric,
    BoundedMAEMetric,
    BoundedMixin,
    BoundedMSEMetric,
    BoundedRMSEMetric,
    CrossEntropyMetric,
    MAEMetric,
    Metric,
    MetricRegistry,
    MSEMetric,
    MulticlassMCCMetric,
    R2Metric,
    RMSEMetric,
    SIDMetric,
    ThresholdedMixin,
    WassersteinMetric,
)
from .predictors import (
    BinaryClassificationFFN,
    BinaryClassificationFFNBase,
    BinaryDirichletFFN,
    EvidentialFFN,
    MulticlassClassificationFFN,
    MulticlassDirichletFFN,
    MveFFN,
    Predictor,
    PredictorRegistry,
    RegressionFFN,
    SpectralFFN,
)
from .transforms import UnscaleTransform
from .utils import Activation

__all__ = [
    "Aggregation",
    "AggregationRegistry",
    "MeanAggregation",
    "SumAggregation",
    "NormAggregation",
    "AttentiveAggregation",
    "LossFunction",
    "LossFunctionRegistry",
    "MSELoss",
    "BoundedMSELoss",
    "MVELoss",
    "EvidentialLoss",
    "BCELoss",
    "CrossEntropyLoss",
    "MccMixin",
    "BinaryMCCLoss",
    "MulticlassMCCLoss",
    "DirichletMixin",
    "BinaryDirichletLoss",
    "MulticlassDirichletLoss",
    "SIDLoss",
    "WassersteinLoss",
    "Metric",
    "MetricRegistry",
    "ThresholdedMixin",
    "MAEMetric",
    "MSEMetric",
    "RMSEMetric",
    "BoundedMixin",
    "BoundedMAEMetric",
    "BoundedMSEMetric",
    "BoundedRMSEMetric",
    "R2Metric",
    "BinaryAUROCMetric",
    "BinaryAUPRCMetric",
    "BinaryAccuracyMetric",
    "BinaryF1Metric",
    "BCEMetric",
    "CrossEntropyMetric",
    "BinaryMCCMetric",
    "MulticlassMCCMetric",
    "SIDMetric",
    "WassersteinMetric",
    "MessagePassing",
    "AtomMessagePassing",
    "BondMessagePassing",
    "MulticomponentMessagePassing",
    "Predictor",
    "PredictorRegistry",
    "RegressionFFN",
    "MveFFN",
    "EvidentialFFN",
    "BinaryClassificationFFNBase",
    "BinaryClassificationFFN",
    "BinaryDirichletFFN",
    "MulticlassClassificationFFN",
    "MulticlassDirichletFFN",
    "SpectralFFN",
    "Activation",
    "UnscaleTransform",
]

After sorting:

from .agg import (
    Aggregation,
    AggregationRegistry,
    AttentiveAggregat__all__ = ['Activation', 'Aggregation', 'AggregationRegistry', 'AtomMessagePassing', 'AttentiveAggregation',
 'BCELoss', 'BCEMetric', 'BinaryAUPRCMetric', 'BinaryAUROCMetric', 'BinaryAccuracyMetric',
 'BinaryClassificationFFN', 'BinaryClassificationFFNBase', 'BinaryDirichletFFN',
 'BinaryDirichletLoss', 'BinaryF1Metric', 'BinaryMCCLoss', 'BinaryMCCMetric', 'BondMessagePassing',
 'BoundedMAEMetric', 'BoundedMSELoss', 'BoundedMSEMetric', 'BoundedMixin', 'BoundedRMSEMetric',
 'CrossEntropyLoss', 'CrossEntropyMetric', 'DirichletMixin', 'EvidentialFFN', 'EvidentialLoss',
 'LossFunction', 'LossFunctionRegistry', 'MAEMetric', 'MSELoss', 'MSEMetric', 'MVELoss', 'MccMixin',
 'MeanAggregation', 'MessagePassing', 'Metric', 'MetricRegistry', 'MulticlassClassificationFFN',
 'MulticlassDirichletFFN', 'MulticlassDirichletLoss', 'MulticlassMCCLoss', 'MulticlassMCCMetric',
 'MulticomponentMessagePassing', 'MveFFN', 'NormAggregation', 'Predictor', 'PredictorRegistry',
 'R2Metric', 'RMSEMetric', 'RegressionFFN', 'SIDLoss', 'SIDMetric', 'SpectralFFN', 'SumAggregation',
 'ThresholdedMixin', 'UnscaleTransform', 'WassersteinLoss', 'WassersteinMetric']
classDirichletFFN,
    MveFFN,
    Predictor,
    PredictorRegistry,
    RegressionFFN,
    SpectralFFN,
)
from .transforms import UnscaleTransform
from .utils import Activation

__all__ = [

Any suggestions are appreciated!

@JacksonBurns
Copy link

Probable duplicate of #2193

@hwpang
Copy link
Author

hwpang commented May 31, 2024

Closing this as it's duplicate of #2193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants