Enable NPY in ruff
This commit is contained in:
parent
5beb88559f
commit
652713e702
2 changed files with 11 additions and 7 deletions
|
|
@ -254,6 +254,8 @@ select = [
|
||||||
# ========================================
|
# ========================================
|
||||||
# refurb => Modern idioms
|
# refurb => Modern idioms
|
||||||
# "FURB",
|
# "FURB",
|
||||||
|
# NumPy-specific rules => Modern `numpy` APIs
|
||||||
|
# "NPY",
|
||||||
# Perflint => No performance anti-patterns
|
# Perflint => No performance anti-patterns
|
||||||
# "PERF",
|
# "PERF",
|
||||||
# Pylint => Fewer bugs and simpler code
|
# Pylint => Fewer bugs and simpler code
|
||||||
|
|
@ -544,6 +546,8 @@ select = [
|
||||||
"I",
|
"I",
|
||||||
# flake8-import-conventions => Unified import aliases
|
# flake8-import-conventions => Unified import aliases
|
||||||
"ICN",
|
"ICN",
|
||||||
|
# NumPy-specific rules => Modern `numpy` APIs
|
||||||
|
"NPY",
|
||||||
# Perflint => No performance anti-patterns
|
# Perflint => No performance anti-patterns
|
||||||
"PERF",
|
"PERF",
|
||||||
# Pylint => Fewer bugs and simpler code
|
# Pylint => Fewer bugs and simpler code
|
||||||
|
|
|
||||||
|
|
@ -20,14 +20,14 @@ def make_random_cmap(
|
||||||
Returns:
|
Returns:
|
||||||
colormap
|
colormap
|
||||||
"""
|
"""
|
||||||
np.random.seed(42)
|
rng = np.random.default_rng(42)
|
||||||
|
|
||||||
if bright:
|
if bright:
|
||||||
hsv_colors = [
|
hsv_colors = [
|
||||||
(
|
(
|
||||||
np.random.uniform(low=0.0, high=1),
|
rng.uniform(low=0.0, high=1),
|
||||||
np.random.uniform(low=0.2, high=1),
|
rng.uniform(low=0.2, high=1),
|
||||||
np.random.uniform(low=0.9, high=1),
|
rng.uniform(low=0.9, high=1),
|
||||||
)
|
)
|
||||||
for _ in range(n_colors)
|
for _ in range(n_colors)
|
||||||
]
|
]
|
||||||
|
|
@ -40,9 +40,9 @@ def make_random_cmap(
|
||||||
|
|
||||||
rgb_colors = [
|
rgb_colors = [
|
||||||
(
|
(
|
||||||
np.random.uniform(low=low, high=high),
|
rng.uniform(low=low, high=high),
|
||||||
np.random.uniform(low=low, high=high),
|
rng.uniform(low=low, high=high),
|
||||||
np.random.uniform(low=low, high=high),
|
rng.uniform(low=low, high=high),
|
||||||
)
|
)
|
||||||
for _ in range(n_colors)
|
for _ in range(n_colors)
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue