Skip to content

Commit 32515ba

Browse files
authored
style: Sort imports traditionally instead of within sections (#103)
1 parent 275bbbf commit 32515ba

File tree

70 files changed

+88
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+88
-90
lines changed

docs/notebook_source/4-providing-images-as-context.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@
4444
import io
4545
import uuid
4646

47-
from datasets import load_dataset
48-
from IPython.display import display
49-
5047
# Third-party imports
5148
import pandas as pd
5249
import rich
50+
from datasets import load_dataset
51+
from IPython.display import display
5352
from rich.panel import Panel
5453

5554
# Data Designer imports

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ ignore = [
130130

131131
[tool.ruff.lint.isort]
132132
known-first-party = ["data_designer"]
133-
force-sort-within-sections = true
134133

135134
[tool.ruff.lint.flake8-tidy-imports]
136135
ban-relative-imports = "all"

scripts/update_license_headers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
import argparse
5-
from datetime import datetime
6-
from pathlib import Path
75
import re
86
import sys
7+
from datetime import datetime
8+
from pathlib import Path
99

1010

1111
def add_license_header_to_file(file_path: Path, license_header: str) -> bool:

src/data_designer/config/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from pathlib import Path
77
from typing import Any, Optional, Union
88

9-
from pydantic import BaseModel, ConfigDict
109
import yaml
10+
from pydantic import BaseModel, ConfigDict
1111

1212
from data_designer.config.utils.io_helpers import serialize_data
1313

src/data_designer/config/datastore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from pathlib import Path
88
from typing import TYPE_CHECKING, Optional, Union
99

10-
from huggingface_hub import HfApi, HfFileSystem
1110
import pandas as pd
1211
import pyarrow.parquet as pq
12+
from huggingface_hub import HfApi, HfFileSystem
1313
from pydantic import BaseModel, Field
1414

1515
from data_designer.config.errors import InvalidConfigError, InvalidFileFormatError, InvalidFilePathError

src/data_designer/config/default_model_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44

5-
from functools import lru_cache
65
import logging
76
import os
7+
from functools import lru_cache
88
from pathlib import Path
99
from typing import Any, Literal, Optional
1010

src/data_designer/config/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
import logging
45
from abc import ABC, abstractmethod
56
from enum import Enum
6-
import logging
77
from pathlib import Path
88
from typing import Any, Generic, List, Optional, TypeVar, Union
99

src/data_designer/config/utils/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
from enum import Enum
54
import os
5+
from enum import Enum
66
from pathlib import Path
77

88
from rich.theme import Theme

src/data_designer/config/utils/io_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
from datetime import date, datetime, timedelta
5-
from decimal import Decimal
64
import json
75
import logging
8-
from numbers import Number
96
import os
7+
from datetime import date, datetime, timedelta
8+
from decimal import Decimal
9+
from numbers import Number
1010
from pathlib import Path
1111
from typing import Any, Union
1212

src/data_designer/config/utils/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
from __future__ import annotations
55

6-
from contextlib import contextmanager
76
import json
7+
from contextlib import contextmanager
88
from typing import Optional, Union
99

1010
from jinja2 import TemplateSyntaxError, meta

0 commit comments

Comments
 (0)