@@ -43,7 +43,8 @@ def info(mdio_path: str, output_format: str, access_pattern: str) -> None:
4343 By default, this returns human-readable information about the grid and stats for the dataset.
4444 If output-format is set to 'json' then a JSON is returned to facilitate parsing.
4545 """
46- from mdio import MDIOReader
46+ # Lazy import to reduce CLI startup time
47+ from mdio import MDIOReader # noqa: PLC0415
4748
4849 reader = MDIOReader (mdio_path , access_pattern = access_pattern , return_metadata = True )
4950
@@ -101,17 +102,19 @@ def parse_access_patterns(reader: MDIOReader) -> dict[str, Any]:
101102
102103def json_print (mdio_info : dict [str , Any ]) -> None :
103104 """Convert MDIO Info to JSON and pretty print."""
104- from json import dumps as json_dumps
105+ # Lazy import to reduce CLI startup time
106+ from json import dumps as json_dumps # noqa: PLC0415
105107
106- from rich import print # noqa: A004
108+ from rich import print # noqa: A004, PLC0415
107109
108110 print (json_dumps (mdio_info , indent = 2 ))
109111
110112
111113def pretty_print (mdio_info : dict [str , Any ]) -> None :
112114 """Print pretty MDIO Info table to console."""
113- from rich .console import Console
114- from rich .table import Table
115+ # Lazy import to reduce CLI startup time
116+ from rich .console import Console # noqa: PLC0415
117+ from rich .table import Table # noqa: PLC0415
115118
116119 console = Console ()
117120
0 commit comments