Skip to content

Commit 9a2f01c

Browse files
committed
refactor: Organize import statements and remove unnecessary lines
1 parent a734694 commit 9a2f01c

9 files changed

Lines changed: 14 additions & 17 deletions

File tree

pandas_render/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from typing import Optional, Union, List, Tuple
21
from collections import namedtuple
32
from inspect import cleandoc
3+
from typing import List, Optional, Tuple, Union
44

5+
import pandas # noqa
56
from IPython.display import Javascript # noqa
67
from jinja2 import Template as JinjaTemplate
7-
import pandas # noqa
88

99

1010
def _handle_extensions():

pandas_render/base/Element.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from typing import Dict, Optional
2-
32
from xml.etree.ElementTree import Element as XmlElement
43
from xml.etree.ElementTree import tostring
54

pandas_render/extensions/DataFrame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from typing import Union, Dict
21
from inspect import cleandoc
2+
from typing import Dict, Union
33

44
import pandas as pd
55
from IPython.display import HTML

pandas_render/extensions/Series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from typing import Union
21
from inspect import cleandoc
2+
from typing import Union
33

44
import pandas as pd
55
from IPython.display import HTML

pandas_render/extensions/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
from typing import Union
22

3-
from pandas_render.base import Element
4-
from pandas_render.base import Component
5-
6-
from pandas_render.elements import collection as elements_collection
3+
from pandas_render.base import Component, Element
74
from pandas_render.components import collection as components_collection
5+
from pandas_render.elements import collection as elements_collection
86

97

108
def render(something: Union[str, Element, Component, type]) -> str:

tests/extensions/test_dataframe.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
import pandas as pd
12
import pytest
3+
from IPython.display import HTML
24

3-
import pandas as pd
45
from pandas_render import init
56

6-
from IPython.display import HTML
7-
87
init()
98

109

tests/extensions/test_renderings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from pandas_render.extensions import render
2-
from pandas_render.elements import Image, Link
31
from pandas_render.components import Toggle
2+
from pandas_render.elements import Image, Link
3+
from pandas_render.extensions import render
44

55

66
def test_and_compare_renderings():

tests/extensions/test_series.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
import pandas as pd
12
import pytest
3+
from IPython.display import HTML
24

3-
import pandas as pd
45
from pandas_render import init
56

6-
from IPython.display import HTML
7-
87
init()
98

109

tests/test_pandas_render.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
def test_implicit_initialization():
22
import pandas as pd
3+
34
from pandas_render import init
45

56
init()
@@ -10,6 +11,7 @@ def test_implicit_initialization():
1011

1112
def test_initialization_with_library():
1213
from IPython.display import Javascript
14+
1315
from pandas_render import init
1416

1517
output = init("alpine")

0 commit comments

Comments
 (0)