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

Add networkx to conventional aliases #6778

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def unconventional():
import pandas
import seaborn
import tkinter
import networkx


def unconventional_aliases():
Expand All @@ -18,7 +19,7 @@ def unconventional_aliases():
import pandas as pdas
import seaborn as sbrn
import tkinter as tkr

import networkx as nxy

def conventional_aliases():
import altair as alt
Expand All @@ -27,3 +28,4 @@ def conventional_aliases():
import pandas as pd
import seaborn as sns
import tkinter as tk
import networkx as nx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const CONVENTIONAL_ALIASES: &[(&str, &str)] = &[
("altair", "alt"),
("matplotlib", "mpl"),
("matplotlib.pyplot", "plt"),
("networkx", "nx"),
("numpy", "np"),
("pandas", "pd"),
("seaborn", "sns"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ defaults.py:9:12: ICN001 [*] `pandas` should be imported as `pd`
9 |+ import pandas as pd
10 10 | import seaborn
11 11 | import tkinter
12 12 |
12 12 | import networkx

defaults.py:10:12: ICN001 [*] `seaborn` should be imported as `sns`
|
Expand All @@ -81,6 +81,7 @@ defaults.py:10:12: ICN001 [*] `seaborn` should be imported as `sns`
10 | import seaborn
| ^^^^^^^ ICN001
11 | import tkinter
12 | import networkx
|
= help: Alias `seaborn` to `sns`

Expand All @@ -91,7 +92,7 @@ defaults.py:10:12: ICN001 [*] `seaborn` should be imported as `sns`
10 |- import seaborn
10 |+ import seaborn as sns
11 11 | import tkinter
12 12 |
12 12 | import networkx
13 13 |

defaults.py:11:12: ICN001 [*] `tkinter` should be imported as `tk`
Expand All @@ -100,6 +101,7 @@ defaults.py:11:12: ICN001 [*] `tkinter` should be imported as `tk`
10 | import seaborn
11 | import tkinter
| ^^^^^^^ ICN001
12 | import networkx
|
= help: Alias `tkinter` to `tk`

Expand All @@ -109,130 +111,172 @@ defaults.py:11:12: ICN001 [*] `tkinter` should be imported as `tk`
10 10 | import seaborn
11 |- import tkinter
11 |+ import tkinter as tk
12 12 |
12 12 | import networkx
13 13 |
14 14 | def unconventional_aliases():
14 14 |

defaults.py:15:22: ICN001 [*] `altair` should be imported as `alt`
defaults.py:12:12: ICN001 [*] `networkx` should be imported as `nx`
|
14 | def unconventional_aliases():
15 | import altair as altr
10 | import seaborn
11 | import tkinter
12 | import networkx
| ^^^^^^^^ ICN001
|
= help: Alias `networkx` to `nx`

ℹ Suggested fix
9 9 | import pandas
10 10 | import seaborn
11 11 | import tkinter
12 |- import networkx
12 |+ import networkx as nx
13 13 |
14 14 |
15 15 | def unconventional_aliases():

defaults.py:16:22: ICN001 [*] `altair` should be imported as `alt`
|
15 | def unconventional_aliases():
16 | import altair as altr
| ^^^^ ICN001
16 | import matplotlib.pyplot as plot
17 | import numpy as nmp
17 | import matplotlib.pyplot as plot
18 | import numpy as nmp
|
= help: Alias `altair` to `alt`

ℹ Suggested fix
12 12 |
13 13 |
14 14 | def unconventional_aliases():
15 |- import altair as altr
15 |+ import altair as alt
16 16 | import matplotlib.pyplot as plot
17 17 | import numpy as nmp
18 18 | import pandas as pdas

defaults.py:16:33: ICN001 [*] `matplotlib.pyplot` should be imported as `plt`
|
14 | def unconventional_aliases():
15 | import altair as altr
16 | import matplotlib.pyplot as plot
14 14 |
15 15 | def unconventional_aliases():
16 |- import altair as altr
16 |+ import altair as alt
17 17 | import matplotlib.pyplot as plot
18 18 | import numpy as nmp
19 19 | import pandas as pdas

defaults.py:17:33: ICN001 [*] `matplotlib.pyplot` should be imported as `plt`
|
15 | def unconventional_aliases():
16 | import altair as altr
17 | import matplotlib.pyplot as plot
| ^^^^ ICN001
17 | import numpy as nmp
18 | import pandas as pdas
18 | import numpy as nmp
19 | import pandas as pdas
|
= help: Alias `matplotlib.pyplot` to `plt`

ℹ Suggested fix
13 13 |
14 14 | def unconventional_aliases():
15 15 | import altair as altr
16 |- import matplotlib.pyplot as plot
16 |+ import matplotlib.pyplot as plt
17 17 | import numpy as nmp
18 18 | import pandas as pdas
19 19 | import seaborn as sbrn

defaults.py:17:21: ICN001 [*] `numpy` should be imported as `np`
|
15 | import altair as altr
16 | import matplotlib.pyplot as plot
17 | import numpy as nmp
14 14 |
15 15 | def unconventional_aliases():
16 16 | import altair as altr
17 |- import matplotlib.pyplot as plot
17 |+ import matplotlib.pyplot as plt
18 18 | import numpy as nmp
19 19 | import pandas as pdas
20 20 | import seaborn as sbrn

defaults.py:18:21: ICN001 [*] `numpy` should be imported as `np`
|
16 | import altair as altr
17 | import matplotlib.pyplot as plot
18 | import numpy as nmp
| ^^^ ICN001
18 | import pandas as pdas
19 | import seaborn as sbrn
19 | import pandas as pdas
20 | import seaborn as sbrn
|
= help: Alias `numpy` to `np`

ℹ Suggested fix
14 14 | def unconventional_aliases():
15 15 | import altair as altr
16 16 | import matplotlib.pyplot as plot
17 |- import numpy as nmp
17 |+ import numpy as np
18 18 | import pandas as pdas
19 19 | import seaborn as sbrn
20 20 | import tkinter as tkr

defaults.py:18:22: ICN001 [*] `pandas` should be imported as `pd`
|
16 | import matplotlib.pyplot as plot
17 | import numpy as nmp
18 | import pandas as pdas
15 15 | def unconventional_aliases():
16 16 | import altair as altr
17 17 | import matplotlib.pyplot as plot
18 |- import numpy as nmp
18 |+ import numpy as np
19 19 | import pandas as pdas
20 20 | import seaborn as sbrn
21 21 | import tkinter as tkr

defaults.py:19:22: ICN001 [*] `pandas` should be imported as `pd`
|
17 | import matplotlib.pyplot as plot
18 | import numpy as nmp
19 | import pandas as pdas
| ^^^^ ICN001
19 | import seaborn as sbrn
20 | import tkinter as tkr
20 | import seaborn as sbrn
21 | import tkinter as tkr
|
= help: Alias `pandas` to `pd`

ℹ Suggested fix
15 15 | import altair as altr
16 16 | import matplotlib.pyplot as plot
17 17 | import numpy as nmp
18 |- import pandas as pdas
18 |+ import pandas as pd
19 19 | import seaborn as sbrn
20 20 | import tkinter as tkr
21 21 |

defaults.py:19:23: ICN001 [*] `seaborn` should be imported as `sns`
|
17 | import numpy as nmp
18 | import pandas as pdas
19 | import seaborn as sbrn
16 16 | import altair as altr
17 17 | import matplotlib.pyplot as plot
18 18 | import numpy as nmp
19 |- import pandas as pdas
19 |+ import pandas as pd
20 20 | import seaborn as sbrn
21 21 | import tkinter as tkr
22 22 | import networkx as nxy

defaults.py:20:23: ICN001 [*] `seaborn` should be imported as `sns`
|
18 | import numpy as nmp
19 | import pandas as pdas
20 | import seaborn as sbrn
| ^^^^ ICN001
20 | import tkinter as tkr
21 | import tkinter as tkr
22 | import networkx as nxy
|
= help: Alias `seaborn` to `sns`

ℹ Suggested fix
16 16 | import matplotlib.pyplot as plot
17 17 | import numpy as nmp
18 18 | import pandas as pdas
19 |- import seaborn as sbrn
19 |+ import seaborn as sns
20 20 | import tkinter as tkr
21 21 |
22 22 |

defaults.py:20:23: ICN001 [*] `tkinter` should be imported as `tk`
|
18 | import pandas as pdas
19 | import seaborn as sbrn
20 | import tkinter as tkr
17 17 | import matplotlib.pyplot as plot
18 18 | import numpy as nmp
19 19 | import pandas as pdas
20 |- import seaborn as sbrn
20 |+ import seaborn as sns
21 21 | import tkinter as tkr
22 22 | import networkx as nxy
23 23 |

defaults.py:21:23: ICN001 [*] `tkinter` should be imported as `tk`
|
19 | import pandas as pdas
20 | import seaborn as sbrn
21 | import tkinter as tkr
| ^^^ ICN001
22 | import networkx as nxy
|
= help: Alias `tkinter` to `tk`

ℹ Suggested fix
17 17 | import numpy as nmp
18 18 | import pandas as pdas
19 19 | import seaborn as sbrn
20 |- import tkinter as tkr
20 |+ import tkinter as tk
21 21 |
22 22 |
23 23 | def conventional_aliases():
18 18 | import numpy as nmp
19 19 | import pandas as pdas
20 20 | import seaborn as sbrn
21 |- import tkinter as tkr
21 |+ import tkinter as tk
22 22 | import networkx as nxy
23 23 |
24 24 | def conventional_aliases():

defaults.py:22:24: ICN001 [*] `networkx` should be imported as `nx`
|
20 | import seaborn as sbrn
21 | import tkinter as tkr
22 | import networkx as nxy
| ^^^ ICN001
23 |
24 | def conventional_aliases():
|
= help: Alias `networkx` to `nx`

ℹ Suggested fix
19 19 | import pandas as pdas
20 20 | import seaborn as sbrn
21 21 | import tkinter as tkr
22 |- import networkx as nxy
22 |+ import networkx as nx
23 23 |
24 24 | def conventional_aliases():
25 25 | import altair as alt