From 867c1f7edc9953396821482a17a4776aff70eba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Mon, 28 Oct 2024 12:32:23 +0100 Subject: [PATCH] CLN: tidy import statements --- conftest.py | 3 --- pyproject.toml | 1 + src/cmasher/__init__.py | 2 -- src/cmasher/app_usage.py | 2 -- src/cmasher/cli_tools.py | 5 ----- src/cmasher/cm.py | 5 ----- src/cmasher/colormaps/amber/amber.py | 2 -- src/cmasher/colormaps/amethyst/amethyst.py | 2 -- src/cmasher/colormaps/apple/apple.py | 2 -- src/cmasher/colormaps/arctic/arctic.py | 2 -- src/cmasher/colormaps/bubblegum/bubblegum.py | 2 -- src/cmasher/colormaps/chroma/chroma.py | 2 -- src/cmasher/colormaps/copper/copper.py | 2 -- src/cmasher/colormaps/cosmic/cosmic.py | 2 -- src/cmasher/colormaps/dusk/dusk.py | 2 -- src/cmasher/colormaps/eclipse/eclipse.py | 2 -- src/cmasher/colormaps/ember/ember.py | 2 -- src/cmasher/colormaps/emerald/emerald.py | 2 -- src/cmasher/colormaps/emergency/emergency.py | 2 -- src/cmasher/colormaps/fall/fall.py | 2 -- src/cmasher/colormaps/flamingo/flamingo.py | 2 -- src/cmasher/colormaps/freeze/freeze.py | 2 -- src/cmasher/colormaps/fusion/fusion.py | 2 -- src/cmasher/colormaps/gem/gem.py | 2 -- src/cmasher/colormaps/ghostlight/ghostlight.py | 2 -- src/cmasher/colormaps/gothic/gothic.py | 2 -- src/cmasher/colormaps/guppy/guppy.py | 2 -- src/cmasher/colormaps/holly/holly.py | 2 -- src/cmasher/colormaps/horizon/horizon.py | 2 -- src/cmasher/colormaps/iceburn/iceburn.py | 2 -- src/cmasher/colormaps/infinity/infinity.py | 2 -- src/cmasher/colormaps/jungle/jungle.py | 2 -- src/cmasher/colormaps/lavender/lavender.py | 2 -- src/cmasher/colormaps/lilac/lilac.py | 2 -- src/cmasher/colormaps/neon/neon.py | 2 -- src/cmasher/colormaps/neutral/neutral.py | 2 -- src/cmasher/colormaps/nuclear/nuclear.py | 2 -- src/cmasher/colormaps/ocean/ocean.py | 2 -- src/cmasher/colormaps/pepper/pepper.py | 2 -- src/cmasher/colormaps/prep_cmap_data.py | 9 +-------- src/cmasher/colormaps/pride/pride.py | 2 -- src/cmasher/colormaps/prinsenvlag/prinsenvlag.py | 2 -- src/cmasher/colormaps/rainforest/rainforest.py | 2 -- src/cmasher/colormaps/redshift/redshift.py | 2 -- src/cmasher/colormaps/sapphire/sapphire.py | 2 -- src/cmasher/colormaps/savanna/savanna.py | 2 -- src/cmasher/colormaps/seasons/seasons.py | 2 -- src/cmasher/colormaps/seaweed/seaweed.py | 2 -- src/cmasher/colormaps/sepia/sepia.py | 2 -- src/cmasher/colormaps/sunburst/sunburst.py | 2 -- src/cmasher/colormaps/swamp/swamp.py | 2 -- src/cmasher/colormaps/torch/torch.py | 2 -- src/cmasher/colormaps/toxic/toxic.py | 2 -- src/cmasher/colormaps/tree/tree.py | 2 -- src/cmasher/colormaps/tropical/tropical.py | 2 -- src/cmasher/colormaps/viola/viola.py | 2 -- src/cmasher/colormaps/voltage/voltage.py | 2 -- src/cmasher/colormaps/waterlily/waterlily.py | 2 -- src/cmasher/colormaps/watermelon/watermelon.py | 2 -- src/cmasher/colormaps/wildfire/wildfire.py | 2 -- src/cmasher/utils.py | 11 +---------- tests/test_utils.py | 4 ---- 62 files changed, 3 insertions(+), 145 deletions(-) diff --git a/conftest.py b/conftest.py index c0255e88..b2b7d3c9 100644 --- a/conftest.py +++ b/conftest.py @@ -1,8 +1,5 @@ -# %% IMPORTS -# Built-in imports import sys -# Package imports import matplotlib as mpl import pytest from py.path import local diff --git a/pyproject.toml b/pyproject.toml index 1fc1b15c..e9bb1116 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 diff --git a/src/cmasher/__init__.py b/src/cmasher/__init__.py index ec408408..04f70140 100644 --- a/src/cmasher/__init__.py +++ b/src/cmasher/__init__.py @@ -5,8 +5,6 @@ """ -# %% IMPORTS AND DECLARATIONS -# CMasher imports from . import app_usage, cm, utils from .__version__ import __version__ from .cm import * diff --git a/src/cmasher/app_usage.py b/src/cmasher/app_usage.py index 37a92b18..204a20f0 100644 --- a/src/cmasher/app_usage.py +++ b/src/cmasher/app_usage.py @@ -6,8 +6,6 @@ """ -# %% IMPORTS -# Built-in imports import os import re from pathlib import Path diff --git a/src/cmasher/cli_tools.py b/src/cmasher/cli_tools.py index 97a26fab..bd1e507c 100644 --- a/src/cmasher/cli_tools.py +++ b/src/cmasher/cli_tools.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Built-in imports import argparse import os import re @@ -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 diff --git a/src/cmasher/cm.py b/src/cmasher/cm.py index e72cf508..a74571bf 100644 --- a/src/cmasher/cm.py +++ b/src/cmasher/cm.py @@ -5,11 +5,6 @@ """ - -# %% IMPORTS -# Built-in imports - -# Package imports from matplotlib.colors import ListedColormap as LC # All declaration diff --git a/src/cmasher/colormaps/amber/amber.py b/src/cmasher/colormaps/amber/amber.py index 0b247a78..abdb75c2 100644 --- a/src/cmasher/colormaps/amber/amber.py +++ b/src/cmasher/colormaps/amber/amber.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/amethyst/amethyst.py b/src/cmasher/colormaps/amethyst/amethyst.py index 27f373bb..88f46e29 100644 --- a/src/cmasher/colormaps/amethyst/amethyst.py +++ b/src/cmasher/colormaps/amethyst/amethyst.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/apple/apple.py b/src/cmasher/colormaps/apple/apple.py index 9bc4da8e..d74e0ae0 100644 --- a/src/cmasher/colormaps/apple/apple.py +++ b/src/cmasher/colormaps/apple/apple.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/arctic/arctic.py b/src/cmasher/colormaps/arctic/arctic.py index 2a6de9c4..89a241d9 100644 --- a/src/cmasher/colormaps/arctic/arctic.py +++ b/src/cmasher/colormaps/arctic/arctic.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/bubblegum/bubblegum.py b/src/cmasher/colormaps/bubblegum/bubblegum.py index 6ac57389..432021f5 100644 --- a/src/cmasher/colormaps/bubblegum/bubblegum.py +++ b/src/cmasher/colormaps/bubblegum/bubblegum.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/chroma/chroma.py b/src/cmasher/colormaps/chroma/chroma.py index c8241424..334fcd8b 100644 --- a/src/cmasher/colormaps/chroma/chroma.py +++ b/src/cmasher/colormaps/chroma/chroma.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/copper/copper.py b/src/cmasher/colormaps/copper/copper.py index ff500518..38fafc52 100644 --- a/src/cmasher/colormaps/copper/copper.py +++ b/src/cmasher/colormaps/copper/copper.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/cosmic/cosmic.py b/src/cmasher/colormaps/cosmic/cosmic.py index 4b9d4710..d04aa4a6 100644 --- a/src/cmasher/colormaps/cosmic/cosmic.py +++ b/src/cmasher/colormaps/cosmic/cosmic.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/dusk/dusk.py b/src/cmasher/colormaps/dusk/dusk.py index 68f13682..445517ed 100644 --- a/src/cmasher/colormaps/dusk/dusk.py +++ b/src/cmasher/colormaps/dusk/dusk.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/eclipse/eclipse.py b/src/cmasher/colormaps/eclipse/eclipse.py index 7bdf4b2e..5b817c56 100644 --- a/src/cmasher/colormaps/eclipse/eclipse.py +++ b/src/cmasher/colormaps/eclipse/eclipse.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/ember/ember.py b/src/cmasher/colormaps/ember/ember.py index 1a729389..5f4b7abd 100644 --- a/src/cmasher/colormaps/ember/ember.py +++ b/src/cmasher/colormaps/ember/ember.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/emerald/emerald.py b/src/cmasher/colormaps/emerald/emerald.py index 9294ffc2..07ce1c5e 100644 --- a/src/cmasher/colormaps/emerald/emerald.py +++ b/src/cmasher/colormaps/emerald/emerald.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/emergency/emergency.py b/src/cmasher/colormaps/emergency/emergency.py index 39464549..3f2f785a 100644 --- a/src/cmasher/colormaps/emergency/emergency.py +++ b/src/cmasher/colormaps/emergency/emergency.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/fall/fall.py b/src/cmasher/colormaps/fall/fall.py index 1abb142d..32349b79 100644 --- a/src/cmasher/colormaps/fall/fall.py +++ b/src/cmasher/colormaps/fall/fall.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/flamingo/flamingo.py b/src/cmasher/colormaps/flamingo/flamingo.py index 003ff15a..546505d9 100644 --- a/src/cmasher/colormaps/flamingo/flamingo.py +++ b/src/cmasher/colormaps/flamingo/flamingo.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/freeze/freeze.py b/src/cmasher/colormaps/freeze/freeze.py index b8d56f45..cf15c940 100644 --- a/src/cmasher/colormaps/freeze/freeze.py +++ b/src/cmasher/colormaps/freeze/freeze.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/fusion/fusion.py b/src/cmasher/colormaps/fusion/fusion.py index 474c0781..4ee62c2d 100644 --- a/src/cmasher/colormaps/fusion/fusion.py +++ b/src/cmasher/colormaps/fusion/fusion.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/gem/gem.py b/src/cmasher/colormaps/gem/gem.py index 41bca5ae..e32e6ee7 100644 --- a/src/cmasher/colormaps/gem/gem.py +++ b/src/cmasher/colormaps/gem/gem.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/ghostlight/ghostlight.py b/src/cmasher/colormaps/ghostlight/ghostlight.py index d737193c..43e4ee6d 100644 --- a/src/cmasher/colormaps/ghostlight/ghostlight.py +++ b/src/cmasher/colormaps/ghostlight/ghostlight.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/gothic/gothic.py b/src/cmasher/colormaps/gothic/gothic.py index 0beeeae2..4f7f1431 100644 --- a/src/cmasher/colormaps/gothic/gothic.py +++ b/src/cmasher/colormaps/gothic/gothic.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/guppy/guppy.py b/src/cmasher/colormaps/guppy/guppy.py index 5b7fa1c0..7f158b85 100644 --- a/src/cmasher/colormaps/guppy/guppy.py +++ b/src/cmasher/colormaps/guppy/guppy.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/holly/holly.py b/src/cmasher/colormaps/holly/holly.py index 49a88ad5..f1bec83b 100644 --- a/src/cmasher/colormaps/holly/holly.py +++ b/src/cmasher/colormaps/holly/holly.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/horizon/horizon.py b/src/cmasher/colormaps/horizon/horizon.py index 1cfb9018..2fe40a85 100644 --- a/src/cmasher/colormaps/horizon/horizon.py +++ b/src/cmasher/colormaps/horizon/horizon.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/iceburn/iceburn.py b/src/cmasher/colormaps/iceburn/iceburn.py index 36bc7603..8a1076fd 100644 --- a/src/cmasher/colormaps/iceburn/iceburn.py +++ b/src/cmasher/colormaps/iceburn/iceburn.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/infinity/infinity.py b/src/cmasher/colormaps/infinity/infinity.py index 56aef056..d8b4a3c8 100644 --- a/src/cmasher/colormaps/infinity/infinity.py +++ b/src/cmasher/colormaps/infinity/infinity.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/jungle/jungle.py b/src/cmasher/colormaps/jungle/jungle.py index a55d2965..608376df 100644 --- a/src/cmasher/colormaps/jungle/jungle.py +++ b/src/cmasher/colormaps/jungle/jungle.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/lavender/lavender.py b/src/cmasher/colormaps/lavender/lavender.py index d7dc9010..265f5cad 100644 --- a/src/cmasher/colormaps/lavender/lavender.py +++ b/src/cmasher/colormaps/lavender/lavender.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/lilac/lilac.py b/src/cmasher/colormaps/lilac/lilac.py index 6aa27e1a..53c2a907 100644 --- a/src/cmasher/colormaps/lilac/lilac.py +++ b/src/cmasher/colormaps/lilac/lilac.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/neon/neon.py b/src/cmasher/colormaps/neon/neon.py index 83b732e9..8fe9df2a 100644 --- a/src/cmasher/colormaps/neon/neon.py +++ b/src/cmasher/colormaps/neon/neon.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/neutral/neutral.py b/src/cmasher/colormaps/neutral/neutral.py index 49121fae..d72a43eb 100644 --- a/src/cmasher/colormaps/neutral/neutral.py +++ b/src/cmasher/colormaps/neutral/neutral.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/nuclear/nuclear.py b/src/cmasher/colormaps/nuclear/nuclear.py index 6fd7ee59..1d79deb1 100644 --- a/src/cmasher/colormaps/nuclear/nuclear.py +++ b/src/cmasher/colormaps/nuclear/nuclear.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/ocean/ocean.py b/src/cmasher/colormaps/ocean/ocean.py index 1696fe6d..29089cd5 100644 --- a/src/cmasher/colormaps/ocean/ocean.py +++ b/src/cmasher/colormaps/ocean/ocean.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/pepper/pepper.py b/src/cmasher/colormaps/pepper/pepper.py index 58f7f591..2235eddb 100644 --- a/src/cmasher/colormaps/pepper/pepper.py +++ b/src/cmasher/colormaps/pepper/pepper.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/prep_cmap_data.py b/src/cmasher/colormaps/prep_cmap_data.py index fd3c3075..c195e3f0 100644 --- a/src/cmasher/colormaps/prep_cmap_data.py +++ b/src/cmasher/colormaps/prep_cmap_data.py @@ -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, diff --git a/src/cmasher/colormaps/pride/pride.py b/src/cmasher/colormaps/pride/pride.py index a16b4181..deb44058 100644 --- a/src/cmasher/colormaps/pride/pride.py +++ b/src/cmasher/colormaps/pride/pride.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/prinsenvlag/prinsenvlag.py b/src/cmasher/colormaps/prinsenvlag/prinsenvlag.py index e9de085d..037cde0f 100644 --- a/src/cmasher/colormaps/prinsenvlag/prinsenvlag.py +++ b/src/cmasher/colormaps/prinsenvlag/prinsenvlag.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/rainforest/rainforest.py b/src/cmasher/colormaps/rainforest/rainforest.py index 6f1e25d7..01f300d7 100644 --- a/src/cmasher/colormaps/rainforest/rainforest.py +++ b/src/cmasher/colormaps/rainforest/rainforest.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/redshift/redshift.py b/src/cmasher/colormaps/redshift/redshift.py index b797c4f9..c4651dd1 100644 --- a/src/cmasher/colormaps/redshift/redshift.py +++ b/src/cmasher/colormaps/redshift/redshift.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/sapphire/sapphire.py b/src/cmasher/colormaps/sapphire/sapphire.py index 8e784a0d..99c9fe35 100644 --- a/src/cmasher/colormaps/sapphire/sapphire.py +++ b/src/cmasher/colormaps/sapphire/sapphire.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/savanna/savanna.py b/src/cmasher/colormaps/savanna/savanna.py index 15265d67..50ffcc4b 100644 --- a/src/cmasher/colormaps/savanna/savanna.py +++ b/src/cmasher/colormaps/savanna/savanna.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/seasons/seasons.py b/src/cmasher/colormaps/seasons/seasons.py index 93f8df0b..c7c875e1 100644 --- a/src/cmasher/colormaps/seasons/seasons.py +++ b/src/cmasher/colormaps/seasons/seasons.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/seaweed/seaweed.py b/src/cmasher/colormaps/seaweed/seaweed.py index cda195e0..0496dfc0 100644 --- a/src/cmasher/colormaps/seaweed/seaweed.py +++ b/src/cmasher/colormaps/seaweed/seaweed.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/sepia/sepia.py b/src/cmasher/colormaps/sepia/sepia.py index 24d8f1bf..c13631d7 100644 --- a/src/cmasher/colormaps/sepia/sepia.py +++ b/src/cmasher/colormaps/sepia/sepia.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/sunburst/sunburst.py b/src/cmasher/colormaps/sunburst/sunburst.py index c79e6fcb..512a01d2 100644 --- a/src/cmasher/colormaps/sunburst/sunburst.py +++ b/src/cmasher/colormaps/sunburst/sunburst.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/swamp/swamp.py b/src/cmasher/colormaps/swamp/swamp.py index d0684e2f..aa160549 100644 --- a/src/cmasher/colormaps/swamp/swamp.py +++ b/src/cmasher/colormaps/swamp/swamp.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/torch/torch.py b/src/cmasher/colormaps/torch/torch.py index f4dc6d5a..52ffba0a 100644 --- a/src/cmasher/colormaps/torch/torch.py +++ b/src/cmasher/colormaps/torch/torch.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/toxic/toxic.py b/src/cmasher/colormaps/toxic/toxic.py index 7e05bbcd..ec89642f 100644 --- a/src/cmasher/colormaps/toxic/toxic.py +++ b/src/cmasher/colormaps/toxic/toxic.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/tree/tree.py b/src/cmasher/colormaps/tree/tree.py index 81676323..0c5d6d5a 100644 --- a/src/cmasher/colormaps/tree/tree.py +++ b/src/cmasher/colormaps/tree/tree.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/tropical/tropical.py b/src/cmasher/colormaps/tropical/tropical.py index de4836e5..1d707e11 100644 --- a/src/cmasher/colormaps/tropical/tropical.py +++ b/src/cmasher/colormaps/tropical/tropical.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/viola/viola.py b/src/cmasher/colormaps/viola/viola.py index 49227f79..e7cbaf82 100644 --- a/src/cmasher/colormaps/viola/viola.py +++ b/src/cmasher/colormaps/viola/viola.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/voltage/voltage.py b/src/cmasher/colormaps/voltage/voltage.py index 82cb7547..a19c9861 100644 --- a/src/cmasher/colormaps/voltage/voltage.py +++ b/src/cmasher/colormaps/voltage/voltage.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/waterlily/waterlily.py b/src/cmasher/colormaps/waterlily/waterlily.py index 3ee26989..7d1f593c 100644 --- a/src/cmasher/colormaps/waterlily/waterlily.py +++ b/src/cmasher/colormaps/waterlily/waterlily.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/watermelon/watermelon.py b/src/cmasher/colormaps/watermelon/watermelon.py index 913699c8..5de44cbb 100644 --- a/src/cmasher/colormaps/watermelon/watermelon.py +++ b/src/cmasher/colormaps/watermelon/watermelon.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/colormaps/wildfire/wildfire.py b/src/cmasher/colormaps/wildfire/wildfire.py index ac594c8f..4820bfbd 100644 --- a/src/cmasher/colormaps/wildfire/wildfire.py +++ b/src/cmasher/colormaps/wildfire/wildfire.py @@ -1,5 +1,3 @@ -# %% IMPORTS -# Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/src/cmasher/utils.py b/src/cmasher/utils.py index 7dfba311..c61db93f 100644 --- a/src/cmasher/utils.py +++ b/src/cmasher/utils.py @@ -5,22 +5,16 @@ """ -# %% IMPORTS -# Built-in imports import os from collections import OrderedDict from collections.abc import Callable -from glob import glob from importlib.util import find_spec -from os import path from pathlib import Path from textwrap import dedent -from typing import TYPE_CHECKING, Optional, Union +from typing import TYPE_CHECKING import matplotlib as mpl import numpy as np - -# Package imports from colorspacious import cspace_converter from matplotlib.colors import ( Colormap, @@ -30,7 +24,6 @@ to_rgb, ) -# CMasher imports from cmasher import cm as cmrcm from ._known_cmap_types import _CMASHER_BUILTIN_MAP_TYPES @@ -414,8 +407,6 @@ def create_cmap_mod( # Create Python module template and add obtained RGB data to it cm_py_file = dedent( """ - # %% IMPORTS - # Package imports import matplotlib as mpl from matplotlib.colors import ListedColormap diff --git a/tests/test_utils.py b/tests/test_utils.py index 7eda9c08..96295c0b 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,10 +1,7 @@ -# %% IMPORTS -# Built-in imports import shutil from importlib.util import find_spec, module_from_spec, spec_from_file_location from pathlib import Path -# Package imports import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np @@ -12,7 +9,6 @@ from matplotlib.colors import ListedColormap as LC from matplotlib.legend import Legend -# CMasher imports import cmasher as cmr from cmasher import cm as cmrcm from cmasher.utils import (