Skip to content

Commit

Permalink
Standardize imports by converting absolute imports to relative imports (
Browse files Browse the repository at this point in the history
#521)

* Update `__init__.py`

* Update `_formats_vals.py`

* Update `_helpers.py`

* Update `_options.py`

* Update `_utils.py`

* Update `_utils_nanoplots.py`

* Update `gt.py`

* Update `shiny.py`
  • Loading branch information
jrycw authored Dec 9, 2024
1 parent 36eac57 commit 549b89e
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 35 deletions.
4 changes: 1 addition & 3 deletions great_tables/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
# Main gt imports ----

from .gt import GT
from . import vals
from . import loc
from . import style
from . import vals, loc, style
from ._styles import FromColumn as from_column
from ._helpers import (
letters,
Expand Down
3 changes: 1 addition & 2 deletions great_tables/_formats_vals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
from typing import TYPE_CHECKING, Any
from pathlib import Path

from great_tables import GT
from great_tables.gt import GT, _get_column_of_values
from typing_extensions import TypeAlias

from .gt import GT, _get_column_of_values
from ._gt_data import GTData
from ._tbl_data import SeriesLike, to_frame

Expand Down
4 changes: 1 addition & 3 deletions great_tables/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

from typing_extensions import Self, TypeAlias

from great_tables._text import _md_html

from ._text import BaseText, Html, Md
from ._text import BaseText, Html, Md, _md_html

FontStackName: TypeAlias = Literal[
"system-ui",
Expand Down
4 changes: 2 additions & 2 deletions great_tables/_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from dataclasses import dataclass, fields, replace
from typing import TYPE_CHECKING, ClassVar, cast, Iterable

from great_tables import _utils
from great_tables._helpers import FontStackName, GoogleFont, _intify_scaled_px, px
from . import _utils
from ._helpers import FontStackName, GoogleFont, _intify_scaled_px, px


if TYPE_CHECKING:
Expand Down
4 changes: 2 additions & 2 deletions great_tables/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from ._text import BaseText, _process_text

if TYPE_CHECKING:
from great_tables._gt_data import FormatInfo, GTData
from great_tables._tbl_data import TblData
from ._gt_data import FormatInfo, GTData
from ._tbl_data import TblData


def _try_import(name: str, pip_install_line: str | None = None) -> ModuleType:
Expand Down
4 changes: 2 additions & 2 deletions great_tables/_utils_nanoplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from typing import Any, Callable

import numpy as np
from great_tables._tbl_data import Agnostic, is_na
from great_tables._utils import _match_arg, _flatten_list
from ._tbl_data import Agnostic, is_na
from ._utils import _match_arg, _flatten_list

REFERENCE_LINE_KEYWORDS = ["mean", "median", "min", "max", "q1", "q3"]

Expand Down
40 changes: 20 additions & 20 deletions great_tables/gt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from typing import Any, TYPE_CHECKING
from typing_extensions import Self

from great_tables._gt_data import GTData
from ._gt_data import GTData

# Main gt imports ----
from great_tables._body import body_reassemble
from great_tables._boxhead import cols_align, cols_label
from great_tables._data_color import data_color
from great_tables._export import as_raw_html, as_latex, save, show
from great_tables._formats import (
from ._body import body_reassemble
from ._boxhead import cols_align, cols_label
from ._data_color import data_color
from ._export import as_raw_html, as_latex, save, show
from ._formats import (
fmt,
fmt_bytes,
fmt_currency,
Expand All @@ -28,15 +28,15 @@
fmt_time,
fmt_units,
)
from great_tables._heading import tab_header
from great_tables._helpers import random_id
from great_tables._modify_rows import (
from ._heading import tab_header
from ._helpers import random_id
from ._modify_rows import (
row_group_order,
tab_stub,
with_id,
with_locale,
)
from great_tables._options import (
from ._options import (
opt_align_table_header,
opt_all_caps,
opt_footnote_marks,
Expand All @@ -48,23 +48,23 @@
opt_vertical_padding,
tab_options,
)
from great_tables._render import infer_render_env_defaults
from great_tables._source_notes import tab_source_note
from great_tables._spanners import (
from ._render import infer_render_env_defaults
from ._source_notes import tab_source_note
from ._spanners import (
cols_hide,
cols_move,
cols_move_to_end,
cols_move_to_start,
cols_width,
tab_spanner,
)
from great_tables._stub import reorder_stub_df
from great_tables._stubhead import tab_stubhead
from great_tables._substitution import sub_missing, sub_zero
from great_tables._tab_create_modify import tab_style
from great_tables._tbl_data import _get_cell, n_rows
from great_tables._utils import _migrate_unformatted_to_output
from great_tables._utils_render_html import (
from ._stub import reorder_stub_df
from ._stubhead import tab_stubhead
from ._substitution import sub_missing, sub_zero
from ._tab_create_modify import tab_style
from ._tbl_data import _get_cell, n_rows
from ._utils import _migrate_unformatted_to_output
from ._utils_render_html import (
_get_table_defs,
create_body_component_h,
create_columns_component_h,
Expand Down
2 changes: 1 addition & 1 deletion great_tables/shiny.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"render_gt",
)

from great_tables import GT
from .gt import GT
from htmltools import Tag, div, HTML

try:
Expand Down

0 comments on commit 549b89e

Please sign in to comment.