kplot 1.1.35__tar.gz → 1.1.37__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kplot
3
- Version: 1.1.35
3
+ Version: 1.1.37
4
4
  Summary: a matplotlib wrapper for keyan :-)
5
5
  Author: Keyan Gootkin
6
6
  Author-email: Keyan Gootkin <keyangootkin@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "kplot"
3
- version = "1.1.35"
3
+ version = "1.1.37"
4
4
  description = "a matplotlib wrapper for keyan :-)"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -5,9 +5,10 @@ from kbasic.typing import Number, Array
5
5
  from collections.abc import Iterable
6
6
  from typing import Optional
7
7
  from matplotlib.pyplot import cm, gca
8
+ from matplotlib.cm import ScalarMappable
8
9
  from matplotlib.colors import Colormap, LinearSegmentedColormap, ListedColormap, \
9
10
  hex2color, Normalize, LogNorm, FuncNorm, AsinhNorm, PowerNorm, SymLogNorm, \
10
- BoundaryNorm, CenteredNorm, TwoSlopeNorm, ScalarMappable
11
+ BoundaryNorm, CenteredNorm, TwoSlopeNorm
11
12
  from matplotlib.axes_grid1 import make_axes_locatable
12
13
  from matplotlib.axes import Axes
13
14
  from numpy import uint8, zeros, ndarray, inf, nanmin, nanmax, nanquantile, nanmean, \
@@ -84,7 +85,9 @@ def parse_color(
84
85
  """docstring"""
85
86
  match color:
86
87
  # given an rgb(a)
87
- case ((r, g, b) | (rr, gg, bb, a)) if all(type(x) in Number.types for x in color):
88
+ case (r, g, b) if all(type(x) in Number.types for x in color):
89
+ return color
90
+ case (r, g, b, a) if all(type(x) in Number.types for x in color):
88
91
  return color
89
92
  # otherwise assume arrays of numbers want to be color-mapped
90
93
  case x if type(color) in Array.types and type(color[0]) in Number.types:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes