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

CLN: tidy import statements #163

Merged
merged 1 commit into from
Oct 28, 2024
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
3 changes: 0 additions & 3 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# %% IMPORTS
# Built-in imports
import sys

# Package imports
import matplotlib as mpl
import pytest
from py.path import local
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ select = [
"B", # flake8-bugbear
"YTT", # flake8-2020
"PTH", # flake8-use-pathlib
"TCH", # flake8-type-checking
"I", # isort
"UP", # pyupgrade
"NPY", # numpy specific rules
Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

"""

# %% IMPORTS AND DECLARATIONS
# CMasher imports
from . import app_usage, cm, utils
from .__version__ import __version__
from .cm import *
Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/app_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

"""

# %% IMPORTS
# Built-in imports
import os
import re
from pathlib import Path
Expand Down
5 changes: 0 additions & 5 deletions src/cmasher/cli_tools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Built-in imports
import argparse
import os
import re
Expand All @@ -8,13 +6,10 @@
from pathlib import Path
from textwrap import dedent

# Package imports
import matplotlib as mpl
import numpy as np

import cmasher as cmr

# CMasher imports
from cmasher import __version__

# All declaration
Expand Down
5 changes: 0 additions & 5 deletions src/cmasher/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

"""


# %% IMPORTS
# Built-in imports

# Package imports
from matplotlib.colors import ListedColormap as LC

# All declaration
Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/amber/amber.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/amethyst/amethyst.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/apple/apple.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/arctic/arctic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/bubblegum/bubblegum.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/chroma/chroma.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/copper/copper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/cosmic/cosmic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/dusk/dusk.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/eclipse/eclipse.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/ember/ember.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/emerald/emerald.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/emergency/emergency.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/fall/fall.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/flamingo/flamingo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/freeze/freeze.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/fusion/fusion.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/gem/gem.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/ghostlight/ghostlight.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/gothic/gothic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/guppy/guppy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/holly/holly.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/horizon/horizon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/iceburn/iceburn.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/infinity/infinity.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/jungle/jungle.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/lavender/lavender.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/lilac/lilac.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/neon/neon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/neutral/neutral.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/nuclear/nuclear.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/ocean/ocean.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/pepper/pepper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
9 changes: 1 addition & 8 deletions src/cmasher/colormaps/prep_cmap_data.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# %% Imports
# Built-in imports
import os
import shutil
import sys
from itertools import zip_longest
from os import path
from pathlib import Path
from textwrap import dedent

import matplotlib.pyplot as plt
import numpy as np
import viscm

# Package imports
from matplotlib.colors import TwoSlopeNorm, to_hex

# CMasher imports
from cmasher.app_usage import update_tableau_pref_file
from cmasher.cm import cmap_cd, cmap_d
from cmasher.cm import cmap_cd
from cmasher.utils import (
create_cmap_mod,
create_cmap_overview,
Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/pride/pride.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/prinsenvlag/prinsenvlag.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/rainforest/rainforest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/redshift/redshift.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/sapphire/sapphire.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/savanna/savanna.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/seasons/seasons.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/seaweed/seaweed.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/sepia/sepia.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/sunburst/sunburst.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/swamp/swamp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/torch/torch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/toxic/toxic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/tree/tree.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/tropical/tropical.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/viola/viola.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/voltage/voltage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
2 changes: 0 additions & 2 deletions src/cmasher/colormaps/waterlily/waterlily.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# %% IMPORTS
# Package imports
import matplotlib as mpl
from matplotlib.colors import ListedColormap

Expand Down
Loading