Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/__init__.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/basevalidators.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/data_utils.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/exceptions.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/files.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/importers.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/optional_imports.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/png.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/utils.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__init__.py +883 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/__init__.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/_swatches.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/carto.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/cmocean.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/colorbrewer.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/cyclical.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/diverging.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/plotlyjs.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/qualitative.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/sequential.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/_swatches.py +161 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/carto.py +419 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/cmocean.py +296 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/colorbrewer.py +494 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/cyclical.py +157 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/diverging.py +75 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/plotlyjs.py +180 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/qualitative.py +184 -0
- .venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/sequential.py +257 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/__config__.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/__init__.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_array_api_info.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_configtool.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_distributor_init.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_expired_attrs_2_0.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_globals.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_pytesttester.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/conftest.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/dtypes.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/exceptions.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/matlib.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/version.cpython-312.pyc +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/_core/__init__.py +203 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/_core/__init__.pyi +666 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/_core/_add_newdocs.py +0 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/_core/_add_newdocs.pyi +2 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/_core/_add_newdocs_scalars.py +381 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/_core/_add_newdocs_scalars.pyi +16 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/_core/_asarray.py +130 -0
- .venv_haddock/lib/python3.12/site-packages/numpy/_core/_asarray.pyi +43 -0
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (205 Bytes). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/basevalidators.cpython-312.pyc
ADDED
|
Binary file (91.9 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/data_utils.cpython-312.pyc
ADDED
|
Binary file (3.38 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/exceptions.cpython-312.pyc
ADDED
|
Binary file (5.83 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/files.cpython-312.pyc
ADDED
|
Binary file (1.76 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/importers.cpython-312.pyc
ADDED
|
Binary file (2.21 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/optional_imports.cpython-312.pyc
ADDED
|
Binary file (1.49 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/png.cpython-312.pyc
ADDED
|
Binary file (86.3 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/__pycache__/utils.cpython-312.pyc
ADDED
|
Binary file (22.1 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__init__.py
ADDED
|
@@ -0,0 +1,883 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
colors
|
| 3 |
+
=====
|
| 4 |
+
|
| 5 |
+
Functions that manipulate colors and arrays of colors.
|
| 6 |
+
|
| 7 |
+
-----
|
| 8 |
+
There are three basic types of color types: rgb, hex and tuple:
|
| 9 |
+
|
| 10 |
+
rgb - An rgb color is a string of the form 'rgb(a,b,c)' where a, b and c are
|
| 11 |
+
integers between 0 and 255 inclusive.
|
| 12 |
+
|
| 13 |
+
hex - A hex color is a string of the form '#xxxxxx' where each x is a
|
| 14 |
+
character that belongs to the set [0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f]. This is
|
| 15 |
+
just the set of characters used in the hexadecimal numeric system.
|
| 16 |
+
|
| 17 |
+
tuple - A tuple color is a 3-tuple of the form (a,b,c) where a, b and c are
|
| 18 |
+
floats between 0 and 1 inclusive.
|
| 19 |
+
|
| 20 |
+
-----
|
| 21 |
+
Colormaps and Colorscales:
|
| 22 |
+
A colormap or a colorscale is a correspondence between values - Pythonic
|
| 23 |
+
objects such as strings and floats - to colors.
|
| 24 |
+
|
| 25 |
+
There are typically two main types of colormaps that exist: numerical and
|
| 26 |
+
categorical colormaps.
|
| 27 |
+
|
| 28 |
+
Numerical:
|
| 29 |
+
----------
|
| 30 |
+
Numerical colormaps are used when the coloring column being used takes a
|
| 31 |
+
spectrum of values or numbers.
|
| 32 |
+
|
| 33 |
+
A classic example from the Plotly library:
|
| 34 |
+
```
|
| 35 |
+
rainbow_colorscale = [
|
| 36 |
+
[0, 'rgb(150,0,90)'], [0.125, 'rgb(0,0,200)'],
|
| 37 |
+
[0.25, 'rgb(0,25,255)'], [0.375, 'rgb(0,152,255)'],
|
| 38 |
+
[0.5, 'rgb(44,255,150)'], [0.625, 'rgb(151,255,0)'],
|
| 39 |
+
[0.75, 'rgb(255,234,0)'], [0.875, 'rgb(255,111,0)'],
|
| 40 |
+
[1, 'rgb(255,0,0)']
|
| 41 |
+
]
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
Notice that this colorscale is a list of lists with each inner list containing
|
| 45 |
+
a number and a color. These left hand numbers in the nested lists go from 0 to
|
| 46 |
+
1, and they are like pointers tell you when a number is mapped to a specific
|
| 47 |
+
color.
|
| 48 |
+
|
| 49 |
+
If you have a column of numbers `col_num` that you want to plot, and you know
|
| 50 |
+
|
| 51 |
+
```
|
| 52 |
+
min(col_num) = 0
|
| 53 |
+
max(col_num) = 100
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
then if you pull out the number `12.5` in the list and want to figure out what
|
| 57 |
+
color the corresponding chart element (bar, scatter plot, etc) is going to be,
|
| 58 |
+
you'll figure out that proportionally 12.5 to 100 is the same as 0.125 to 1.
|
| 59 |
+
So, the point will be mapped to 'rgb(0,0,200)'.
|
| 60 |
+
|
| 61 |
+
All other colors between the pinned values in a colorscale are linearly
|
| 62 |
+
interpolated.
|
| 63 |
+
|
| 64 |
+
Categorical:
|
| 65 |
+
------------
|
| 66 |
+
Alternatively, a categorical colormap is used to assign a specific value in a
|
| 67 |
+
color column to a specific color everytime it appears in the dataset.
|
| 68 |
+
|
| 69 |
+
A column of strings in a panadas.dataframe that is chosen to serve as the
|
| 70 |
+
color index would naturally use a categorical colormap. However, you can
|
| 71 |
+
choose to use a categorical colormap with a column of numbers.
|
| 72 |
+
|
| 73 |
+
Be careful! If you have a lot of unique numbers in your color column you will
|
| 74 |
+
end up with a colormap that is massive and may slow down graphing performance.
|
| 75 |
+
"""
|
| 76 |
+
|
| 77 |
+
import decimal
|
| 78 |
+
from numbers import Number
|
| 79 |
+
|
| 80 |
+
from _plotly_utils import exceptions
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
# Built-in qualitative color sequences and sequential,
|
| 84 |
+
# diverging and cyclical color scales.
|
| 85 |
+
#
|
| 86 |
+
# Initially ported over from plotly_express
|
| 87 |
+
from . import ( # noqa: F401
|
| 88 |
+
qualitative,
|
| 89 |
+
sequential,
|
| 90 |
+
diverging,
|
| 91 |
+
cyclical,
|
| 92 |
+
cmocean,
|
| 93 |
+
colorbrewer,
|
| 94 |
+
carto,
|
| 95 |
+
plotlyjs,
|
| 96 |
+
)
|
| 97 |
+
|
| 98 |
+
DEFAULT_PLOTLY_COLORS = [
|
| 99 |
+
"rgb(31, 119, 180)",
|
| 100 |
+
"rgb(255, 127, 14)",
|
| 101 |
+
"rgb(44, 160, 44)",
|
| 102 |
+
"rgb(214, 39, 40)",
|
| 103 |
+
"rgb(148, 103, 189)",
|
| 104 |
+
"rgb(140, 86, 75)",
|
| 105 |
+
"rgb(227, 119, 194)",
|
| 106 |
+
"rgb(127, 127, 127)",
|
| 107 |
+
"rgb(188, 189, 34)",
|
| 108 |
+
"rgb(23, 190, 207)",
|
| 109 |
+
]
|
| 110 |
+
|
| 111 |
+
PLOTLY_SCALES = {
|
| 112 |
+
"Greys": [[0, "rgb(0,0,0)"], [1, "rgb(255,255,255)"]],
|
| 113 |
+
"YlGnBu": [
|
| 114 |
+
[0, "rgb(8,29,88)"],
|
| 115 |
+
[0.125, "rgb(37,52,148)"],
|
| 116 |
+
[0.25, "rgb(34,94,168)"],
|
| 117 |
+
[0.375, "rgb(29,145,192)"],
|
| 118 |
+
[0.5, "rgb(65,182,196)"],
|
| 119 |
+
[0.625, "rgb(127,205,187)"],
|
| 120 |
+
[0.75, "rgb(199,233,180)"],
|
| 121 |
+
[0.875, "rgb(237,248,217)"],
|
| 122 |
+
[1, "rgb(255,255,217)"],
|
| 123 |
+
],
|
| 124 |
+
"Greens": [
|
| 125 |
+
[0, "rgb(0,68,27)"],
|
| 126 |
+
[0.125, "rgb(0,109,44)"],
|
| 127 |
+
[0.25, "rgb(35,139,69)"],
|
| 128 |
+
[0.375, "rgb(65,171,93)"],
|
| 129 |
+
[0.5, "rgb(116,196,118)"],
|
| 130 |
+
[0.625, "rgb(161,217,155)"],
|
| 131 |
+
[0.75, "rgb(199,233,192)"],
|
| 132 |
+
[0.875, "rgb(229,245,224)"],
|
| 133 |
+
[1, "rgb(247,252,245)"],
|
| 134 |
+
],
|
| 135 |
+
"YlOrRd": [
|
| 136 |
+
[0, "rgb(128,0,38)"],
|
| 137 |
+
[0.125, "rgb(189,0,38)"],
|
| 138 |
+
[0.25, "rgb(227,26,28)"],
|
| 139 |
+
[0.375, "rgb(252,78,42)"],
|
| 140 |
+
[0.5, "rgb(253,141,60)"],
|
| 141 |
+
[0.625, "rgb(254,178,76)"],
|
| 142 |
+
[0.75, "rgb(254,217,118)"],
|
| 143 |
+
[0.875, "rgb(255,237,160)"],
|
| 144 |
+
[1, "rgb(255,255,204)"],
|
| 145 |
+
],
|
| 146 |
+
"Bluered": [[0, "rgb(0,0,255)"], [1, "rgb(255,0,0)"]],
|
| 147 |
+
# modified RdBu based on
|
| 148 |
+
# www.sandia.gov/~kmorel/documents/ColorMaps/ColorMapsExpanded.pdf
|
| 149 |
+
"RdBu": [
|
| 150 |
+
[0, "rgb(5,10,172)"],
|
| 151 |
+
[0.35, "rgb(106,137,247)"],
|
| 152 |
+
[0.5, "rgb(190,190,190)"],
|
| 153 |
+
[0.6, "rgb(220,170,132)"],
|
| 154 |
+
[0.7, "rgb(230,145,90)"],
|
| 155 |
+
[1, "rgb(178,10,28)"],
|
| 156 |
+
],
|
| 157 |
+
# Scale for non-negative numeric values
|
| 158 |
+
"Reds": [
|
| 159 |
+
[0, "rgb(220,220,220)"],
|
| 160 |
+
[0.2, "rgb(245,195,157)"],
|
| 161 |
+
[0.4, "rgb(245,160,105)"],
|
| 162 |
+
[1, "rgb(178,10,28)"],
|
| 163 |
+
],
|
| 164 |
+
# Scale for non-positive numeric values
|
| 165 |
+
"Blues": [
|
| 166 |
+
[0, "rgb(5,10,172)"],
|
| 167 |
+
[0.35, "rgb(40,60,190)"],
|
| 168 |
+
[0.5, "rgb(70,100,245)"],
|
| 169 |
+
[0.6, "rgb(90,120,245)"],
|
| 170 |
+
[0.7, "rgb(106,137,247)"],
|
| 171 |
+
[1, "rgb(220,220,220)"],
|
| 172 |
+
],
|
| 173 |
+
"Picnic": [
|
| 174 |
+
[0, "rgb(0,0,255)"],
|
| 175 |
+
[0.1, "rgb(51,153,255)"],
|
| 176 |
+
[0.2, "rgb(102,204,255)"],
|
| 177 |
+
[0.3, "rgb(153,204,255)"],
|
| 178 |
+
[0.4, "rgb(204,204,255)"],
|
| 179 |
+
[0.5, "rgb(255,255,255)"],
|
| 180 |
+
[0.6, "rgb(255,204,255)"],
|
| 181 |
+
[0.7, "rgb(255,153,255)"],
|
| 182 |
+
[0.8, "rgb(255,102,204)"],
|
| 183 |
+
[0.9, "rgb(255,102,102)"],
|
| 184 |
+
[1, "rgb(255,0,0)"],
|
| 185 |
+
],
|
| 186 |
+
"Rainbow": [
|
| 187 |
+
[0, "rgb(150,0,90)"],
|
| 188 |
+
[0.125, "rgb(0,0,200)"],
|
| 189 |
+
[0.25, "rgb(0,25,255)"],
|
| 190 |
+
[0.375, "rgb(0,152,255)"],
|
| 191 |
+
[0.5, "rgb(44,255,150)"],
|
| 192 |
+
[0.625, "rgb(151,255,0)"],
|
| 193 |
+
[0.75, "rgb(255,234,0)"],
|
| 194 |
+
[0.875, "rgb(255,111,0)"],
|
| 195 |
+
[1, "rgb(255,0,0)"],
|
| 196 |
+
],
|
| 197 |
+
"Portland": [
|
| 198 |
+
[0, "rgb(12,51,131)"],
|
| 199 |
+
[0.25, "rgb(10,136,186)"],
|
| 200 |
+
[0.5, "rgb(242,211,56)"],
|
| 201 |
+
[0.75, "rgb(242,143,56)"],
|
| 202 |
+
[1, "rgb(217,30,30)"],
|
| 203 |
+
],
|
| 204 |
+
"Jet": [
|
| 205 |
+
[0, "rgb(0,0,131)"],
|
| 206 |
+
[0.125, "rgb(0,60,170)"],
|
| 207 |
+
[0.375, "rgb(5,255,255)"],
|
| 208 |
+
[0.625, "rgb(255,255,0)"],
|
| 209 |
+
[0.875, "rgb(250,0,0)"],
|
| 210 |
+
[1, "rgb(128,0,0)"],
|
| 211 |
+
],
|
| 212 |
+
"Hot": [
|
| 213 |
+
[0, "rgb(0,0,0)"],
|
| 214 |
+
[0.3, "rgb(230,0,0)"],
|
| 215 |
+
[0.6, "rgb(255,210,0)"],
|
| 216 |
+
[1, "rgb(255,255,255)"],
|
| 217 |
+
],
|
| 218 |
+
"Blackbody": [
|
| 219 |
+
[0, "rgb(0,0,0)"],
|
| 220 |
+
[0.2, "rgb(230,0,0)"],
|
| 221 |
+
[0.4, "rgb(230,210,0)"],
|
| 222 |
+
[0.7, "rgb(255,255,255)"],
|
| 223 |
+
[1, "rgb(160,200,255)"],
|
| 224 |
+
],
|
| 225 |
+
"Earth": [
|
| 226 |
+
[0, "rgb(0,0,130)"],
|
| 227 |
+
[0.1, "rgb(0,180,180)"],
|
| 228 |
+
[0.2, "rgb(40,210,40)"],
|
| 229 |
+
[0.4, "rgb(230,230,50)"],
|
| 230 |
+
[0.6, "rgb(120,70,20)"],
|
| 231 |
+
[1, "rgb(255,255,255)"],
|
| 232 |
+
],
|
| 233 |
+
"Electric": [
|
| 234 |
+
[0, "rgb(0,0,0)"],
|
| 235 |
+
[0.15, "rgb(30,0,100)"],
|
| 236 |
+
[0.4, "rgb(120,0,100)"],
|
| 237 |
+
[0.6, "rgb(160,90,0)"],
|
| 238 |
+
[0.8, "rgb(230,200,0)"],
|
| 239 |
+
[1, "rgb(255,250,220)"],
|
| 240 |
+
],
|
| 241 |
+
"Viridis": [
|
| 242 |
+
[0, "#440154"],
|
| 243 |
+
[0.06274509803921569, "#48186a"],
|
| 244 |
+
[0.12549019607843137, "#472d7b"],
|
| 245 |
+
[0.18823529411764706, "#424086"],
|
| 246 |
+
[0.25098039215686274, "#3b528b"],
|
| 247 |
+
[0.3137254901960784, "#33638d"],
|
| 248 |
+
[0.3764705882352941, "#2c728e"],
|
| 249 |
+
[0.4392156862745098, "#26828e"],
|
| 250 |
+
[0.5019607843137255, "#21918c"],
|
| 251 |
+
[0.5647058823529412, "#1fa088"],
|
| 252 |
+
[0.6274509803921569, "#28ae80"],
|
| 253 |
+
[0.6901960784313725, "#3fbc73"],
|
| 254 |
+
[0.7529411764705882, "#5ec962"],
|
| 255 |
+
[0.8156862745098039, "#84d44b"],
|
| 256 |
+
[0.8784313725490196, "#addc30"],
|
| 257 |
+
[0.9411764705882353, "#d8e219"],
|
| 258 |
+
[1, "#fde725"],
|
| 259 |
+
],
|
| 260 |
+
"Cividis": [
|
| 261 |
+
[0.000000, "rgb(0,32,76)"],
|
| 262 |
+
[0.058824, "rgb(0,42,102)"],
|
| 263 |
+
[0.117647, "rgb(0,52,110)"],
|
| 264 |
+
[0.176471, "rgb(39,63,108)"],
|
| 265 |
+
[0.235294, "rgb(60,74,107)"],
|
| 266 |
+
[0.294118, "rgb(76,85,107)"],
|
| 267 |
+
[0.352941, "rgb(91,95,109)"],
|
| 268 |
+
[0.411765, "rgb(104,106,112)"],
|
| 269 |
+
[0.470588, "rgb(117,117,117)"],
|
| 270 |
+
[0.529412, "rgb(131,129,120)"],
|
| 271 |
+
[0.588235, "rgb(146,140,120)"],
|
| 272 |
+
[0.647059, "rgb(161,152,118)"],
|
| 273 |
+
[0.705882, "rgb(176,165,114)"],
|
| 274 |
+
[0.764706, "rgb(192,177,109)"],
|
| 275 |
+
[0.823529, "rgb(209,191,102)"],
|
| 276 |
+
[0.882353, "rgb(225,204,92)"],
|
| 277 |
+
[0.941176, "rgb(243,219,79)"],
|
| 278 |
+
[1.000000, "rgb(255,233,69)"],
|
| 279 |
+
],
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
def color_parser(colors, function):
|
| 284 |
+
"""
|
| 285 |
+
Takes color(s) and a function and applies the function on the color(s)
|
| 286 |
+
|
| 287 |
+
In particular, this function identifies whether the given color object
|
| 288 |
+
is an iterable or not and applies the given color-parsing function to
|
| 289 |
+
the color or iterable of colors. If given an iterable, it will only be
|
| 290 |
+
able to work with it if all items in the iterable are of the same type
|
| 291 |
+
- rgb string, hex string or tuple
|
| 292 |
+
"""
|
| 293 |
+
if isinstance(colors, str):
|
| 294 |
+
return function(colors)
|
| 295 |
+
|
| 296 |
+
if isinstance(colors, tuple) and isinstance(colors[0], Number):
|
| 297 |
+
return function(colors)
|
| 298 |
+
|
| 299 |
+
if hasattr(colors, "__iter__"):
|
| 300 |
+
if isinstance(colors, tuple):
|
| 301 |
+
new_color_tuple = tuple(function(item) for item in colors)
|
| 302 |
+
return new_color_tuple
|
| 303 |
+
|
| 304 |
+
else:
|
| 305 |
+
new_color_list = [function(item) for item in colors]
|
| 306 |
+
return new_color_list
|
| 307 |
+
|
| 308 |
+
|
| 309 |
+
def validate_colors(colors, colortype="tuple"):
|
| 310 |
+
"""
|
| 311 |
+
Validates color(s) and returns a list of color(s) of a specified type
|
| 312 |
+
"""
|
| 313 |
+
from numbers import Number
|
| 314 |
+
|
| 315 |
+
if colors is None:
|
| 316 |
+
colors = DEFAULT_PLOTLY_COLORS
|
| 317 |
+
|
| 318 |
+
if isinstance(colors, str):
|
| 319 |
+
if colors in PLOTLY_SCALES:
|
| 320 |
+
colors_list = colorscale_to_colors(PLOTLY_SCALES[colors])
|
| 321 |
+
# TODO: fix _gantt.py/_scatter.py so that they can accept the
|
| 322 |
+
# actual colorscale and not just a list of the first and last
|
| 323 |
+
# color in the plotly colorscale. In resolving this issue we
|
| 324 |
+
# will be removing the immediate line below
|
| 325 |
+
colors = [colors_list[0]] + [colors_list[-1]]
|
| 326 |
+
elif "rgb" in colors or "#" in colors:
|
| 327 |
+
colors = [colors]
|
| 328 |
+
else:
|
| 329 |
+
raise exceptions.PlotlyError(
|
| 330 |
+
"If your colors variable is a string, it must be a "
|
| 331 |
+
"Plotly scale, an rgb color or a hex color."
|
| 332 |
+
)
|
| 333 |
+
|
| 334 |
+
elif isinstance(colors, tuple):
|
| 335 |
+
if isinstance(colors[0], Number):
|
| 336 |
+
colors = [colors]
|
| 337 |
+
else:
|
| 338 |
+
colors = list(colors)
|
| 339 |
+
|
| 340 |
+
# convert color elements in list to tuple color
|
| 341 |
+
for j, each_color in enumerate(colors):
|
| 342 |
+
if "rgb" in each_color:
|
| 343 |
+
each_color = color_parser(each_color, unlabel_rgb)
|
| 344 |
+
for value in each_color:
|
| 345 |
+
if value > 255.0:
|
| 346 |
+
raise exceptions.PlotlyError(
|
| 347 |
+
"Whoops! The elements in your rgb colors "
|
| 348 |
+
"tuples cannot exceed 255.0."
|
| 349 |
+
)
|
| 350 |
+
each_color = color_parser(each_color, unconvert_from_RGB_255)
|
| 351 |
+
colors[j] = each_color
|
| 352 |
+
|
| 353 |
+
if "#" in each_color:
|
| 354 |
+
each_color = color_parser(each_color, hex_to_rgb)
|
| 355 |
+
each_color = color_parser(each_color, unconvert_from_RGB_255)
|
| 356 |
+
|
| 357 |
+
colors[j] = each_color
|
| 358 |
+
|
| 359 |
+
if isinstance(each_color, tuple):
|
| 360 |
+
for value in each_color:
|
| 361 |
+
if value > 1.0:
|
| 362 |
+
raise exceptions.PlotlyError(
|
| 363 |
+
"Whoops! The elements in your colors tuples cannot exceed 1.0."
|
| 364 |
+
)
|
| 365 |
+
colors[j] = each_color
|
| 366 |
+
|
| 367 |
+
if colortype == "rgb" and not isinstance(colors, str):
|
| 368 |
+
for j, each_color in enumerate(colors):
|
| 369 |
+
rgb_color = color_parser(each_color, convert_to_RGB_255)
|
| 370 |
+
colors[j] = color_parser(rgb_color, label_rgb)
|
| 371 |
+
|
| 372 |
+
return colors
|
| 373 |
+
|
| 374 |
+
|
| 375 |
+
def validate_colors_dict(colors, colortype="tuple"):
|
| 376 |
+
"""
|
| 377 |
+
Validates dictionary of color(s)
|
| 378 |
+
"""
|
| 379 |
+
# validate each color element in the dictionary
|
| 380 |
+
for key in colors:
|
| 381 |
+
if "rgb" in colors[key]:
|
| 382 |
+
colors[key] = color_parser(colors[key], unlabel_rgb)
|
| 383 |
+
for value in colors[key]:
|
| 384 |
+
if value > 255.0:
|
| 385 |
+
raise exceptions.PlotlyError(
|
| 386 |
+
"Whoops! The elements in your rgb colors "
|
| 387 |
+
"tuples cannot exceed 255.0."
|
| 388 |
+
)
|
| 389 |
+
colors[key] = color_parser(colors[key], unconvert_from_RGB_255)
|
| 390 |
+
|
| 391 |
+
if "#" in colors[key]:
|
| 392 |
+
colors[key] = color_parser(colors[key], hex_to_rgb)
|
| 393 |
+
colors[key] = color_parser(colors[key], unconvert_from_RGB_255)
|
| 394 |
+
|
| 395 |
+
if isinstance(colors[key], tuple):
|
| 396 |
+
for value in colors[key]:
|
| 397 |
+
if value > 1.0:
|
| 398 |
+
raise exceptions.PlotlyError(
|
| 399 |
+
"Whoops! The elements in your colors tuples cannot exceed 1.0."
|
| 400 |
+
)
|
| 401 |
+
|
| 402 |
+
if colortype == "rgb":
|
| 403 |
+
for key in colors:
|
| 404 |
+
colors[key] = color_parser(colors[key], convert_to_RGB_255)
|
| 405 |
+
colors[key] = color_parser(colors[key], label_rgb)
|
| 406 |
+
|
| 407 |
+
return colors
|
| 408 |
+
|
| 409 |
+
|
| 410 |
+
def convert_colors_to_same_type(
|
| 411 |
+
colors,
|
| 412 |
+
colortype="rgb",
|
| 413 |
+
scale=None,
|
| 414 |
+
return_default_colors=False,
|
| 415 |
+
num_of_defualt_colors=2,
|
| 416 |
+
):
|
| 417 |
+
"""
|
| 418 |
+
Converts color(s) to the specified color type
|
| 419 |
+
|
| 420 |
+
Takes a single color or an iterable of colors, as well as a list of scale
|
| 421 |
+
values, and outputs a 2-pair of the list of color(s) converted all to an
|
| 422 |
+
rgb or tuple color type, aswell as the scale as the second element. If
|
| 423 |
+
colors is a Plotly Scale name, then 'scale' will be forced to the scale
|
| 424 |
+
from the respective colorscale and the colors in that colorscale will also
|
| 425 |
+
be coverted to the selected colortype. If colors is None, then there is an
|
| 426 |
+
option to return portion of the DEFAULT_PLOTLY_COLORS
|
| 427 |
+
|
| 428 |
+
:param (str|tuple|list) colors: either a plotly scale name, an rgb or hex
|
| 429 |
+
color, a color tuple or a list/tuple of colors
|
| 430 |
+
:param (list) scale: see docs for validate_scale_values()
|
| 431 |
+
|
| 432 |
+
:rtype (tuple) (colors_list, scale) if scale is None in the function call,
|
| 433 |
+
then scale will remain None in the returned tuple
|
| 434 |
+
"""
|
| 435 |
+
colors_list = []
|
| 436 |
+
|
| 437 |
+
if colors is None and return_default_colors is True:
|
| 438 |
+
colors_list = DEFAULT_PLOTLY_COLORS[0:num_of_defualt_colors]
|
| 439 |
+
|
| 440 |
+
if isinstance(colors, str):
|
| 441 |
+
if colors in PLOTLY_SCALES:
|
| 442 |
+
colors_list = colorscale_to_colors(PLOTLY_SCALES[colors])
|
| 443 |
+
if scale is None:
|
| 444 |
+
scale = colorscale_to_scale(PLOTLY_SCALES[colors])
|
| 445 |
+
|
| 446 |
+
elif "rgb" in colors or "#" in colors:
|
| 447 |
+
colors_list = [colors]
|
| 448 |
+
|
| 449 |
+
elif isinstance(colors, tuple):
|
| 450 |
+
if isinstance(colors[0], Number):
|
| 451 |
+
colors_list = [colors]
|
| 452 |
+
else:
|
| 453 |
+
colors_list = list(colors)
|
| 454 |
+
|
| 455 |
+
elif isinstance(colors, list):
|
| 456 |
+
colors_list = colors
|
| 457 |
+
|
| 458 |
+
# validate scale
|
| 459 |
+
if scale is not None:
|
| 460 |
+
validate_scale_values(scale)
|
| 461 |
+
|
| 462 |
+
if len(colors_list) != len(scale):
|
| 463 |
+
raise exceptions.PlotlyError(
|
| 464 |
+
"Make sure that the length of your scale matches the length "
|
| 465 |
+
"of your list of colors which is {}.".format(len(colors_list))
|
| 466 |
+
)
|
| 467 |
+
|
| 468 |
+
# convert all colors to rgb
|
| 469 |
+
for j, each_color in enumerate(colors_list):
|
| 470 |
+
if "#" in each_color:
|
| 471 |
+
each_color = color_parser(each_color, hex_to_rgb)
|
| 472 |
+
each_color = color_parser(each_color, label_rgb)
|
| 473 |
+
colors_list[j] = each_color
|
| 474 |
+
|
| 475 |
+
elif isinstance(each_color, tuple):
|
| 476 |
+
each_color = color_parser(each_color, convert_to_RGB_255)
|
| 477 |
+
each_color = color_parser(each_color, label_rgb)
|
| 478 |
+
colors_list[j] = each_color
|
| 479 |
+
|
| 480 |
+
if colortype == "rgb":
|
| 481 |
+
return (colors_list, scale)
|
| 482 |
+
elif colortype == "tuple":
|
| 483 |
+
for j, each_color in enumerate(colors_list):
|
| 484 |
+
each_color = color_parser(each_color, unlabel_rgb)
|
| 485 |
+
each_color = color_parser(each_color, unconvert_from_RGB_255)
|
| 486 |
+
colors_list[j] = each_color
|
| 487 |
+
return (colors_list, scale)
|
| 488 |
+
else:
|
| 489 |
+
raise exceptions.PlotlyError(
|
| 490 |
+
"You must select either rgb or tuple for your colortype variable."
|
| 491 |
+
)
|
| 492 |
+
|
| 493 |
+
|
| 494 |
+
def convert_dict_colors_to_same_type(colors_dict, colortype="rgb"):
|
| 495 |
+
"""
|
| 496 |
+
Converts a colors in a dictionary of colors to the specified color type
|
| 497 |
+
|
| 498 |
+
:param (dict) colors_dict: a dictionary whose values are single colors
|
| 499 |
+
"""
|
| 500 |
+
for key in colors_dict:
|
| 501 |
+
if "#" in colors_dict[key]:
|
| 502 |
+
colors_dict[key] = color_parser(colors_dict[key], hex_to_rgb)
|
| 503 |
+
colors_dict[key] = color_parser(colors_dict[key], label_rgb)
|
| 504 |
+
|
| 505 |
+
elif isinstance(colors_dict[key], tuple):
|
| 506 |
+
colors_dict[key] = color_parser(colors_dict[key], convert_to_RGB_255)
|
| 507 |
+
colors_dict[key] = color_parser(colors_dict[key], label_rgb)
|
| 508 |
+
|
| 509 |
+
if colortype == "rgb":
|
| 510 |
+
return colors_dict
|
| 511 |
+
elif colortype == "tuple":
|
| 512 |
+
for key in colors_dict:
|
| 513 |
+
colors_dict[key] = color_parser(colors_dict[key], unlabel_rgb)
|
| 514 |
+
colors_dict[key] = color_parser(colors_dict[key], unconvert_from_RGB_255)
|
| 515 |
+
return colors_dict
|
| 516 |
+
else:
|
| 517 |
+
raise exceptions.PlotlyError(
|
| 518 |
+
"You must select either rgb or tuple for your colortype variable."
|
| 519 |
+
)
|
| 520 |
+
|
| 521 |
+
|
| 522 |
+
def validate_scale_values(scale):
|
| 523 |
+
"""
|
| 524 |
+
Validates scale values from a colorscale
|
| 525 |
+
|
| 526 |
+
:param (list) scale: a strictly increasing list of floats that begins
|
| 527 |
+
with 0 and ends with 1. Its usage derives from a colorscale which is
|
| 528 |
+
a list of two-lists (a list with two elements) of the form
|
| 529 |
+
[value, color] which are used to determine how interpolation weighting
|
| 530 |
+
works between the colors in the colorscale. Therefore scale is just
|
| 531 |
+
the extraction of these values from the two-lists in order
|
| 532 |
+
"""
|
| 533 |
+
if len(scale) < 2:
|
| 534 |
+
raise exceptions.PlotlyError(
|
| 535 |
+
"You must input a list of scale values that has at least two values."
|
| 536 |
+
)
|
| 537 |
+
|
| 538 |
+
if (scale[0] != 0) or (scale[-1] != 1):
|
| 539 |
+
raise exceptions.PlotlyError(
|
| 540 |
+
"The first and last number in your scale must be 0.0 and 1.0 respectively."
|
| 541 |
+
)
|
| 542 |
+
|
| 543 |
+
if not all(x < y for x, y in zip(scale, scale[1:])):
|
| 544 |
+
raise exceptions.PlotlyError(
|
| 545 |
+
"'scale' must be a list that contains a strictly increasing "
|
| 546 |
+
"sequence of numbers."
|
| 547 |
+
)
|
| 548 |
+
|
| 549 |
+
|
| 550 |
+
def validate_colorscale(colorscale):
|
| 551 |
+
"""Validate the structure, scale values and colors of colorscale."""
|
| 552 |
+
if not isinstance(colorscale, list):
|
| 553 |
+
# TODO Write tests for these exceptions
|
| 554 |
+
raise exceptions.PlotlyError("A valid colorscale must be a list.")
|
| 555 |
+
if not all(isinstance(innerlist, list) for innerlist in colorscale):
|
| 556 |
+
raise exceptions.PlotlyError("A valid colorscale must be a list of lists.")
|
| 557 |
+
colorscale_colors = colorscale_to_colors(colorscale)
|
| 558 |
+
scale_values = colorscale_to_scale(colorscale)
|
| 559 |
+
|
| 560 |
+
validate_scale_values(scale_values)
|
| 561 |
+
validate_colors(colorscale_colors)
|
| 562 |
+
|
| 563 |
+
|
| 564 |
+
def make_colorscale(colors, scale=None):
|
| 565 |
+
"""
|
| 566 |
+
Makes a colorscale from a list of colors and a scale
|
| 567 |
+
|
| 568 |
+
Takes a list of colors and scales and constructs a colorscale based
|
| 569 |
+
on the colors in sequential order. If 'scale' is left empty, a linear-
|
| 570 |
+
interpolated colorscale will be generated. If 'scale' is a specificed
|
| 571 |
+
list, it must be the same legnth as colors and must contain all floats
|
| 572 |
+
For documentation regarding to the form of the output, see
|
| 573 |
+
https://plot.ly/python/reference/#mesh3d-colorscale
|
| 574 |
+
|
| 575 |
+
:param (list) colors: a list of single colors
|
| 576 |
+
"""
|
| 577 |
+
colorscale = []
|
| 578 |
+
|
| 579 |
+
# validate minimum colors length of 2
|
| 580 |
+
if len(colors) < 2:
|
| 581 |
+
raise exceptions.PlotlyError(
|
| 582 |
+
"You must input a list of colors that has at least two colors."
|
| 583 |
+
)
|
| 584 |
+
|
| 585 |
+
if scale is None:
|
| 586 |
+
scale_incr = 1.0 / (len(colors) - 1)
|
| 587 |
+
return [[i * scale_incr, color] for i, color in enumerate(colors)]
|
| 588 |
+
|
| 589 |
+
else:
|
| 590 |
+
if len(colors) != len(scale):
|
| 591 |
+
raise exceptions.PlotlyError(
|
| 592 |
+
"The length of colors and scale must be the same."
|
| 593 |
+
)
|
| 594 |
+
|
| 595 |
+
validate_scale_values(scale)
|
| 596 |
+
|
| 597 |
+
colorscale = [list(tup) for tup in zip(scale, colors)]
|
| 598 |
+
return colorscale
|
| 599 |
+
|
| 600 |
+
|
| 601 |
+
def find_intermediate_color(lowcolor, highcolor, intermed, colortype="tuple"):
|
| 602 |
+
"""
|
| 603 |
+
Returns the color at a given distance between two colors
|
| 604 |
+
|
| 605 |
+
This function takes two color tuples, where each element is between 0
|
| 606 |
+
and 1, along with a value 0 < intermed < 1 and returns a color that is
|
| 607 |
+
intermed-percent from lowcolor to highcolor. If colortype is set to 'rgb',
|
| 608 |
+
the function will automatically convert the rgb type to a tuple, find the
|
| 609 |
+
intermediate color and return it as an rgb color.
|
| 610 |
+
"""
|
| 611 |
+
if colortype == "rgb":
|
| 612 |
+
# convert to tuple color, eg. (1, 0.45, 0.7)
|
| 613 |
+
lowcolor = unlabel_rgb(lowcolor)
|
| 614 |
+
highcolor = unlabel_rgb(highcolor)
|
| 615 |
+
|
| 616 |
+
diff_0 = float(highcolor[0] - lowcolor[0])
|
| 617 |
+
diff_1 = float(highcolor[1] - lowcolor[1])
|
| 618 |
+
diff_2 = float(highcolor[2] - lowcolor[2])
|
| 619 |
+
|
| 620 |
+
inter_med_tuple = (
|
| 621 |
+
lowcolor[0] + intermed * diff_0,
|
| 622 |
+
lowcolor[1] + intermed * diff_1,
|
| 623 |
+
lowcolor[2] + intermed * diff_2,
|
| 624 |
+
)
|
| 625 |
+
|
| 626 |
+
if colortype == "rgb":
|
| 627 |
+
# back to an rgb string, e.g. rgb(30, 20, 10)
|
| 628 |
+
inter_med_rgb = label_rgb(inter_med_tuple)
|
| 629 |
+
return inter_med_rgb
|
| 630 |
+
|
| 631 |
+
return inter_med_tuple
|
| 632 |
+
|
| 633 |
+
|
| 634 |
+
def unconvert_from_RGB_255(colors):
|
| 635 |
+
"""
|
| 636 |
+
Return a tuple where each element gets divided by 255
|
| 637 |
+
|
| 638 |
+
Takes a (list of) color tuple(s) where each element is between 0 and
|
| 639 |
+
255. Returns the same tuples where each tuple element is normalized to
|
| 640 |
+
a value between 0 and 1
|
| 641 |
+
"""
|
| 642 |
+
return (colors[0] / (255.0), colors[1] / (255.0), colors[2] / (255.0))
|
| 643 |
+
|
| 644 |
+
|
| 645 |
+
def convert_to_RGB_255(colors):
|
| 646 |
+
"""
|
| 647 |
+
Multiplies each element of a triplet by 255
|
| 648 |
+
|
| 649 |
+
Each coordinate of the color tuple is rounded to the nearest float and
|
| 650 |
+
then is turned into an integer. If a number is of the form x.5, then
|
| 651 |
+
if x is odd, the number rounds up to (x+1). Otherwise, it rounds down
|
| 652 |
+
to just x. This is the way rounding works in Python 3 and in current
|
| 653 |
+
statistical analysis to avoid rounding bias
|
| 654 |
+
|
| 655 |
+
:param (list) rgb_components: grabs the three R, G and B values to be
|
| 656 |
+
returned as computed in the function
|
| 657 |
+
"""
|
| 658 |
+
rgb_components = []
|
| 659 |
+
|
| 660 |
+
for component in colors:
|
| 661 |
+
rounded_num = decimal.Decimal(str(component * 255.0)).quantize(
|
| 662 |
+
decimal.Decimal("1"), rounding=decimal.ROUND_HALF_EVEN
|
| 663 |
+
)
|
| 664 |
+
# convert rounded number to an integer from 'Decimal' form
|
| 665 |
+
rounded_num = int(rounded_num)
|
| 666 |
+
rgb_components.append(rounded_num)
|
| 667 |
+
|
| 668 |
+
return (rgb_components[0], rgb_components[1], rgb_components[2])
|
| 669 |
+
|
| 670 |
+
|
| 671 |
+
def n_colors(lowcolor, highcolor, n_colors, colortype="tuple"):
|
| 672 |
+
"""
|
| 673 |
+
Splits a low and high color into a list of n_colors colors in it
|
| 674 |
+
|
| 675 |
+
Accepts two color tuples and returns a list of n_colors colors
|
| 676 |
+
which form the intermediate colors between lowcolor and highcolor
|
| 677 |
+
from linearly interpolating through RGB space. If colortype is 'rgb'
|
| 678 |
+
the function will return a list of colors in the same form.
|
| 679 |
+
"""
|
| 680 |
+
if colortype == "rgb":
|
| 681 |
+
# convert to tuple
|
| 682 |
+
lowcolor = unlabel_rgb(lowcolor)
|
| 683 |
+
highcolor = unlabel_rgb(highcolor)
|
| 684 |
+
|
| 685 |
+
diff_0 = float(highcolor[0] - lowcolor[0])
|
| 686 |
+
incr_0 = diff_0 / (n_colors - 1)
|
| 687 |
+
diff_1 = float(highcolor[1] - lowcolor[1])
|
| 688 |
+
incr_1 = diff_1 / (n_colors - 1)
|
| 689 |
+
diff_2 = float(highcolor[2] - lowcolor[2])
|
| 690 |
+
incr_2 = diff_2 / (n_colors - 1)
|
| 691 |
+
list_of_colors = []
|
| 692 |
+
|
| 693 |
+
def _constrain_color(c):
|
| 694 |
+
if c > 255.0:
|
| 695 |
+
return 255.0
|
| 696 |
+
elif c < 0.0:
|
| 697 |
+
return 0.0
|
| 698 |
+
else:
|
| 699 |
+
return c
|
| 700 |
+
|
| 701 |
+
for index in range(n_colors):
|
| 702 |
+
new_tuple = (
|
| 703 |
+
_constrain_color(lowcolor[0] + (index * incr_0)),
|
| 704 |
+
_constrain_color(lowcolor[1] + (index * incr_1)),
|
| 705 |
+
_constrain_color(lowcolor[2] + (index * incr_2)),
|
| 706 |
+
)
|
| 707 |
+
list_of_colors.append(new_tuple)
|
| 708 |
+
|
| 709 |
+
if colortype == "rgb":
|
| 710 |
+
# back to an rgb string
|
| 711 |
+
list_of_colors = color_parser(list_of_colors, label_rgb)
|
| 712 |
+
|
| 713 |
+
return list_of_colors
|
| 714 |
+
|
| 715 |
+
|
| 716 |
+
def label_rgb(colors):
|
| 717 |
+
"""
|
| 718 |
+
Takes tuple (a, b, c) and returns an rgb color 'rgb(a, b, c)'
|
| 719 |
+
"""
|
| 720 |
+
return "rgb(%s, %s, %s)" % (colors[0], colors[1], colors[2])
|
| 721 |
+
|
| 722 |
+
|
| 723 |
+
def unlabel_rgb(colors):
|
| 724 |
+
"""
|
| 725 |
+
Takes rgb color(s) 'rgb(a, b, c)' and returns tuple(s) (a, b, c)
|
| 726 |
+
|
| 727 |
+
This function takes either an 'rgb(a, b, c)' color or a list of
|
| 728 |
+
such colors and returns the color tuples in tuple(s) (a, b, c)
|
| 729 |
+
"""
|
| 730 |
+
str_vals = ""
|
| 731 |
+
for index in range(len(colors)):
|
| 732 |
+
try:
|
| 733 |
+
float(colors[index])
|
| 734 |
+
str_vals = str_vals + colors[index]
|
| 735 |
+
except ValueError:
|
| 736 |
+
if colors[index] == "," or colors[index] == ".":
|
| 737 |
+
str_vals = str_vals + colors[index]
|
| 738 |
+
|
| 739 |
+
str_vals = str_vals + ","
|
| 740 |
+
numbers = []
|
| 741 |
+
str_num = ""
|
| 742 |
+
for char in str_vals:
|
| 743 |
+
if char != ",":
|
| 744 |
+
str_num = str_num + char
|
| 745 |
+
else:
|
| 746 |
+
numbers.append(float(str_num))
|
| 747 |
+
str_num = ""
|
| 748 |
+
return (numbers[0], numbers[1], numbers[2])
|
| 749 |
+
|
| 750 |
+
|
| 751 |
+
def hex_to_rgb(value):
|
| 752 |
+
"""
|
| 753 |
+
Calculates rgb values from a hex color code.
|
| 754 |
+
|
| 755 |
+
:param (string) value: Hex color string
|
| 756 |
+
|
| 757 |
+
:rtype (tuple) (r_value, g_value, b_value): tuple of rgb values
|
| 758 |
+
"""
|
| 759 |
+
value = value.lstrip("#")
|
| 760 |
+
hex_total_length = len(value)
|
| 761 |
+
rgb_section_length = hex_total_length // 3
|
| 762 |
+
return tuple(
|
| 763 |
+
int(value[i : i + rgb_section_length], 16)
|
| 764 |
+
for i in range(0, hex_total_length, rgb_section_length)
|
| 765 |
+
)
|
| 766 |
+
|
| 767 |
+
|
| 768 |
+
def colorscale_to_colors(colorscale):
|
| 769 |
+
"""
|
| 770 |
+
Extracts the colors from colorscale as a list
|
| 771 |
+
"""
|
| 772 |
+
color_list = []
|
| 773 |
+
for item in colorscale:
|
| 774 |
+
color_list.append(item[1])
|
| 775 |
+
return color_list
|
| 776 |
+
|
| 777 |
+
|
| 778 |
+
def colorscale_to_scale(colorscale):
|
| 779 |
+
"""
|
| 780 |
+
Extracts the interpolation scale values from colorscale as a list
|
| 781 |
+
"""
|
| 782 |
+
scale_list = []
|
| 783 |
+
for item in colorscale:
|
| 784 |
+
scale_list.append(item[0])
|
| 785 |
+
return scale_list
|
| 786 |
+
|
| 787 |
+
|
| 788 |
+
def convert_colorscale_to_rgb(colorscale):
|
| 789 |
+
"""
|
| 790 |
+
Converts the colors in a colorscale to rgb colors
|
| 791 |
+
|
| 792 |
+
A colorscale is an array of arrays, each with a numeric value as the
|
| 793 |
+
first item and a color as the second. This function specifically is
|
| 794 |
+
converting a colorscale with tuple colors (each coordinate between 0
|
| 795 |
+
and 1) into a colorscale with the colors transformed into rgb colors
|
| 796 |
+
"""
|
| 797 |
+
for color in colorscale:
|
| 798 |
+
color[1] = convert_to_RGB_255(color[1])
|
| 799 |
+
|
| 800 |
+
for color in colorscale:
|
| 801 |
+
color[1] = label_rgb(color[1])
|
| 802 |
+
return colorscale
|
| 803 |
+
|
| 804 |
+
|
| 805 |
+
def named_colorscales():
|
| 806 |
+
"""
|
| 807 |
+
Returns lowercased names of built-in continuous colorscales.
|
| 808 |
+
"""
|
| 809 |
+
from _plotly_utils.basevalidators import ColorscaleValidator
|
| 810 |
+
|
| 811 |
+
return [c for c in ColorscaleValidator("", "").named_colorscales]
|
| 812 |
+
|
| 813 |
+
|
| 814 |
+
def get_colorscale(name):
|
| 815 |
+
"""
|
| 816 |
+
Returns the colorscale for a given name. See `named_colorscales` for the
|
| 817 |
+
built-in colorscales.
|
| 818 |
+
"""
|
| 819 |
+
from _plotly_utils.basevalidators import ColorscaleValidator
|
| 820 |
+
|
| 821 |
+
if not isinstance(name, str):
|
| 822 |
+
raise exceptions.PlotlyError("Name argument have to be a string.")
|
| 823 |
+
|
| 824 |
+
name = name.lower()
|
| 825 |
+
if name[-2:] == "_r":
|
| 826 |
+
should_reverse = True
|
| 827 |
+
name = name[:-2]
|
| 828 |
+
else:
|
| 829 |
+
should_reverse = False
|
| 830 |
+
|
| 831 |
+
if name in ColorscaleValidator("", "").named_colorscales:
|
| 832 |
+
colorscale = ColorscaleValidator("", "").named_colorscales[name]
|
| 833 |
+
else:
|
| 834 |
+
raise exceptions.PlotlyError(f"Colorscale {name} is not a built-in scale.")
|
| 835 |
+
|
| 836 |
+
if should_reverse:
|
| 837 |
+
colorscale = colorscale[::-1]
|
| 838 |
+
return make_colorscale(colorscale)
|
| 839 |
+
|
| 840 |
+
|
| 841 |
+
def sample_colorscale(colorscale, samplepoints, low=0.0, high=1.0, colortype="rgb"):
|
| 842 |
+
"""
|
| 843 |
+
Samples a colorscale at specific points.
|
| 844 |
+
|
| 845 |
+
Interpolates between colors in a colorscale to find the specific colors
|
| 846 |
+
corresponding to the specified sample values. The colorscale can be specified
|
| 847 |
+
as a list of `[scale, color]` pairs, as a list of colors, or as a named
|
| 848 |
+
plotly colorscale. The samplepoints can be specefied as an iterable of specific
|
| 849 |
+
points in the range [0.0, 1.0], or as an integer number of points which will
|
| 850 |
+
be spaced equally between the low value (default 0.0) and the high value
|
| 851 |
+
(default 1.0). The output is a list of colors, formatted according to the
|
| 852 |
+
specified colortype.
|
| 853 |
+
"""
|
| 854 |
+
from bisect import bisect_left
|
| 855 |
+
|
| 856 |
+
try:
|
| 857 |
+
validate_colorscale(colorscale)
|
| 858 |
+
except exceptions.PlotlyError:
|
| 859 |
+
if isinstance(colorscale, str):
|
| 860 |
+
colorscale = get_colorscale(colorscale)
|
| 861 |
+
else:
|
| 862 |
+
colorscale = make_colorscale(colorscale)
|
| 863 |
+
|
| 864 |
+
scale = colorscale_to_scale(colorscale)
|
| 865 |
+
validate_scale_values(scale)
|
| 866 |
+
colors = colorscale_to_colors(colorscale)
|
| 867 |
+
colors = validate_colors(colors, colortype="tuple")
|
| 868 |
+
|
| 869 |
+
if isinstance(samplepoints, int):
|
| 870 |
+
samplepoints = [
|
| 871 |
+
low + idx / (samplepoints - 1) * (high - low) for idx in range(samplepoints)
|
| 872 |
+
]
|
| 873 |
+
elif isinstance(samplepoints, float):
|
| 874 |
+
samplepoints = [samplepoints]
|
| 875 |
+
|
| 876 |
+
sampled_colors = []
|
| 877 |
+
for point in samplepoints:
|
| 878 |
+
high = bisect_left(scale, point)
|
| 879 |
+
low = high - 1
|
| 880 |
+
interpolant = (point - scale[low]) / (scale[high] - scale[low])
|
| 881 |
+
sampled_color = find_intermediate_color(colors[low], colors[high], interpolant)
|
| 882 |
+
sampled_colors.append(sampled_color)
|
| 883 |
+
return validate_colors(sampled_colors, colortype=colortype)
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (31 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/_swatches.cpython-312.pyc
ADDED
|
Binary file (6.52 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/carto.cpython-312.pyc
ADDED
|
Binary file (7.89 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/cmocean.cpython-312.pyc
ADDED
|
Binary file (6.03 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/colorbrewer.cpython-312.pyc
ADDED
|
Binary file (8.11 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/cyclical.cpython-312.pyc
ADDED
|
Binary file (2.75 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/diverging.cpython-312.pyc
ADDED
|
Binary file (2.11 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/plotlyjs.cpython-312.pyc
ADDED
|
Binary file (3.28 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/qualitative.cpython-312.pyc
ADDED
|
Binary file (2.78 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/__pycache__/sequential.cpython-312.pyc
ADDED
|
Binary file (4.59 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/_swatches.py
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def _swatches(module_names, module_contents, template=None):
|
| 2 |
+
"""
|
| 3 |
+
Parameters
|
| 4 |
+
----------
|
| 5 |
+
template : str or dict or plotly.graph_objects.layout.Template instance
|
| 6 |
+
The figure template name or definition.
|
| 7 |
+
|
| 8 |
+
Returns
|
| 9 |
+
-------
|
| 10 |
+
fig : graph_objects.Figure containing the displayed image
|
| 11 |
+
A `Figure` object. This figure demonstrates the color scales and
|
| 12 |
+
sequences in this module, as stacked bar charts.
|
| 13 |
+
"""
|
| 14 |
+
import plotly.graph_objs as go
|
| 15 |
+
from plotly.express._core import apply_default_cascade
|
| 16 |
+
|
| 17 |
+
args = dict(template=template)
|
| 18 |
+
apply_default_cascade(args, constructor=None)
|
| 19 |
+
|
| 20 |
+
sequences = [
|
| 21 |
+
(k, v)
|
| 22 |
+
for k, v in module_contents.items()
|
| 23 |
+
if not (k.startswith("_") or k.startswith("swatches") or k.endswith("_r"))
|
| 24 |
+
]
|
| 25 |
+
|
| 26 |
+
return go.Figure(
|
| 27 |
+
data=[
|
| 28 |
+
go.Bar(
|
| 29 |
+
orientation="h",
|
| 30 |
+
y=[name] * len(colors),
|
| 31 |
+
x=[1] * len(colors),
|
| 32 |
+
customdata=list(range(len(colors))),
|
| 33 |
+
marker=dict(color=colors),
|
| 34 |
+
hovertemplate="%{y}[%{customdata}] = %{marker.color}<extra></extra>",
|
| 35 |
+
)
|
| 36 |
+
for name, colors in reversed(sequences)
|
| 37 |
+
],
|
| 38 |
+
layout=dict(
|
| 39 |
+
title="plotly.colors." + module_names.split(".")[-1],
|
| 40 |
+
barmode="stack",
|
| 41 |
+
barnorm="fraction",
|
| 42 |
+
bargap=0.5,
|
| 43 |
+
showlegend=False,
|
| 44 |
+
xaxis=dict(range=[-0.02, 1.02], showticklabels=False, showgrid=False),
|
| 45 |
+
height=max(600, 40 * len(sequences)),
|
| 46 |
+
template=args["template"],
|
| 47 |
+
margin=dict(b=10),
|
| 48 |
+
),
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def _swatches_continuous(module_names, module_contents, template=None):
|
| 53 |
+
"""
|
| 54 |
+
Parameters
|
| 55 |
+
----------
|
| 56 |
+
template : str or dict or plotly.graph_objects.layout.Template instance
|
| 57 |
+
The figure template name or definition.
|
| 58 |
+
|
| 59 |
+
Returns
|
| 60 |
+
-------
|
| 61 |
+
fig : graph_objects.Figure containing the displayed image
|
| 62 |
+
A `Figure` object. This figure demonstrates the color scales and
|
| 63 |
+
sequences in this module, as stacked bar charts.
|
| 64 |
+
"""
|
| 65 |
+
import plotly.graph_objs as go
|
| 66 |
+
from plotly.express._core import apply_default_cascade
|
| 67 |
+
|
| 68 |
+
args = dict(template=template)
|
| 69 |
+
apply_default_cascade(args, constructor=None)
|
| 70 |
+
|
| 71 |
+
sequences = [
|
| 72 |
+
(k, v)
|
| 73 |
+
for k, v in module_contents.items()
|
| 74 |
+
if not (k.startswith("_") or k.startswith("swatches") or k.endswith("_r"))
|
| 75 |
+
]
|
| 76 |
+
|
| 77 |
+
n = 100
|
| 78 |
+
|
| 79 |
+
return go.Figure(
|
| 80 |
+
data=[
|
| 81 |
+
go.Bar(
|
| 82 |
+
orientation="h",
|
| 83 |
+
y=[name] * n,
|
| 84 |
+
x=[1] * n,
|
| 85 |
+
customdata=[(x + 1) / n for x in range(n)],
|
| 86 |
+
marker=dict(color=list(range(n)), colorscale=name, line_width=0),
|
| 87 |
+
hovertemplate="%{customdata}",
|
| 88 |
+
name=name,
|
| 89 |
+
)
|
| 90 |
+
for name, colors in reversed(sequences)
|
| 91 |
+
],
|
| 92 |
+
layout=dict(
|
| 93 |
+
title="plotly.colors." + module_names.split(".")[-1],
|
| 94 |
+
barmode="stack",
|
| 95 |
+
barnorm="fraction",
|
| 96 |
+
bargap=0.3,
|
| 97 |
+
showlegend=False,
|
| 98 |
+
xaxis=dict(range=[-0.02, 1.02], showticklabels=False, showgrid=False),
|
| 99 |
+
height=max(600, 40 * len(sequences)),
|
| 100 |
+
width=500,
|
| 101 |
+
template=args["template"],
|
| 102 |
+
margin=dict(b=10),
|
| 103 |
+
),
|
| 104 |
+
)
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def _swatches_cyclical(module_names, module_contents, template=None):
|
| 108 |
+
"""
|
| 109 |
+
Parameters
|
| 110 |
+
----------
|
| 111 |
+
template : str or dict or plotly.graph_objects.layout.Template instance
|
| 112 |
+
The figure template name or definition.
|
| 113 |
+
|
| 114 |
+
Returns
|
| 115 |
+
-------
|
| 116 |
+
fig : graph_objects.Figure containing the displayed image
|
| 117 |
+
A `Figure` object. This figure demonstrates the color scales and
|
| 118 |
+
sequences in this module, as polar bar charts.
|
| 119 |
+
"""
|
| 120 |
+
import plotly.graph_objects as go
|
| 121 |
+
from plotly.subplots import make_subplots
|
| 122 |
+
from plotly.express._core import apply_default_cascade
|
| 123 |
+
|
| 124 |
+
args = dict(template=template)
|
| 125 |
+
apply_default_cascade(args, constructor=None)
|
| 126 |
+
|
| 127 |
+
rows = 2
|
| 128 |
+
cols = 4
|
| 129 |
+
scales = [
|
| 130 |
+
(k, v)
|
| 131 |
+
for k, v in module_contents.items()
|
| 132 |
+
if not (k.startswith("_") or k.startswith("swatches") or k.endswith("_r"))
|
| 133 |
+
]
|
| 134 |
+
names = [name for name, colors in scales]
|
| 135 |
+
fig = make_subplots(
|
| 136 |
+
rows=rows,
|
| 137 |
+
cols=cols,
|
| 138 |
+
subplot_titles=names,
|
| 139 |
+
specs=[[{"type": "polar"}] * cols] * rows,
|
| 140 |
+
)
|
| 141 |
+
|
| 142 |
+
for i, (name, scale) in enumerate(scales):
|
| 143 |
+
fig.add_trace(
|
| 144 |
+
go.Barpolar(
|
| 145 |
+
r=[1] * int(360 / 5),
|
| 146 |
+
theta=list(range(0, 360, 5)),
|
| 147 |
+
marker_color=list(range(0, 360, 5)),
|
| 148 |
+
marker_cmin=0,
|
| 149 |
+
marker_cmax=360,
|
| 150 |
+
marker_colorscale=name,
|
| 151 |
+
name=name,
|
| 152 |
+
),
|
| 153 |
+
row=int(i / cols) + 1,
|
| 154 |
+
col=i % cols + 1,
|
| 155 |
+
)
|
| 156 |
+
fig.update_traces(width=5.2, marker_line_width=0, base=0.5, showlegend=False)
|
| 157 |
+
fig.update_polars(angularaxis_visible=False, radialaxis_visible=False)
|
| 158 |
+
fig.update_layout(
|
| 159 |
+
title="plotly.colors." + module_names.split(".")[-1], template=args["template"]
|
| 160 |
+
)
|
| 161 |
+
return fig
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/carto.py
ADDED
|
@@ -0,0 +1,419 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Color sequences and scales from CARTO's CartoColors
|
| 3 |
+
|
| 4 |
+
Learn more at https://github.com/CartoDB/CartoColor
|
| 5 |
+
|
| 6 |
+
CARTOColors are made available under a Creative Commons Attribution license: https://creativecommons.org/licenses/by/3.0/us/
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from ._swatches import _swatches
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def swatches(template=None):
|
| 13 |
+
return _swatches(__name__, globals(), template)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
swatches.__doc__ = _swatches.__doc__
|
| 17 |
+
|
| 18 |
+
Burg = [
|
| 19 |
+
"rgb(255, 198, 196)",
|
| 20 |
+
"rgb(244, 163, 168)",
|
| 21 |
+
"rgb(227, 129, 145)",
|
| 22 |
+
"rgb(204, 96, 125)",
|
| 23 |
+
"rgb(173, 70, 108)",
|
| 24 |
+
"rgb(139, 48, 88)",
|
| 25 |
+
"rgb(103, 32, 68)",
|
| 26 |
+
]
|
| 27 |
+
|
| 28 |
+
Burgyl = [
|
| 29 |
+
"rgb(251, 230, 197)",
|
| 30 |
+
"rgb(245, 186, 152)",
|
| 31 |
+
"rgb(238, 138, 130)",
|
| 32 |
+
"rgb(220, 113, 118)",
|
| 33 |
+
"rgb(200, 88, 108)",
|
| 34 |
+
"rgb(156, 63, 93)",
|
| 35 |
+
"rgb(112, 40, 74)",
|
| 36 |
+
]
|
| 37 |
+
|
| 38 |
+
Redor = [
|
| 39 |
+
"rgb(246, 210, 169)",
|
| 40 |
+
"rgb(245, 183, 142)",
|
| 41 |
+
"rgb(241, 156, 124)",
|
| 42 |
+
"rgb(234, 129, 113)",
|
| 43 |
+
"rgb(221, 104, 108)",
|
| 44 |
+
"rgb(202, 82, 104)",
|
| 45 |
+
"rgb(177, 63, 100)",
|
| 46 |
+
]
|
| 47 |
+
|
| 48 |
+
Oryel = [
|
| 49 |
+
"rgb(236, 218, 154)",
|
| 50 |
+
"rgb(239, 196, 126)",
|
| 51 |
+
"rgb(243, 173, 106)",
|
| 52 |
+
"rgb(247, 148, 93)",
|
| 53 |
+
"rgb(249, 123, 87)",
|
| 54 |
+
"rgb(246, 99, 86)",
|
| 55 |
+
"rgb(238, 77, 90)",
|
| 56 |
+
]
|
| 57 |
+
|
| 58 |
+
Peach = [
|
| 59 |
+
"rgb(253, 224, 197)",
|
| 60 |
+
"rgb(250, 203, 166)",
|
| 61 |
+
"rgb(248, 181, 139)",
|
| 62 |
+
"rgb(245, 158, 114)",
|
| 63 |
+
"rgb(242, 133, 93)",
|
| 64 |
+
"rgb(239, 106, 76)",
|
| 65 |
+
"rgb(235, 74, 64)",
|
| 66 |
+
]
|
| 67 |
+
|
| 68 |
+
Pinkyl = [
|
| 69 |
+
"rgb(254, 246, 181)",
|
| 70 |
+
"rgb(255, 221, 154)",
|
| 71 |
+
"rgb(255, 194, 133)",
|
| 72 |
+
"rgb(255, 166, 121)",
|
| 73 |
+
"rgb(250, 138, 118)",
|
| 74 |
+
"rgb(241, 109, 122)",
|
| 75 |
+
"rgb(225, 83, 131)",
|
| 76 |
+
]
|
| 77 |
+
|
| 78 |
+
Mint = [
|
| 79 |
+
"rgb(228, 241, 225)",
|
| 80 |
+
"rgb(180, 217, 204)",
|
| 81 |
+
"rgb(137, 192, 182)",
|
| 82 |
+
"rgb(99, 166, 160)",
|
| 83 |
+
"rgb(68, 140, 138)",
|
| 84 |
+
"rgb(40, 114, 116)",
|
| 85 |
+
"rgb(13, 88, 95)",
|
| 86 |
+
]
|
| 87 |
+
|
| 88 |
+
Blugrn = [
|
| 89 |
+
"rgb(196, 230, 195)",
|
| 90 |
+
"rgb(150, 210, 164)",
|
| 91 |
+
"rgb(109, 188, 144)",
|
| 92 |
+
"rgb(77, 162, 132)",
|
| 93 |
+
"rgb(54, 135, 122)",
|
| 94 |
+
"rgb(38, 107, 110)",
|
| 95 |
+
"rgb(29, 79, 96)",
|
| 96 |
+
]
|
| 97 |
+
|
| 98 |
+
Darkmint = [
|
| 99 |
+
"rgb(210, 251, 212)",
|
| 100 |
+
"rgb(165, 219, 194)",
|
| 101 |
+
"rgb(123, 188, 176)",
|
| 102 |
+
"rgb(85, 156, 158)",
|
| 103 |
+
"rgb(58, 124, 137)",
|
| 104 |
+
"rgb(35, 93, 114)",
|
| 105 |
+
"rgb(18, 63, 90)",
|
| 106 |
+
]
|
| 107 |
+
|
| 108 |
+
Emrld = [
|
| 109 |
+
"rgb(211, 242, 163)",
|
| 110 |
+
"rgb(151, 225, 150)",
|
| 111 |
+
"rgb(108, 192, 139)",
|
| 112 |
+
"rgb(76, 155, 130)",
|
| 113 |
+
"rgb(33, 122, 121)",
|
| 114 |
+
"rgb(16, 89, 101)",
|
| 115 |
+
"rgb(7, 64, 80)",
|
| 116 |
+
]
|
| 117 |
+
|
| 118 |
+
Aggrnyl = [
|
| 119 |
+
"rgb(36, 86, 104)",
|
| 120 |
+
"rgb(15, 114, 121)",
|
| 121 |
+
"rgb(13, 143, 129)",
|
| 122 |
+
"rgb(57, 171, 126)",
|
| 123 |
+
"rgb(110, 197, 116)",
|
| 124 |
+
"rgb(169, 220, 103)",
|
| 125 |
+
"rgb(237, 239, 93)",
|
| 126 |
+
]
|
| 127 |
+
|
| 128 |
+
Bluyl = [
|
| 129 |
+
"rgb(247, 254, 174)",
|
| 130 |
+
"rgb(183, 230, 165)",
|
| 131 |
+
"rgb(124, 203, 162)",
|
| 132 |
+
"rgb(70, 174, 160)",
|
| 133 |
+
"rgb(8, 144, 153)",
|
| 134 |
+
"rgb(0, 113, 139)",
|
| 135 |
+
"rgb(4, 82, 117)",
|
| 136 |
+
]
|
| 137 |
+
|
| 138 |
+
Teal = [
|
| 139 |
+
"rgb(209, 238, 234)",
|
| 140 |
+
"rgb(168, 219, 217)",
|
| 141 |
+
"rgb(133, 196, 201)",
|
| 142 |
+
"rgb(104, 171, 184)",
|
| 143 |
+
"rgb(79, 144, 166)",
|
| 144 |
+
"rgb(59, 115, 143)",
|
| 145 |
+
"rgb(42, 86, 116)",
|
| 146 |
+
]
|
| 147 |
+
|
| 148 |
+
Tealgrn = [
|
| 149 |
+
"rgb(176, 242, 188)",
|
| 150 |
+
"rgb(137, 232, 172)",
|
| 151 |
+
"rgb(103, 219, 165)",
|
| 152 |
+
"rgb(76, 200, 163)",
|
| 153 |
+
"rgb(56, 178, 163)",
|
| 154 |
+
"rgb(44, 152, 160)",
|
| 155 |
+
"rgb(37, 125, 152)",
|
| 156 |
+
]
|
| 157 |
+
|
| 158 |
+
Purp = [
|
| 159 |
+
"rgb(243, 224, 247)",
|
| 160 |
+
"rgb(228, 199, 241)",
|
| 161 |
+
"rgb(209, 175, 232)",
|
| 162 |
+
"rgb(185, 152, 221)",
|
| 163 |
+
"rgb(159, 130, 206)",
|
| 164 |
+
"rgb(130, 109, 186)",
|
| 165 |
+
"rgb(99, 88, 159)",
|
| 166 |
+
]
|
| 167 |
+
|
| 168 |
+
Purpor = [
|
| 169 |
+
"rgb(249, 221, 218)",
|
| 170 |
+
"rgb(242, 185, 196)",
|
| 171 |
+
"rgb(229, 151, 185)",
|
| 172 |
+
"rgb(206, 120, 179)",
|
| 173 |
+
"rgb(173, 95, 173)",
|
| 174 |
+
"rgb(131, 75, 160)",
|
| 175 |
+
"rgb(87, 59, 136)",
|
| 176 |
+
]
|
| 177 |
+
|
| 178 |
+
Sunset = [
|
| 179 |
+
"rgb(243, 231, 155)",
|
| 180 |
+
"rgb(250, 196, 132)",
|
| 181 |
+
"rgb(248, 160, 126)",
|
| 182 |
+
"rgb(235, 127, 134)",
|
| 183 |
+
"rgb(206, 102, 147)",
|
| 184 |
+
"rgb(160, 89, 160)",
|
| 185 |
+
"rgb(92, 83, 165)",
|
| 186 |
+
]
|
| 187 |
+
|
| 188 |
+
Magenta = [
|
| 189 |
+
"rgb(243, 203, 211)",
|
| 190 |
+
"rgb(234, 169, 189)",
|
| 191 |
+
"rgb(221, 136, 172)",
|
| 192 |
+
"rgb(202, 105, 157)",
|
| 193 |
+
"rgb(177, 77, 142)",
|
| 194 |
+
"rgb(145, 53, 125)",
|
| 195 |
+
"rgb(108, 33, 103)",
|
| 196 |
+
]
|
| 197 |
+
|
| 198 |
+
Sunsetdark = [
|
| 199 |
+
"rgb(252, 222, 156)",
|
| 200 |
+
"rgb(250, 164, 118)",
|
| 201 |
+
"rgb(240, 116, 110)",
|
| 202 |
+
"rgb(227, 79, 111)",
|
| 203 |
+
"rgb(220, 57, 119)",
|
| 204 |
+
"rgb(185, 37, 122)",
|
| 205 |
+
"rgb(124, 29, 111)",
|
| 206 |
+
]
|
| 207 |
+
|
| 208 |
+
Agsunset = [
|
| 209 |
+
"rgb(75, 41, 145)",
|
| 210 |
+
"rgb(135, 44, 162)",
|
| 211 |
+
"rgb(192, 54, 157)",
|
| 212 |
+
"rgb(234, 79, 136)",
|
| 213 |
+
"rgb(250, 120, 118)",
|
| 214 |
+
"rgb(246, 169, 122)",
|
| 215 |
+
"rgb(237, 217, 163)",
|
| 216 |
+
]
|
| 217 |
+
|
| 218 |
+
Brwnyl = [
|
| 219 |
+
"rgb(237, 229, 207)",
|
| 220 |
+
"rgb(224, 194, 162)",
|
| 221 |
+
"rgb(211, 156, 131)",
|
| 222 |
+
"rgb(193, 118, 111)",
|
| 223 |
+
"rgb(166, 84, 97)",
|
| 224 |
+
"rgb(129, 55, 83)",
|
| 225 |
+
"rgb(84, 31, 63)",
|
| 226 |
+
]
|
| 227 |
+
|
| 228 |
+
# Diverging schemes
|
| 229 |
+
|
| 230 |
+
Armyrose = [
|
| 231 |
+
"rgb(121, 130, 52)",
|
| 232 |
+
"rgb(163, 173, 98)",
|
| 233 |
+
"rgb(208, 211, 162)",
|
| 234 |
+
"rgb(253, 251, 228)",
|
| 235 |
+
"rgb(240, 198, 195)",
|
| 236 |
+
"rgb(223, 145, 163)",
|
| 237 |
+
"rgb(212, 103, 128)",
|
| 238 |
+
]
|
| 239 |
+
|
| 240 |
+
Fall = [
|
| 241 |
+
"rgb(61, 89, 65)",
|
| 242 |
+
"rgb(119, 136, 104)",
|
| 243 |
+
"rgb(181, 185, 145)",
|
| 244 |
+
"rgb(246, 237, 189)",
|
| 245 |
+
"rgb(237, 187, 138)",
|
| 246 |
+
"rgb(222, 138, 90)",
|
| 247 |
+
"rgb(202, 86, 44)",
|
| 248 |
+
]
|
| 249 |
+
|
| 250 |
+
Geyser = [
|
| 251 |
+
"rgb(0, 128, 128)",
|
| 252 |
+
"rgb(112, 164, 148)",
|
| 253 |
+
"rgb(180, 200, 168)",
|
| 254 |
+
"rgb(246, 237, 189)",
|
| 255 |
+
"rgb(237, 187, 138)",
|
| 256 |
+
"rgb(222, 138, 90)",
|
| 257 |
+
"rgb(202, 86, 44)",
|
| 258 |
+
]
|
| 259 |
+
|
| 260 |
+
Temps = [
|
| 261 |
+
"rgb(0, 147, 146)",
|
| 262 |
+
"rgb(57, 177, 133)",
|
| 263 |
+
"rgb(156, 203, 134)",
|
| 264 |
+
"rgb(233, 226, 156)",
|
| 265 |
+
"rgb(238, 180, 121)",
|
| 266 |
+
"rgb(232, 132, 113)",
|
| 267 |
+
"rgb(207, 89, 126)",
|
| 268 |
+
]
|
| 269 |
+
|
| 270 |
+
Tealrose = [
|
| 271 |
+
"rgb(0, 147, 146)",
|
| 272 |
+
"rgb(114, 170, 161)",
|
| 273 |
+
"rgb(177, 199, 179)",
|
| 274 |
+
"rgb(241, 234, 200)",
|
| 275 |
+
"rgb(229, 185, 173)",
|
| 276 |
+
"rgb(217, 137, 148)",
|
| 277 |
+
"rgb(208, 88, 126)",
|
| 278 |
+
]
|
| 279 |
+
|
| 280 |
+
Tropic = [
|
| 281 |
+
"rgb(0, 155, 158)",
|
| 282 |
+
"rgb(66, 183, 185)",
|
| 283 |
+
"rgb(167, 211, 212)",
|
| 284 |
+
"rgb(241, 241, 241)",
|
| 285 |
+
"rgb(228, 193, 217)",
|
| 286 |
+
"rgb(214, 145, 193)",
|
| 287 |
+
"rgb(199, 93, 171)",
|
| 288 |
+
]
|
| 289 |
+
|
| 290 |
+
Earth = [
|
| 291 |
+
"rgb(161, 105, 40)",
|
| 292 |
+
"rgb(189, 146, 90)",
|
| 293 |
+
"rgb(214, 189, 141)",
|
| 294 |
+
"rgb(237, 234, 194)",
|
| 295 |
+
"rgb(181, 200, 184)",
|
| 296 |
+
"rgb(121, 167, 172)",
|
| 297 |
+
"rgb(40, 135, 161)",
|
| 298 |
+
]
|
| 299 |
+
|
| 300 |
+
# Qualitative palettes
|
| 301 |
+
|
| 302 |
+
Antique = [
|
| 303 |
+
"rgb(133, 92, 117)",
|
| 304 |
+
"rgb(217, 175, 107)",
|
| 305 |
+
"rgb(175, 100, 88)",
|
| 306 |
+
"rgb(115, 111, 76)",
|
| 307 |
+
"rgb(82, 106, 131)",
|
| 308 |
+
"rgb(98, 83, 119)",
|
| 309 |
+
"rgb(104, 133, 92)",
|
| 310 |
+
"rgb(156, 156, 94)",
|
| 311 |
+
"rgb(160, 97, 119)",
|
| 312 |
+
"rgb(140, 120, 93)",
|
| 313 |
+
"rgb(124, 124, 124)",
|
| 314 |
+
]
|
| 315 |
+
|
| 316 |
+
Bold = [
|
| 317 |
+
"rgb(127, 60, 141)",
|
| 318 |
+
"rgb(17, 165, 121)",
|
| 319 |
+
"rgb(57, 105, 172)",
|
| 320 |
+
"rgb(242, 183, 1)",
|
| 321 |
+
"rgb(231, 63, 116)",
|
| 322 |
+
"rgb(128, 186, 90)",
|
| 323 |
+
"rgb(230, 131, 16)",
|
| 324 |
+
"rgb(0, 134, 149)",
|
| 325 |
+
"rgb(207, 28, 144)",
|
| 326 |
+
"rgb(249, 123, 114)",
|
| 327 |
+
"rgb(165, 170, 153)",
|
| 328 |
+
]
|
| 329 |
+
|
| 330 |
+
Pastel = [
|
| 331 |
+
"rgb(102, 197, 204)",
|
| 332 |
+
"rgb(246, 207, 113)",
|
| 333 |
+
"rgb(248, 156, 116)",
|
| 334 |
+
"rgb(220, 176, 242)",
|
| 335 |
+
"rgb(135, 197, 95)",
|
| 336 |
+
"rgb(158, 185, 243)",
|
| 337 |
+
"rgb(254, 136, 177)",
|
| 338 |
+
"rgb(201, 219, 116)",
|
| 339 |
+
"rgb(139, 224, 164)",
|
| 340 |
+
"rgb(180, 151, 231)",
|
| 341 |
+
"rgb(179, 179, 179)",
|
| 342 |
+
]
|
| 343 |
+
|
| 344 |
+
Prism = [
|
| 345 |
+
"rgb(95, 70, 144)",
|
| 346 |
+
"rgb(29, 105, 150)",
|
| 347 |
+
"rgb(56, 166, 165)",
|
| 348 |
+
"rgb(15, 133, 84)",
|
| 349 |
+
"rgb(115, 175, 72)",
|
| 350 |
+
"rgb(237, 173, 8)",
|
| 351 |
+
"rgb(225, 124, 5)",
|
| 352 |
+
"rgb(204, 80, 62)",
|
| 353 |
+
"rgb(148, 52, 110)",
|
| 354 |
+
"rgb(111, 64, 112)",
|
| 355 |
+
"rgb(102, 102, 102)",
|
| 356 |
+
]
|
| 357 |
+
|
| 358 |
+
Safe = [
|
| 359 |
+
"rgb(136, 204, 238)",
|
| 360 |
+
"rgb(204, 102, 119)",
|
| 361 |
+
"rgb(221, 204, 119)",
|
| 362 |
+
"rgb(17, 119, 51)",
|
| 363 |
+
"rgb(51, 34, 136)",
|
| 364 |
+
"rgb(170, 68, 153)",
|
| 365 |
+
"rgb(68, 170, 153)",
|
| 366 |
+
"rgb(153, 153, 51)",
|
| 367 |
+
"rgb(136, 34, 85)",
|
| 368 |
+
"rgb(102, 17, 0)",
|
| 369 |
+
"rgb(136, 136, 136)",
|
| 370 |
+
]
|
| 371 |
+
|
| 372 |
+
Vivid = [
|
| 373 |
+
"rgb(229, 134, 6)",
|
| 374 |
+
"rgb(93, 105, 177)",
|
| 375 |
+
"rgb(82, 188, 163)",
|
| 376 |
+
"rgb(153, 201, 69)",
|
| 377 |
+
"rgb(204, 97, 176)",
|
| 378 |
+
"rgb(36, 121, 108)",
|
| 379 |
+
"rgb(218, 165, 27)",
|
| 380 |
+
"rgb(47, 138, 196)",
|
| 381 |
+
"rgb(118, 78, 159)",
|
| 382 |
+
"rgb(237, 100, 90)",
|
| 383 |
+
"rgb(165, 170, 153)",
|
| 384 |
+
]
|
| 385 |
+
|
| 386 |
+
Aggrnyl_r = Aggrnyl[::-1]
|
| 387 |
+
Agsunset_r = Agsunset[::-1]
|
| 388 |
+
Antique_r = Antique[::-1]
|
| 389 |
+
Armyrose_r = Armyrose[::-1]
|
| 390 |
+
Blugrn_r = Blugrn[::-1]
|
| 391 |
+
Bluyl_r = Bluyl[::-1]
|
| 392 |
+
Bold_r = Bold[::-1]
|
| 393 |
+
Brwnyl_r = Brwnyl[::-1]
|
| 394 |
+
Burg_r = Burg[::-1]
|
| 395 |
+
Burgyl_r = Burgyl[::-1]
|
| 396 |
+
Darkmint_r = Darkmint[::-1]
|
| 397 |
+
Earth_r = Earth[::-1]
|
| 398 |
+
Emrld_r = Emrld[::-1]
|
| 399 |
+
Fall_r = Fall[::-1]
|
| 400 |
+
Geyser_r = Geyser[::-1]
|
| 401 |
+
Magenta_r = Magenta[::-1]
|
| 402 |
+
Mint_r = Mint[::-1]
|
| 403 |
+
Oryel_r = Oryel[::-1]
|
| 404 |
+
Pastel_r = Pastel[::-1]
|
| 405 |
+
Peach_r = Peach[::-1]
|
| 406 |
+
Pinkyl_r = Pinkyl[::-1]
|
| 407 |
+
Prism_r = Prism[::-1]
|
| 408 |
+
Purp_r = Purp[::-1]
|
| 409 |
+
Purpor_r = Purpor[::-1]
|
| 410 |
+
Redor_r = Redor[::-1]
|
| 411 |
+
Safe_r = Safe[::-1]
|
| 412 |
+
Sunset_r = Sunset[::-1]
|
| 413 |
+
Sunsetdark_r = Sunsetdark[::-1]
|
| 414 |
+
Teal_r = Teal[::-1]
|
| 415 |
+
Tealgrn_r = Tealgrn[::-1]
|
| 416 |
+
Tealrose_r = Tealrose[::-1]
|
| 417 |
+
Temps_r = Temps[::-1]
|
| 418 |
+
Tropic_r = Tropic[::-1]
|
| 419 |
+
Vivid_r = Vivid[::-1]
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/cmocean.py
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Color scales from the cmocean project
|
| 3 |
+
|
| 4 |
+
Learn more at https://matplotlib.org/cmocean/
|
| 5 |
+
|
| 6 |
+
cmocean is made available under an MIT license: https://github.com/matplotlib/cmocean/blob/master/LICENSE.txt
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from ._swatches import _swatches, _swatches_continuous
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def swatches(template=None):
|
| 13 |
+
return _swatches(__name__, globals(), template)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
swatches.__doc__ = _swatches.__doc__
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def swatches_continuous(template=None):
|
| 20 |
+
return _swatches_continuous(__name__, globals(), template)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
swatches_continuous.__doc__ = _swatches_continuous.__doc__
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
turbid = [
|
| 27 |
+
"rgb(232, 245, 171)",
|
| 28 |
+
"rgb(220, 219, 137)",
|
| 29 |
+
"rgb(209, 193, 107)",
|
| 30 |
+
"rgb(199, 168, 83)",
|
| 31 |
+
"rgb(186, 143, 66)",
|
| 32 |
+
"rgb(170, 121, 60)",
|
| 33 |
+
"rgb(151, 103, 58)",
|
| 34 |
+
"rgb(129, 87, 56)",
|
| 35 |
+
"rgb(104, 72, 53)",
|
| 36 |
+
"rgb(80, 59, 46)",
|
| 37 |
+
"rgb(57, 45, 37)",
|
| 38 |
+
"rgb(34, 30, 27)",
|
| 39 |
+
]
|
| 40 |
+
thermal = [
|
| 41 |
+
"rgb(3, 35, 51)",
|
| 42 |
+
"rgb(13, 48, 100)",
|
| 43 |
+
"rgb(53, 50, 155)",
|
| 44 |
+
"rgb(93, 62, 153)",
|
| 45 |
+
"rgb(126, 77, 143)",
|
| 46 |
+
"rgb(158, 89, 135)",
|
| 47 |
+
"rgb(193, 100, 121)",
|
| 48 |
+
"rgb(225, 113, 97)",
|
| 49 |
+
"rgb(246, 139, 69)",
|
| 50 |
+
"rgb(251, 173, 60)",
|
| 51 |
+
"rgb(246, 211, 70)",
|
| 52 |
+
"rgb(231, 250, 90)",
|
| 53 |
+
]
|
| 54 |
+
haline = [
|
| 55 |
+
"rgb(41, 24, 107)",
|
| 56 |
+
"rgb(42, 35, 160)",
|
| 57 |
+
"rgb(15, 71, 153)",
|
| 58 |
+
"rgb(18, 95, 142)",
|
| 59 |
+
"rgb(38, 116, 137)",
|
| 60 |
+
"rgb(53, 136, 136)",
|
| 61 |
+
"rgb(65, 157, 133)",
|
| 62 |
+
"rgb(81, 178, 124)",
|
| 63 |
+
"rgb(111, 198, 107)",
|
| 64 |
+
"rgb(160, 214, 91)",
|
| 65 |
+
"rgb(212, 225, 112)",
|
| 66 |
+
"rgb(253, 238, 153)",
|
| 67 |
+
]
|
| 68 |
+
solar = [
|
| 69 |
+
"rgb(51, 19, 23)",
|
| 70 |
+
"rgb(79, 28, 33)",
|
| 71 |
+
"rgb(108, 36, 36)",
|
| 72 |
+
"rgb(135, 47, 32)",
|
| 73 |
+
"rgb(157, 66, 25)",
|
| 74 |
+
"rgb(174, 88, 20)",
|
| 75 |
+
"rgb(188, 111, 19)",
|
| 76 |
+
"rgb(199, 137, 22)",
|
| 77 |
+
"rgb(209, 164, 32)",
|
| 78 |
+
"rgb(217, 192, 44)",
|
| 79 |
+
"rgb(222, 222, 59)",
|
| 80 |
+
"rgb(224, 253, 74)",
|
| 81 |
+
]
|
| 82 |
+
ice = [
|
| 83 |
+
"rgb(3, 5, 18)",
|
| 84 |
+
"rgb(25, 25, 51)",
|
| 85 |
+
"rgb(44, 42, 87)",
|
| 86 |
+
"rgb(58, 60, 125)",
|
| 87 |
+
"rgb(62, 83, 160)",
|
| 88 |
+
"rgb(62, 109, 178)",
|
| 89 |
+
"rgb(72, 134, 187)",
|
| 90 |
+
"rgb(89, 159, 196)",
|
| 91 |
+
"rgb(114, 184, 205)",
|
| 92 |
+
"rgb(149, 207, 216)",
|
| 93 |
+
"rgb(192, 229, 232)",
|
| 94 |
+
"rgb(234, 252, 253)",
|
| 95 |
+
]
|
| 96 |
+
gray = [
|
| 97 |
+
"rgb(0, 0, 0)",
|
| 98 |
+
"rgb(16, 16, 16)",
|
| 99 |
+
"rgb(38, 38, 38)",
|
| 100 |
+
"rgb(59, 59, 59)",
|
| 101 |
+
"rgb(81, 80, 80)",
|
| 102 |
+
"rgb(102, 101, 101)",
|
| 103 |
+
"rgb(124, 123, 122)",
|
| 104 |
+
"rgb(146, 146, 145)",
|
| 105 |
+
"rgb(171, 171, 170)",
|
| 106 |
+
"rgb(197, 197, 195)",
|
| 107 |
+
"rgb(224, 224, 223)",
|
| 108 |
+
"rgb(254, 254, 253)",
|
| 109 |
+
]
|
| 110 |
+
oxy = [
|
| 111 |
+
"rgb(63, 5, 5)",
|
| 112 |
+
"rgb(101, 6, 13)",
|
| 113 |
+
"rgb(138, 17, 9)",
|
| 114 |
+
"rgb(96, 95, 95)",
|
| 115 |
+
"rgb(119, 118, 118)",
|
| 116 |
+
"rgb(142, 141, 141)",
|
| 117 |
+
"rgb(166, 166, 165)",
|
| 118 |
+
"rgb(193, 192, 191)",
|
| 119 |
+
"rgb(222, 222, 220)",
|
| 120 |
+
"rgb(239, 248, 90)",
|
| 121 |
+
"rgb(230, 210, 41)",
|
| 122 |
+
"rgb(220, 174, 25)",
|
| 123 |
+
]
|
| 124 |
+
deep = [
|
| 125 |
+
"rgb(253, 253, 204)",
|
| 126 |
+
"rgb(206, 236, 179)",
|
| 127 |
+
"rgb(156, 219, 165)",
|
| 128 |
+
"rgb(111, 201, 163)",
|
| 129 |
+
"rgb(86, 177, 163)",
|
| 130 |
+
"rgb(76, 153, 160)",
|
| 131 |
+
"rgb(68, 130, 155)",
|
| 132 |
+
"rgb(62, 108, 150)",
|
| 133 |
+
"rgb(62, 82, 143)",
|
| 134 |
+
"rgb(64, 60, 115)",
|
| 135 |
+
"rgb(54, 43, 77)",
|
| 136 |
+
"rgb(39, 26, 44)",
|
| 137 |
+
]
|
| 138 |
+
dense = [
|
| 139 |
+
"rgb(230, 240, 240)",
|
| 140 |
+
"rgb(191, 221, 229)",
|
| 141 |
+
"rgb(156, 201, 226)",
|
| 142 |
+
"rgb(129, 180, 227)",
|
| 143 |
+
"rgb(115, 154, 228)",
|
| 144 |
+
"rgb(117, 127, 221)",
|
| 145 |
+
"rgb(120, 100, 202)",
|
| 146 |
+
"rgb(119, 74, 175)",
|
| 147 |
+
"rgb(113, 50, 141)",
|
| 148 |
+
"rgb(100, 31, 104)",
|
| 149 |
+
"rgb(80, 20, 66)",
|
| 150 |
+
"rgb(54, 14, 36)",
|
| 151 |
+
]
|
| 152 |
+
algae = [
|
| 153 |
+
"rgb(214, 249, 207)",
|
| 154 |
+
"rgb(186, 228, 174)",
|
| 155 |
+
"rgb(156, 209, 143)",
|
| 156 |
+
"rgb(124, 191, 115)",
|
| 157 |
+
"rgb(85, 174, 91)",
|
| 158 |
+
"rgb(37, 157, 81)",
|
| 159 |
+
"rgb(7, 138, 78)",
|
| 160 |
+
"rgb(13, 117, 71)",
|
| 161 |
+
"rgb(23, 95, 61)",
|
| 162 |
+
"rgb(25, 75, 49)",
|
| 163 |
+
"rgb(23, 55, 35)",
|
| 164 |
+
"rgb(17, 36, 20)",
|
| 165 |
+
]
|
| 166 |
+
matter = [
|
| 167 |
+
"rgb(253, 237, 176)",
|
| 168 |
+
"rgb(250, 205, 145)",
|
| 169 |
+
"rgb(246, 173, 119)",
|
| 170 |
+
"rgb(240, 142, 98)",
|
| 171 |
+
"rgb(231, 109, 84)",
|
| 172 |
+
"rgb(216, 80, 83)",
|
| 173 |
+
"rgb(195, 56, 90)",
|
| 174 |
+
"rgb(168, 40, 96)",
|
| 175 |
+
"rgb(138, 29, 99)",
|
| 176 |
+
"rgb(107, 24, 93)",
|
| 177 |
+
"rgb(76, 21, 80)",
|
| 178 |
+
"rgb(47, 15, 61)",
|
| 179 |
+
]
|
| 180 |
+
speed = [
|
| 181 |
+
"rgb(254, 252, 205)",
|
| 182 |
+
"rgb(239, 225, 156)",
|
| 183 |
+
"rgb(221, 201, 106)",
|
| 184 |
+
"rgb(194, 182, 59)",
|
| 185 |
+
"rgb(157, 167, 21)",
|
| 186 |
+
"rgb(116, 153, 5)",
|
| 187 |
+
"rgb(75, 138, 20)",
|
| 188 |
+
"rgb(35, 121, 36)",
|
| 189 |
+
"rgb(11, 100, 44)",
|
| 190 |
+
"rgb(18, 78, 43)",
|
| 191 |
+
"rgb(25, 56, 34)",
|
| 192 |
+
"rgb(23, 35, 18)",
|
| 193 |
+
]
|
| 194 |
+
amp = [
|
| 195 |
+
"rgb(241, 236, 236)",
|
| 196 |
+
"rgb(230, 209, 203)",
|
| 197 |
+
"rgb(221, 182, 170)",
|
| 198 |
+
"rgb(213, 156, 137)",
|
| 199 |
+
"rgb(205, 129, 103)",
|
| 200 |
+
"rgb(196, 102, 73)",
|
| 201 |
+
"rgb(186, 74, 47)",
|
| 202 |
+
"rgb(172, 44, 36)",
|
| 203 |
+
"rgb(149, 19, 39)",
|
| 204 |
+
"rgb(120, 14, 40)",
|
| 205 |
+
"rgb(89, 13, 31)",
|
| 206 |
+
"rgb(60, 9, 17)",
|
| 207 |
+
]
|
| 208 |
+
tempo = [
|
| 209 |
+
"rgb(254, 245, 244)",
|
| 210 |
+
"rgb(222, 224, 210)",
|
| 211 |
+
"rgb(189, 206, 181)",
|
| 212 |
+
"rgb(153, 189, 156)",
|
| 213 |
+
"rgb(110, 173, 138)",
|
| 214 |
+
"rgb(65, 157, 129)",
|
| 215 |
+
"rgb(25, 137, 125)",
|
| 216 |
+
"rgb(18, 116, 117)",
|
| 217 |
+
"rgb(25, 94, 106)",
|
| 218 |
+
"rgb(28, 72, 93)",
|
| 219 |
+
"rgb(25, 51, 80)",
|
| 220 |
+
"rgb(20, 29, 67)",
|
| 221 |
+
]
|
| 222 |
+
phase = [
|
| 223 |
+
"rgb(167, 119, 12)",
|
| 224 |
+
"rgb(197, 96, 51)",
|
| 225 |
+
"rgb(217, 67, 96)",
|
| 226 |
+
"rgb(221, 38, 163)",
|
| 227 |
+
"rgb(196, 59, 224)",
|
| 228 |
+
"rgb(153, 97, 244)",
|
| 229 |
+
"rgb(95, 127, 228)",
|
| 230 |
+
"rgb(40, 144, 183)",
|
| 231 |
+
"rgb(15, 151, 136)",
|
| 232 |
+
"rgb(39, 153, 79)",
|
| 233 |
+
"rgb(119, 141, 17)",
|
| 234 |
+
"rgb(167, 119, 12)",
|
| 235 |
+
]
|
| 236 |
+
balance = [
|
| 237 |
+
"rgb(23, 28, 66)",
|
| 238 |
+
"rgb(41, 58, 143)",
|
| 239 |
+
"rgb(11, 102, 189)",
|
| 240 |
+
"rgb(69, 144, 185)",
|
| 241 |
+
"rgb(142, 181, 194)",
|
| 242 |
+
"rgb(210, 216, 219)",
|
| 243 |
+
"rgb(230, 210, 204)",
|
| 244 |
+
"rgb(213, 157, 137)",
|
| 245 |
+
"rgb(196, 101, 72)",
|
| 246 |
+
"rgb(172, 43, 36)",
|
| 247 |
+
"rgb(120, 14, 40)",
|
| 248 |
+
"rgb(60, 9, 17)",
|
| 249 |
+
]
|
| 250 |
+
delta = [
|
| 251 |
+
"rgb(16, 31, 63)",
|
| 252 |
+
"rgb(38, 62, 144)",
|
| 253 |
+
"rgb(30, 110, 161)",
|
| 254 |
+
"rgb(60, 154, 171)",
|
| 255 |
+
"rgb(140, 193, 186)",
|
| 256 |
+
"rgb(217, 229, 218)",
|
| 257 |
+
"rgb(239, 226, 156)",
|
| 258 |
+
"rgb(195, 182, 59)",
|
| 259 |
+
"rgb(115, 152, 5)",
|
| 260 |
+
"rgb(34, 120, 36)",
|
| 261 |
+
"rgb(18, 78, 43)",
|
| 262 |
+
"rgb(23, 35, 18)",
|
| 263 |
+
]
|
| 264 |
+
curl = [
|
| 265 |
+
"rgb(20, 29, 67)",
|
| 266 |
+
"rgb(28, 72, 93)",
|
| 267 |
+
"rgb(18, 115, 117)",
|
| 268 |
+
"rgb(63, 156, 129)",
|
| 269 |
+
"rgb(153, 189, 156)",
|
| 270 |
+
"rgb(223, 225, 211)",
|
| 271 |
+
"rgb(241, 218, 206)",
|
| 272 |
+
"rgb(224, 160, 137)",
|
| 273 |
+
"rgb(203, 101, 99)",
|
| 274 |
+
"rgb(164, 54, 96)",
|
| 275 |
+
"rgb(111, 23, 91)",
|
| 276 |
+
"rgb(51, 13, 53)",
|
| 277 |
+
]
|
| 278 |
+
|
| 279 |
+
algae_r = algae[::-1]
|
| 280 |
+
amp_r = amp[::-1]
|
| 281 |
+
balance_r = balance[::-1]
|
| 282 |
+
curl_r = curl[::-1]
|
| 283 |
+
deep_r = deep[::-1]
|
| 284 |
+
delta_r = delta[::-1]
|
| 285 |
+
dense_r = dense[::-1]
|
| 286 |
+
gray_r = gray[::-1]
|
| 287 |
+
haline_r = haline[::-1]
|
| 288 |
+
ice_r = ice[::-1]
|
| 289 |
+
matter_r = matter[::-1]
|
| 290 |
+
oxy_r = oxy[::-1]
|
| 291 |
+
phase_r = phase[::-1]
|
| 292 |
+
solar_r = solar[::-1]
|
| 293 |
+
speed_r = speed[::-1]
|
| 294 |
+
tempo_r = tempo[::-1]
|
| 295 |
+
thermal_r = thermal[::-1]
|
| 296 |
+
turbid_r = turbid[::-1]
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/colorbrewer.py
ADDED
|
@@ -0,0 +1,494 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Color scales and sequences from the colorbrewer 2 project
|
| 3 |
+
|
| 4 |
+
Learn more at http://colorbrewer2.org
|
| 5 |
+
|
| 6 |
+
colorbrewer is made available under an Apache license: http://colorbrewer2.org/export/LICENSE.txt
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from ._swatches import _swatches
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def swatches(template=None):
|
| 13 |
+
return _swatches(__name__, globals(), template)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
swatches.__doc__ = _swatches.__doc__
|
| 17 |
+
|
| 18 |
+
BrBG = [
|
| 19 |
+
"rgb(84,48,5)",
|
| 20 |
+
"rgb(140,81,10)",
|
| 21 |
+
"rgb(191,129,45)",
|
| 22 |
+
"rgb(223,194,125)",
|
| 23 |
+
"rgb(246,232,195)",
|
| 24 |
+
"rgb(245,245,245)",
|
| 25 |
+
"rgb(199,234,229)",
|
| 26 |
+
"rgb(128,205,193)",
|
| 27 |
+
"rgb(53,151,143)",
|
| 28 |
+
"rgb(1,102,94)",
|
| 29 |
+
"rgb(0,60,48)",
|
| 30 |
+
]
|
| 31 |
+
|
| 32 |
+
PRGn = [
|
| 33 |
+
"rgb(64,0,75)",
|
| 34 |
+
"rgb(118,42,131)",
|
| 35 |
+
"rgb(153,112,171)",
|
| 36 |
+
"rgb(194,165,207)",
|
| 37 |
+
"rgb(231,212,232)",
|
| 38 |
+
"rgb(247,247,247)",
|
| 39 |
+
"rgb(217,240,211)",
|
| 40 |
+
"rgb(166,219,160)",
|
| 41 |
+
"rgb(90,174,97)",
|
| 42 |
+
"rgb(27,120,55)",
|
| 43 |
+
"rgb(0,68,27)",
|
| 44 |
+
]
|
| 45 |
+
|
| 46 |
+
PiYG = [
|
| 47 |
+
"rgb(142,1,82)",
|
| 48 |
+
"rgb(197,27,125)",
|
| 49 |
+
"rgb(222,119,174)",
|
| 50 |
+
"rgb(241,182,218)",
|
| 51 |
+
"rgb(253,224,239)",
|
| 52 |
+
"rgb(247,247,247)",
|
| 53 |
+
"rgb(230,245,208)",
|
| 54 |
+
"rgb(184,225,134)",
|
| 55 |
+
"rgb(127,188,65)",
|
| 56 |
+
"rgb(77,146,33)",
|
| 57 |
+
"rgb(39,100,25)",
|
| 58 |
+
]
|
| 59 |
+
|
| 60 |
+
PuOr = [
|
| 61 |
+
"rgb(127,59,8)",
|
| 62 |
+
"rgb(179,88,6)",
|
| 63 |
+
"rgb(224,130,20)",
|
| 64 |
+
"rgb(253,184,99)",
|
| 65 |
+
"rgb(254,224,182)",
|
| 66 |
+
"rgb(247,247,247)",
|
| 67 |
+
"rgb(216,218,235)",
|
| 68 |
+
"rgb(178,171,210)",
|
| 69 |
+
"rgb(128,115,172)",
|
| 70 |
+
"rgb(84,39,136)",
|
| 71 |
+
"rgb(45,0,75)",
|
| 72 |
+
]
|
| 73 |
+
|
| 74 |
+
RdBu = [
|
| 75 |
+
"rgb(103,0,31)",
|
| 76 |
+
"rgb(178,24,43)",
|
| 77 |
+
"rgb(214,96,77)",
|
| 78 |
+
"rgb(244,165,130)",
|
| 79 |
+
"rgb(253,219,199)",
|
| 80 |
+
"rgb(247,247,247)",
|
| 81 |
+
"rgb(209,229,240)",
|
| 82 |
+
"rgb(146,197,222)",
|
| 83 |
+
"rgb(67,147,195)",
|
| 84 |
+
"rgb(33,102,172)",
|
| 85 |
+
"rgb(5,48,97)",
|
| 86 |
+
]
|
| 87 |
+
|
| 88 |
+
RdGy = [
|
| 89 |
+
"rgb(103,0,31)",
|
| 90 |
+
"rgb(178,24,43)",
|
| 91 |
+
"rgb(214,96,77)",
|
| 92 |
+
"rgb(244,165,130)",
|
| 93 |
+
"rgb(253,219,199)",
|
| 94 |
+
"rgb(255,255,255)",
|
| 95 |
+
"rgb(224,224,224)",
|
| 96 |
+
"rgb(186,186,186)",
|
| 97 |
+
"rgb(135,135,135)",
|
| 98 |
+
"rgb(77,77,77)",
|
| 99 |
+
"rgb(26,26,26)",
|
| 100 |
+
]
|
| 101 |
+
|
| 102 |
+
RdYlBu = [
|
| 103 |
+
"rgb(165,0,38)",
|
| 104 |
+
"rgb(215,48,39)",
|
| 105 |
+
"rgb(244,109,67)",
|
| 106 |
+
"rgb(253,174,97)",
|
| 107 |
+
"rgb(254,224,144)",
|
| 108 |
+
"rgb(255,255,191)",
|
| 109 |
+
"rgb(224,243,248)",
|
| 110 |
+
"rgb(171,217,233)",
|
| 111 |
+
"rgb(116,173,209)",
|
| 112 |
+
"rgb(69,117,180)",
|
| 113 |
+
"rgb(49,54,149)",
|
| 114 |
+
]
|
| 115 |
+
|
| 116 |
+
RdYlGn = [
|
| 117 |
+
"rgb(165,0,38)",
|
| 118 |
+
"rgb(215,48,39)",
|
| 119 |
+
"rgb(244,109,67)",
|
| 120 |
+
"rgb(253,174,97)",
|
| 121 |
+
"rgb(254,224,139)",
|
| 122 |
+
"rgb(255,255,191)",
|
| 123 |
+
"rgb(217,239,139)",
|
| 124 |
+
"rgb(166,217,106)",
|
| 125 |
+
"rgb(102,189,99)",
|
| 126 |
+
"rgb(26,152,80)",
|
| 127 |
+
"rgb(0,104,55)",
|
| 128 |
+
]
|
| 129 |
+
|
| 130 |
+
Spectral = [
|
| 131 |
+
"rgb(158,1,66)",
|
| 132 |
+
"rgb(213,62,79)",
|
| 133 |
+
"rgb(244,109,67)",
|
| 134 |
+
"rgb(253,174,97)",
|
| 135 |
+
"rgb(254,224,139)",
|
| 136 |
+
"rgb(255,255,191)",
|
| 137 |
+
"rgb(230,245,152)",
|
| 138 |
+
"rgb(171,221,164)",
|
| 139 |
+
"rgb(102,194,165)",
|
| 140 |
+
"rgb(50,136,189)",
|
| 141 |
+
"rgb(94,79,162)",
|
| 142 |
+
]
|
| 143 |
+
|
| 144 |
+
Set1 = [
|
| 145 |
+
"rgb(228,26,28)",
|
| 146 |
+
"rgb(55,126,184)",
|
| 147 |
+
"rgb(77,175,74)",
|
| 148 |
+
"rgb(152,78,163)",
|
| 149 |
+
"rgb(255,127,0)",
|
| 150 |
+
"rgb(255,255,51)",
|
| 151 |
+
"rgb(166,86,40)",
|
| 152 |
+
"rgb(247,129,191)",
|
| 153 |
+
"rgb(153,153,153)",
|
| 154 |
+
]
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
Pastel1 = [
|
| 158 |
+
"rgb(251,180,174)",
|
| 159 |
+
"rgb(179,205,227)",
|
| 160 |
+
"rgb(204,235,197)",
|
| 161 |
+
"rgb(222,203,228)",
|
| 162 |
+
"rgb(254,217,166)",
|
| 163 |
+
"rgb(255,255,204)",
|
| 164 |
+
"rgb(229,216,189)",
|
| 165 |
+
"rgb(253,218,236)",
|
| 166 |
+
"rgb(242,242,242)",
|
| 167 |
+
]
|
| 168 |
+
Dark2 = [
|
| 169 |
+
"rgb(27,158,119)",
|
| 170 |
+
"rgb(217,95,2)",
|
| 171 |
+
"rgb(117,112,179)",
|
| 172 |
+
"rgb(231,41,138)",
|
| 173 |
+
"rgb(102,166,30)",
|
| 174 |
+
"rgb(230,171,2)",
|
| 175 |
+
"rgb(166,118,29)",
|
| 176 |
+
"rgb(102,102,102)",
|
| 177 |
+
]
|
| 178 |
+
Set2 = [
|
| 179 |
+
"rgb(102,194,165)",
|
| 180 |
+
"rgb(252,141,98)",
|
| 181 |
+
"rgb(141,160,203)",
|
| 182 |
+
"rgb(231,138,195)",
|
| 183 |
+
"rgb(166,216,84)",
|
| 184 |
+
"rgb(255,217,47)",
|
| 185 |
+
"rgb(229,196,148)",
|
| 186 |
+
"rgb(179,179,179)",
|
| 187 |
+
]
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
Pastel2 = [
|
| 191 |
+
"rgb(179,226,205)",
|
| 192 |
+
"rgb(253,205,172)",
|
| 193 |
+
"rgb(203,213,232)",
|
| 194 |
+
"rgb(244,202,228)",
|
| 195 |
+
"rgb(230,245,201)",
|
| 196 |
+
"rgb(255,242,174)",
|
| 197 |
+
"rgb(241,226,204)",
|
| 198 |
+
"rgb(204,204,204)",
|
| 199 |
+
]
|
| 200 |
+
|
| 201 |
+
Set3 = [
|
| 202 |
+
"rgb(141,211,199)",
|
| 203 |
+
"rgb(255,255,179)",
|
| 204 |
+
"rgb(190,186,218)",
|
| 205 |
+
"rgb(251,128,114)",
|
| 206 |
+
"rgb(128,177,211)",
|
| 207 |
+
"rgb(253,180,98)",
|
| 208 |
+
"rgb(179,222,105)",
|
| 209 |
+
"rgb(252,205,229)",
|
| 210 |
+
"rgb(217,217,217)",
|
| 211 |
+
"rgb(188,128,189)",
|
| 212 |
+
"rgb(204,235,197)",
|
| 213 |
+
"rgb(255,237,111)",
|
| 214 |
+
]
|
| 215 |
+
|
| 216 |
+
Accent = [
|
| 217 |
+
"rgb(127,201,127)",
|
| 218 |
+
"rgb(190,174,212)",
|
| 219 |
+
"rgb(253,192,134)",
|
| 220 |
+
"rgb(255,255,153)",
|
| 221 |
+
"rgb(56,108,176)",
|
| 222 |
+
"rgb(240,2,127)",
|
| 223 |
+
"rgb(191,91,23)",
|
| 224 |
+
"rgb(102,102,102)",
|
| 225 |
+
]
|
| 226 |
+
|
| 227 |
+
|
| 228 |
+
Paired = [
|
| 229 |
+
"rgb(166,206,227)",
|
| 230 |
+
"rgb(31,120,180)",
|
| 231 |
+
"rgb(178,223,138)",
|
| 232 |
+
"rgb(51,160,44)",
|
| 233 |
+
"rgb(251,154,153)",
|
| 234 |
+
"rgb(227,26,28)",
|
| 235 |
+
"rgb(253,191,111)",
|
| 236 |
+
"rgb(255,127,0)",
|
| 237 |
+
"rgb(202,178,214)",
|
| 238 |
+
"rgb(106,61,154)",
|
| 239 |
+
"rgb(255,255,153)",
|
| 240 |
+
"rgb(177,89,40)",
|
| 241 |
+
]
|
| 242 |
+
|
| 243 |
+
|
| 244 |
+
Blues = [
|
| 245 |
+
"rgb(247,251,255)",
|
| 246 |
+
"rgb(222,235,247)",
|
| 247 |
+
"rgb(198,219,239)",
|
| 248 |
+
"rgb(158,202,225)",
|
| 249 |
+
"rgb(107,174,214)",
|
| 250 |
+
"rgb(66,146,198)",
|
| 251 |
+
"rgb(33,113,181)",
|
| 252 |
+
"rgb(8,81,156)",
|
| 253 |
+
"rgb(8,48,107)",
|
| 254 |
+
]
|
| 255 |
+
|
| 256 |
+
BuGn = [
|
| 257 |
+
"rgb(247,252,253)",
|
| 258 |
+
"rgb(229,245,249)",
|
| 259 |
+
"rgb(204,236,230)",
|
| 260 |
+
"rgb(153,216,201)",
|
| 261 |
+
"rgb(102,194,164)",
|
| 262 |
+
"rgb(65,174,118)",
|
| 263 |
+
"rgb(35,139,69)",
|
| 264 |
+
"rgb(0,109,44)",
|
| 265 |
+
"rgb(0,68,27)",
|
| 266 |
+
]
|
| 267 |
+
|
| 268 |
+
BuPu = [
|
| 269 |
+
"rgb(247,252,253)",
|
| 270 |
+
"rgb(224,236,244)",
|
| 271 |
+
"rgb(191,211,230)",
|
| 272 |
+
"rgb(158,188,218)",
|
| 273 |
+
"rgb(140,150,198)",
|
| 274 |
+
"rgb(140,107,177)",
|
| 275 |
+
"rgb(136,65,157)",
|
| 276 |
+
"rgb(129,15,124)",
|
| 277 |
+
"rgb(77,0,75)",
|
| 278 |
+
]
|
| 279 |
+
|
| 280 |
+
GnBu = [
|
| 281 |
+
"rgb(247,252,240)",
|
| 282 |
+
"rgb(224,243,219)",
|
| 283 |
+
"rgb(204,235,197)",
|
| 284 |
+
"rgb(168,221,181)",
|
| 285 |
+
"rgb(123,204,196)",
|
| 286 |
+
"rgb(78,179,211)",
|
| 287 |
+
"rgb(43,140,190)",
|
| 288 |
+
"rgb(8,104,172)",
|
| 289 |
+
"rgb(8,64,129)",
|
| 290 |
+
]
|
| 291 |
+
|
| 292 |
+
Greens = [
|
| 293 |
+
"rgb(247,252,245)",
|
| 294 |
+
"rgb(229,245,224)",
|
| 295 |
+
"rgb(199,233,192)",
|
| 296 |
+
"rgb(161,217,155)",
|
| 297 |
+
"rgb(116,196,118)",
|
| 298 |
+
"rgb(65,171,93)",
|
| 299 |
+
"rgb(35,139,69)",
|
| 300 |
+
"rgb(0,109,44)",
|
| 301 |
+
"rgb(0,68,27)",
|
| 302 |
+
]
|
| 303 |
+
|
| 304 |
+
Greys = [
|
| 305 |
+
"rgb(255,255,255)",
|
| 306 |
+
"rgb(240,240,240)",
|
| 307 |
+
"rgb(217,217,217)",
|
| 308 |
+
"rgb(189,189,189)",
|
| 309 |
+
"rgb(150,150,150)",
|
| 310 |
+
"rgb(115,115,115)",
|
| 311 |
+
"rgb(82,82,82)",
|
| 312 |
+
"rgb(37,37,37)",
|
| 313 |
+
"rgb(0,0,0)",
|
| 314 |
+
]
|
| 315 |
+
|
| 316 |
+
OrRd = [
|
| 317 |
+
"rgb(255,247,236)",
|
| 318 |
+
"rgb(254,232,200)",
|
| 319 |
+
"rgb(253,212,158)",
|
| 320 |
+
"rgb(253,187,132)",
|
| 321 |
+
"rgb(252,141,89)",
|
| 322 |
+
"rgb(239,101,72)",
|
| 323 |
+
"rgb(215,48,31)",
|
| 324 |
+
"rgb(179,0,0)",
|
| 325 |
+
"rgb(127,0,0)",
|
| 326 |
+
]
|
| 327 |
+
|
| 328 |
+
Oranges = [
|
| 329 |
+
"rgb(255,245,235)",
|
| 330 |
+
"rgb(254,230,206)",
|
| 331 |
+
"rgb(253,208,162)",
|
| 332 |
+
"rgb(253,174,107)",
|
| 333 |
+
"rgb(253,141,60)",
|
| 334 |
+
"rgb(241,105,19)",
|
| 335 |
+
"rgb(217,72,1)",
|
| 336 |
+
"rgb(166,54,3)",
|
| 337 |
+
"rgb(127,39,4)",
|
| 338 |
+
]
|
| 339 |
+
|
| 340 |
+
PuBu = [
|
| 341 |
+
"rgb(255,247,251)",
|
| 342 |
+
"rgb(236,231,242)",
|
| 343 |
+
"rgb(208,209,230)",
|
| 344 |
+
"rgb(166,189,219)",
|
| 345 |
+
"rgb(116,169,207)",
|
| 346 |
+
"rgb(54,144,192)",
|
| 347 |
+
"rgb(5,112,176)",
|
| 348 |
+
"rgb(4,90,141)",
|
| 349 |
+
"rgb(2,56,88)",
|
| 350 |
+
]
|
| 351 |
+
|
| 352 |
+
PuBuGn = [
|
| 353 |
+
"rgb(255,247,251)",
|
| 354 |
+
"rgb(236,226,240)",
|
| 355 |
+
"rgb(208,209,230)",
|
| 356 |
+
"rgb(166,189,219)",
|
| 357 |
+
"rgb(103,169,207)",
|
| 358 |
+
"rgb(54,144,192)",
|
| 359 |
+
"rgb(2,129,138)",
|
| 360 |
+
"rgb(1,108,89)",
|
| 361 |
+
"rgb(1,70,54)",
|
| 362 |
+
]
|
| 363 |
+
|
| 364 |
+
PuRd = [
|
| 365 |
+
"rgb(247,244,249)",
|
| 366 |
+
"rgb(231,225,239)",
|
| 367 |
+
"rgb(212,185,218)",
|
| 368 |
+
"rgb(201,148,199)",
|
| 369 |
+
"rgb(223,101,176)",
|
| 370 |
+
"rgb(231,41,138)",
|
| 371 |
+
"rgb(206,18,86)",
|
| 372 |
+
"rgb(152,0,67)",
|
| 373 |
+
"rgb(103,0,31)",
|
| 374 |
+
]
|
| 375 |
+
|
| 376 |
+
Purples = [
|
| 377 |
+
"rgb(252,251,253)",
|
| 378 |
+
"rgb(239,237,245)",
|
| 379 |
+
"rgb(218,218,235)",
|
| 380 |
+
"rgb(188,189,220)",
|
| 381 |
+
"rgb(158,154,200)",
|
| 382 |
+
"rgb(128,125,186)",
|
| 383 |
+
"rgb(106,81,163)",
|
| 384 |
+
"rgb(84,39,143)",
|
| 385 |
+
"rgb(63,0,125)",
|
| 386 |
+
]
|
| 387 |
+
|
| 388 |
+
RdPu = [
|
| 389 |
+
"rgb(255,247,243)",
|
| 390 |
+
"rgb(253,224,221)",
|
| 391 |
+
"rgb(252,197,192)",
|
| 392 |
+
"rgb(250,159,181)",
|
| 393 |
+
"rgb(247,104,161)",
|
| 394 |
+
"rgb(221,52,151)",
|
| 395 |
+
"rgb(174,1,126)",
|
| 396 |
+
"rgb(122,1,119)",
|
| 397 |
+
"rgb(73,0,106)",
|
| 398 |
+
]
|
| 399 |
+
|
| 400 |
+
Reds = [
|
| 401 |
+
"rgb(255,245,240)",
|
| 402 |
+
"rgb(254,224,210)",
|
| 403 |
+
"rgb(252,187,161)",
|
| 404 |
+
"rgb(252,146,114)",
|
| 405 |
+
"rgb(251,106,74)",
|
| 406 |
+
"rgb(239,59,44)",
|
| 407 |
+
"rgb(203,24,29)",
|
| 408 |
+
"rgb(165,15,21)",
|
| 409 |
+
"rgb(103,0,13)",
|
| 410 |
+
]
|
| 411 |
+
|
| 412 |
+
YlGn = [
|
| 413 |
+
"rgb(255,255,229)",
|
| 414 |
+
"rgb(247,252,185)",
|
| 415 |
+
"rgb(217,240,163)",
|
| 416 |
+
"rgb(173,221,142)",
|
| 417 |
+
"rgb(120,198,121)",
|
| 418 |
+
"rgb(65,171,93)",
|
| 419 |
+
"rgb(35,132,67)",
|
| 420 |
+
"rgb(0,104,55)",
|
| 421 |
+
"rgb(0,69,41)",
|
| 422 |
+
]
|
| 423 |
+
|
| 424 |
+
YlGnBu = [
|
| 425 |
+
"rgb(255,255,217)",
|
| 426 |
+
"rgb(237,248,177)",
|
| 427 |
+
"rgb(199,233,180)",
|
| 428 |
+
"rgb(127,205,187)",
|
| 429 |
+
"rgb(65,182,196)",
|
| 430 |
+
"rgb(29,145,192)",
|
| 431 |
+
"rgb(34,94,168)",
|
| 432 |
+
"rgb(37,52,148)",
|
| 433 |
+
"rgb(8,29,88)",
|
| 434 |
+
]
|
| 435 |
+
|
| 436 |
+
YlOrBr = [
|
| 437 |
+
"rgb(255,255,229)",
|
| 438 |
+
"rgb(255,247,188)",
|
| 439 |
+
"rgb(254,227,145)",
|
| 440 |
+
"rgb(254,196,79)",
|
| 441 |
+
"rgb(254,153,41)",
|
| 442 |
+
"rgb(236,112,20)",
|
| 443 |
+
"rgb(204,76,2)",
|
| 444 |
+
"rgb(153,52,4)",
|
| 445 |
+
"rgb(102,37,6)",
|
| 446 |
+
]
|
| 447 |
+
|
| 448 |
+
YlOrRd = [
|
| 449 |
+
"rgb(255,255,204)",
|
| 450 |
+
"rgb(255,237,160)",
|
| 451 |
+
"rgb(254,217,118)",
|
| 452 |
+
"rgb(254,178,76)",
|
| 453 |
+
"rgb(253,141,60)",
|
| 454 |
+
"rgb(252,78,42)",
|
| 455 |
+
"rgb(227,26,28)",
|
| 456 |
+
"rgb(189,0,38)",
|
| 457 |
+
"rgb(128,0,38)",
|
| 458 |
+
]
|
| 459 |
+
|
| 460 |
+
Accent_r = Accent[::-1]
|
| 461 |
+
Blues_r = Blues[::-1]
|
| 462 |
+
BrBG_r = BrBG[::-1]
|
| 463 |
+
BuGn_r = BuGn[::-1]
|
| 464 |
+
BuPu_r = BuPu[::-1]
|
| 465 |
+
Dark2_r = Dark2[::-1]
|
| 466 |
+
GnBu_r = GnBu[::-1]
|
| 467 |
+
Greens_r = Greens[::-1]
|
| 468 |
+
Greys_r = Greys[::-1]
|
| 469 |
+
OrRd_r = OrRd[::-1]
|
| 470 |
+
Oranges_r = Oranges[::-1]
|
| 471 |
+
PRGn_r = PRGn[::-1]
|
| 472 |
+
Paired_r = Paired[::-1]
|
| 473 |
+
Pastel1_r = Pastel1[::-1]
|
| 474 |
+
Pastel2_r = Pastel2[::-1]
|
| 475 |
+
PiYG_r = PiYG[::-1]
|
| 476 |
+
PuBu_r = PuBu[::-1]
|
| 477 |
+
PuBuGn_r = PuBuGn[::-1]
|
| 478 |
+
PuOr_r = PuOr[::-1]
|
| 479 |
+
PuRd_r = PuRd[::-1]
|
| 480 |
+
Purples_r = Purples[::-1]
|
| 481 |
+
RdBu_r = RdBu[::-1]
|
| 482 |
+
RdGy_r = RdGy[::-1]
|
| 483 |
+
RdPu_r = RdPu[::-1]
|
| 484 |
+
RdYlBu_r = RdYlBu[::-1]
|
| 485 |
+
RdYlGn_r = RdYlGn[::-1]
|
| 486 |
+
Reds_r = Reds[::-1]
|
| 487 |
+
Set1_r = Set1[::-1]
|
| 488 |
+
Set2_r = Set2[::-1]
|
| 489 |
+
Set3_r = Set3[::-1]
|
| 490 |
+
Spectral_r = Spectral[::-1]
|
| 491 |
+
YlGn_r = YlGn[::-1]
|
| 492 |
+
YlGnBu_r = YlGnBu[::-1]
|
| 493 |
+
YlOrBr_r = YlOrBr[::-1]
|
| 494 |
+
YlOrRd_r = YlOrRd[::-1]
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/cyclical.py
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Cyclical color scales are appropriate for continuous data that has a natural cyclical \
|
| 3 |
+
structure, such as temporal data (hour of day, day of week, day of year, seasons) or
|
| 4 |
+
complex numbers or other phase data.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from ._swatches import _swatches, _swatches_continuous, _swatches_cyclical
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def swatches(template=None):
|
| 11 |
+
return _swatches(__name__, globals(), template)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
swatches.__doc__ = _swatches.__doc__
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def swatches_continuous(template=None):
|
| 18 |
+
return _swatches_continuous(__name__, globals(), template)
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
swatches_continuous.__doc__ = _swatches_continuous.__doc__
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def swatches_cyclical(template=None):
|
| 25 |
+
return _swatches_cyclical(__name__, globals(), template)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
swatches_cyclical.__doc__ = _swatches_cyclical.__doc__
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
Twilight = [
|
| 32 |
+
"#e2d9e2",
|
| 33 |
+
"#9ebbc9",
|
| 34 |
+
"#6785be",
|
| 35 |
+
"#5e43a5",
|
| 36 |
+
"#421257",
|
| 37 |
+
"#471340",
|
| 38 |
+
"#8e2c50",
|
| 39 |
+
"#ba6657",
|
| 40 |
+
"#ceac94",
|
| 41 |
+
"#e2d9e2",
|
| 42 |
+
]
|
| 43 |
+
IceFire = [
|
| 44 |
+
"#000000",
|
| 45 |
+
"#001f4d",
|
| 46 |
+
"#003786",
|
| 47 |
+
"#0e58a8",
|
| 48 |
+
"#217eb8",
|
| 49 |
+
"#30a4ca",
|
| 50 |
+
"#54c8df",
|
| 51 |
+
"#9be4ef",
|
| 52 |
+
"#e1e9d1",
|
| 53 |
+
"#f3d573",
|
| 54 |
+
"#e7b000",
|
| 55 |
+
"#da8200",
|
| 56 |
+
"#c65400",
|
| 57 |
+
"#ac2301",
|
| 58 |
+
"#820000",
|
| 59 |
+
"#4c0000",
|
| 60 |
+
"#000000",
|
| 61 |
+
]
|
| 62 |
+
Edge = [
|
| 63 |
+
"#313131",
|
| 64 |
+
"#3d019d",
|
| 65 |
+
"#3810dc",
|
| 66 |
+
"#2d47f9",
|
| 67 |
+
"#2593ff",
|
| 68 |
+
"#2adef6",
|
| 69 |
+
"#60fdfa",
|
| 70 |
+
"#aefdff",
|
| 71 |
+
"#f3f3f1",
|
| 72 |
+
"#fffda9",
|
| 73 |
+
"#fafd5b",
|
| 74 |
+
"#f7da29",
|
| 75 |
+
"#ff8e25",
|
| 76 |
+
"#f8432d",
|
| 77 |
+
"#d90d39",
|
| 78 |
+
"#97023d",
|
| 79 |
+
"#313131",
|
| 80 |
+
]
|
| 81 |
+
Phase = [
|
| 82 |
+
"rgb(167, 119, 12)",
|
| 83 |
+
"rgb(197, 96, 51)",
|
| 84 |
+
"rgb(217, 67, 96)",
|
| 85 |
+
"rgb(221, 38, 163)",
|
| 86 |
+
"rgb(196, 59, 224)",
|
| 87 |
+
"rgb(153, 97, 244)",
|
| 88 |
+
"rgb(95, 127, 228)",
|
| 89 |
+
"rgb(40, 144, 183)",
|
| 90 |
+
"rgb(15, 151, 136)",
|
| 91 |
+
"rgb(39, 153, 79)",
|
| 92 |
+
"rgb(119, 141, 17)",
|
| 93 |
+
"rgb(167, 119, 12)",
|
| 94 |
+
]
|
| 95 |
+
HSV = [
|
| 96 |
+
"#ff0000",
|
| 97 |
+
"#ffa700",
|
| 98 |
+
"#afff00",
|
| 99 |
+
"#08ff00",
|
| 100 |
+
"#00ff9f",
|
| 101 |
+
"#00b7ff",
|
| 102 |
+
"#0010ff",
|
| 103 |
+
"#9700ff",
|
| 104 |
+
"#ff00bf",
|
| 105 |
+
"#ff0000",
|
| 106 |
+
]
|
| 107 |
+
mrybm = [
|
| 108 |
+
"#f884f7",
|
| 109 |
+
"#f968c4",
|
| 110 |
+
"#ea4388",
|
| 111 |
+
"#cf244b",
|
| 112 |
+
"#b51a15",
|
| 113 |
+
"#bd4304",
|
| 114 |
+
"#cc6904",
|
| 115 |
+
"#d58f04",
|
| 116 |
+
"#cfaa27",
|
| 117 |
+
"#a19f62",
|
| 118 |
+
"#588a93",
|
| 119 |
+
"#2269c4",
|
| 120 |
+
"#3e3ef0",
|
| 121 |
+
"#6b4ef9",
|
| 122 |
+
"#956bfa",
|
| 123 |
+
"#cd7dfe",
|
| 124 |
+
"#f884f7",
|
| 125 |
+
]
|
| 126 |
+
mygbm = [
|
| 127 |
+
"#ef55f1",
|
| 128 |
+
"#fb84ce",
|
| 129 |
+
"#fbafa1",
|
| 130 |
+
"#fcd471",
|
| 131 |
+
"#f0ed35",
|
| 132 |
+
"#c6e516",
|
| 133 |
+
"#96d310",
|
| 134 |
+
"#61c10b",
|
| 135 |
+
"#31ac28",
|
| 136 |
+
"#439064",
|
| 137 |
+
"#3d719a",
|
| 138 |
+
"#284ec8",
|
| 139 |
+
"#2e21ea",
|
| 140 |
+
"#6324f5",
|
| 141 |
+
"#9139fa",
|
| 142 |
+
"#c543fa",
|
| 143 |
+
"#ef55f1",
|
| 144 |
+
]
|
| 145 |
+
|
| 146 |
+
Edge_r = Edge[::-1]
|
| 147 |
+
HSV_r = HSV[::-1]
|
| 148 |
+
IceFire_r = IceFire[::-1]
|
| 149 |
+
Phase_r = Phase[::-1]
|
| 150 |
+
Twilight_r = Twilight[::-1]
|
| 151 |
+
mrybm_r = mrybm[::-1]
|
| 152 |
+
mygbm_r = mygbm[::-1]
|
| 153 |
+
|
| 154 |
+
__all__ = [
|
| 155 |
+
"swatches",
|
| 156 |
+
"swatches_cyclical",
|
| 157 |
+
]
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/diverging.py
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Diverging color scales are appropriate for continuous data that has a natural midpoint \
|
| 3 |
+
other otherwise informative special value, such as 0 altitude, or the boiling point
|
| 4 |
+
of a liquid. The color scales in this module are \
|
| 5 |
+
mostly meant to be passed in as the `color_continuous_scale` argument to various \
|
| 6 |
+
functions, and to be used with the `color_continuous_midpoint` argument.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from .colorbrewer import ( # noqa: F401
|
| 10 |
+
BrBG,
|
| 11 |
+
PRGn,
|
| 12 |
+
PiYG,
|
| 13 |
+
PuOr,
|
| 14 |
+
RdBu,
|
| 15 |
+
RdGy,
|
| 16 |
+
RdYlBu,
|
| 17 |
+
RdYlGn,
|
| 18 |
+
Spectral,
|
| 19 |
+
BrBG_r,
|
| 20 |
+
PRGn_r,
|
| 21 |
+
PiYG_r,
|
| 22 |
+
PuOr_r,
|
| 23 |
+
RdBu_r,
|
| 24 |
+
RdGy_r,
|
| 25 |
+
RdYlBu_r,
|
| 26 |
+
RdYlGn_r,
|
| 27 |
+
Spectral_r,
|
| 28 |
+
)
|
| 29 |
+
from .cmocean import ( # noqa: F401
|
| 30 |
+
balance,
|
| 31 |
+
delta,
|
| 32 |
+
curl,
|
| 33 |
+
oxy,
|
| 34 |
+
balance_r,
|
| 35 |
+
delta_r,
|
| 36 |
+
curl_r,
|
| 37 |
+
oxy_r,
|
| 38 |
+
)
|
| 39 |
+
from .carto import ( # noqa: F401
|
| 40 |
+
Armyrose,
|
| 41 |
+
Fall,
|
| 42 |
+
Geyser,
|
| 43 |
+
Temps,
|
| 44 |
+
Tealrose,
|
| 45 |
+
Tropic,
|
| 46 |
+
Earth,
|
| 47 |
+
Armyrose_r,
|
| 48 |
+
Fall_r,
|
| 49 |
+
Geyser_r,
|
| 50 |
+
Temps_r,
|
| 51 |
+
Tealrose_r,
|
| 52 |
+
Tropic_r,
|
| 53 |
+
Earth_r,
|
| 54 |
+
)
|
| 55 |
+
|
| 56 |
+
from .plotlyjs import Picnic, Portland, Picnic_r, Portland_r # noqa: F401
|
| 57 |
+
|
| 58 |
+
from ._swatches import _swatches, _swatches_continuous
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def swatches(template=None):
|
| 62 |
+
return _swatches(__name__, globals(), template)
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
swatches.__doc__ = _swatches.__doc__
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def swatches_continuous(template=None):
|
| 69 |
+
return _swatches_continuous(__name__, globals(), template)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
swatches_continuous.__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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copied from
|
| 2 |
+
# https://github.com/plotly/plotly.js/blob/master/src/components/colorscale/scales.js
|
| 3 |
+
|
| 4 |
+
# NOTE: these differ slightly from plotly.colors.PLOTLY_SCALES from Plotly.js because
|
| 5 |
+
# those ones don't have perfectly evenly spaced steps ...
|
| 6 |
+
# not sure when this skew was introduced, possibly as early as Plotly.py v4.0
|
| 7 |
+
|
| 8 |
+
Blackbody = [
|
| 9 |
+
"rgb(0,0,0)",
|
| 10 |
+
"rgb(230,0,0)",
|
| 11 |
+
"rgb(230,210,0)",
|
| 12 |
+
"rgb(255,255,255)",
|
| 13 |
+
"rgb(160,200,255)",
|
| 14 |
+
]
|
| 15 |
+
Bluered = ["rgb(0,0,255)", "rgb(255,0,0)"]
|
| 16 |
+
Blues = [
|
| 17 |
+
"rgb(5,10,172)",
|
| 18 |
+
"rgb(40,60,190)",
|
| 19 |
+
"rgb(70,100,245)",
|
| 20 |
+
"rgb(90,120,245)",
|
| 21 |
+
"rgb(106,137,247)",
|
| 22 |
+
"rgb(220,220,220)",
|
| 23 |
+
]
|
| 24 |
+
Cividis = [
|
| 25 |
+
"rgb(0,32,76)",
|
| 26 |
+
"rgb(0,42,102)",
|
| 27 |
+
"rgb(0,52,110)",
|
| 28 |
+
"rgb(39,63,108)",
|
| 29 |
+
"rgb(60,74,107)",
|
| 30 |
+
"rgb(76,85,107)",
|
| 31 |
+
"rgb(91,95,109)",
|
| 32 |
+
"rgb(104,106,112)",
|
| 33 |
+
"rgb(117,117,117)",
|
| 34 |
+
"rgb(131,129,120)",
|
| 35 |
+
"rgb(146,140,120)",
|
| 36 |
+
"rgb(161,152,118)",
|
| 37 |
+
"rgb(176,165,114)",
|
| 38 |
+
"rgb(192,177,109)",
|
| 39 |
+
"rgb(209,191,102)",
|
| 40 |
+
"rgb(225,204,92)",
|
| 41 |
+
"rgb(243,219,79)",
|
| 42 |
+
"rgb(255,233,69)",
|
| 43 |
+
]
|
| 44 |
+
Earth = [
|
| 45 |
+
"rgb(0,0,130)",
|
| 46 |
+
"rgb(0,180,180)",
|
| 47 |
+
"rgb(40,210,40)",
|
| 48 |
+
"rgb(230,230,50)",
|
| 49 |
+
"rgb(120,70,20)",
|
| 50 |
+
"rgb(255,255,255)",
|
| 51 |
+
]
|
| 52 |
+
Electric = [
|
| 53 |
+
"rgb(0,0,0)",
|
| 54 |
+
"rgb(30,0,100)",
|
| 55 |
+
"rgb(120,0,100)",
|
| 56 |
+
"rgb(160,90,0)",
|
| 57 |
+
"rgb(230,200,0)",
|
| 58 |
+
"rgb(255,250,220)",
|
| 59 |
+
]
|
| 60 |
+
Greens = [
|
| 61 |
+
"rgb(0,68,27)",
|
| 62 |
+
"rgb(0,109,44)",
|
| 63 |
+
"rgb(35,139,69)",
|
| 64 |
+
"rgb(65,171,93)",
|
| 65 |
+
"rgb(116,196,118)",
|
| 66 |
+
"rgb(161,217,155)",
|
| 67 |
+
"rgb(199,233,192)",
|
| 68 |
+
"rgb(229,245,224)",
|
| 69 |
+
"rgb(247,252,245)",
|
| 70 |
+
]
|
| 71 |
+
Greys = ["rgb(0,0,0)", "rgb(255,255,255)"]
|
| 72 |
+
Hot = ["rgb(0,0,0)", "rgb(230,0,0)", "rgb(255,210,0)", "rgb(255,255,255)"]
|
| 73 |
+
Jet = [
|
| 74 |
+
"rgb(0,0,131)",
|
| 75 |
+
"rgb(0,60,170)",
|
| 76 |
+
"rgb(5,255,255)",
|
| 77 |
+
"rgb(255,255,0)",
|
| 78 |
+
"rgb(250,0,0)",
|
| 79 |
+
"rgb(128,0,0)",
|
| 80 |
+
]
|
| 81 |
+
Picnic = [
|
| 82 |
+
"rgb(0,0,255)",
|
| 83 |
+
"rgb(51,153,255)",
|
| 84 |
+
"rgb(102,204,255)",
|
| 85 |
+
"rgb(153,204,255)",
|
| 86 |
+
"rgb(204,204,255)",
|
| 87 |
+
"rgb(255,255,255)",
|
| 88 |
+
"rgb(255,204,255)",
|
| 89 |
+
"rgb(255,153,255)",
|
| 90 |
+
"rgb(255,102,204)",
|
| 91 |
+
"rgb(255,102,102)",
|
| 92 |
+
"rgb(255,0,0)",
|
| 93 |
+
]
|
| 94 |
+
Portland = [
|
| 95 |
+
"rgb(12,51,131)",
|
| 96 |
+
"rgb(10,136,186)",
|
| 97 |
+
"rgb(242,211,56)",
|
| 98 |
+
"rgb(242,143,56)",
|
| 99 |
+
"rgb(217,30,30)",
|
| 100 |
+
]
|
| 101 |
+
Rainbow = [
|
| 102 |
+
"rgb(150,0,90)",
|
| 103 |
+
"rgb(0,0,200)",
|
| 104 |
+
"rgb(0,25,255)",
|
| 105 |
+
"rgb(0,152,255)",
|
| 106 |
+
"rgb(44,255,150)",
|
| 107 |
+
"rgb(151,255,0)",
|
| 108 |
+
"rgb(255,234,0)",
|
| 109 |
+
"rgb(255,111,0)",
|
| 110 |
+
"rgb(255,0,0)",
|
| 111 |
+
]
|
| 112 |
+
RdBu = [
|
| 113 |
+
"rgb(5,10,172)",
|
| 114 |
+
"rgb(106,137,247)",
|
| 115 |
+
"rgb(190,190,190)",
|
| 116 |
+
"rgb(220,170,132)",
|
| 117 |
+
"rgb(230,145,90)",
|
| 118 |
+
"rgb(178,10,28)",
|
| 119 |
+
]
|
| 120 |
+
Reds = ["rgb(220,220,220)", "rgb(245,195,157)", "rgb(245,160,105)", "rgb(178,10,28)"]
|
| 121 |
+
Viridis = [
|
| 122 |
+
"#440154",
|
| 123 |
+
"#48186a",
|
| 124 |
+
"#472d7b",
|
| 125 |
+
"#424086",
|
| 126 |
+
"#3b528b",
|
| 127 |
+
"#33638d",
|
| 128 |
+
"#2c728e",
|
| 129 |
+
"#26828e",
|
| 130 |
+
"#21918c",
|
| 131 |
+
"#1fa088",
|
| 132 |
+
"#28ae80",
|
| 133 |
+
"#3fbc73",
|
| 134 |
+
"#5ec962",
|
| 135 |
+
"#84d44b",
|
| 136 |
+
"#addc30",
|
| 137 |
+
"#d8e219",
|
| 138 |
+
"#fde725",
|
| 139 |
+
]
|
| 140 |
+
YlGnBu = [
|
| 141 |
+
"rgb(8,29,88)",
|
| 142 |
+
"rgb(37,52,148)",
|
| 143 |
+
"rgb(34,94,168)",
|
| 144 |
+
"rgb(29,145,192)",
|
| 145 |
+
"rgb(65,182,196)",
|
| 146 |
+
"rgb(127,205,187)",
|
| 147 |
+
"rgb(199,233,180)",
|
| 148 |
+
"rgb(237,248,217)",
|
| 149 |
+
"rgb(255,255,217)",
|
| 150 |
+
]
|
| 151 |
+
YlOrRd = [
|
| 152 |
+
"rgb(128,0,38)",
|
| 153 |
+
"rgb(189,0,38)",
|
| 154 |
+
"rgb(227,26,28)",
|
| 155 |
+
"rgb(252,78,42)",
|
| 156 |
+
"rgb(253,141,60)",
|
| 157 |
+
"rgb(254,178,76)",
|
| 158 |
+
"rgb(254,217,118)",
|
| 159 |
+
"rgb(255,237,160)",
|
| 160 |
+
"rgb(255,255,204)",
|
| 161 |
+
]
|
| 162 |
+
|
| 163 |
+
Blackbody_r = Blackbody[::-1]
|
| 164 |
+
Bluered_r = Bluered[::-1]
|
| 165 |
+
Blues_r = Blues[::-1]
|
| 166 |
+
Cividis_r = Cividis[::-1]
|
| 167 |
+
Earth_r = Earth[::-1]
|
| 168 |
+
Electric_r = Electric[::-1]
|
| 169 |
+
Greens_r = Greens[::-1]
|
| 170 |
+
Greys_r = Greys[::-1]
|
| 171 |
+
Hot_r = Hot[::-1]
|
| 172 |
+
Jet_r = Jet[::-1]
|
| 173 |
+
Picnic_r = Picnic[::-1]
|
| 174 |
+
Portland_r = Portland[::-1]
|
| 175 |
+
Rainbow_r = Rainbow[::-1]
|
| 176 |
+
RdBu_r = RdBu[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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Qualitative color sequences are appropriate for data that has no natural ordering, such \
|
| 3 |
+
as categories, colors, names, countries etc. The color sequences in this module are \
|
| 4 |
+
mostly meant to be passed in as the `color_discrete_sequence` argument to various functions.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from ._swatches import _swatches
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def swatches(template=None):
|
| 11 |
+
return _swatches(__name__, globals(), template)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
swatches.__doc__ = _swatches.__doc__
|
| 15 |
+
|
| 16 |
+
Plotly = [
|
| 17 |
+
"#636EFA",
|
| 18 |
+
"#EF553B",
|
| 19 |
+
"#00CC96",
|
| 20 |
+
"#AB63FA",
|
| 21 |
+
"#FFA15A",
|
| 22 |
+
"#19D3F3",
|
| 23 |
+
"#FF6692",
|
| 24 |
+
"#B6E880",
|
| 25 |
+
"#FF97FF",
|
| 26 |
+
"#FECB52",
|
| 27 |
+
]
|
| 28 |
+
|
| 29 |
+
D3 = [
|
| 30 |
+
"#1F77B4",
|
| 31 |
+
"#FF7F0E",
|
| 32 |
+
"#2CA02C",
|
| 33 |
+
"#D62728",
|
| 34 |
+
"#9467BD",
|
| 35 |
+
"#8C564B",
|
| 36 |
+
"#E377C2",
|
| 37 |
+
"#7F7F7F",
|
| 38 |
+
"#BCBD22",
|
| 39 |
+
"#17BECF",
|
| 40 |
+
]
|
| 41 |
+
G10 = [
|
| 42 |
+
"#3366CC",
|
| 43 |
+
"#DC3912",
|
| 44 |
+
"#FF9900",
|
| 45 |
+
"#109618",
|
| 46 |
+
"#990099",
|
| 47 |
+
"#0099C6",
|
| 48 |
+
"#DD4477",
|
| 49 |
+
"#66AA00",
|
| 50 |
+
"#B82E2E",
|
| 51 |
+
"#316395",
|
| 52 |
+
]
|
| 53 |
+
T10 = [
|
| 54 |
+
"#4C78A8",
|
| 55 |
+
"#F58518",
|
| 56 |
+
"#E45756",
|
| 57 |
+
"#72B7B2",
|
| 58 |
+
"#54A24B",
|
| 59 |
+
"#EECA3B",
|
| 60 |
+
"#B279A2",
|
| 61 |
+
"#FF9DA6",
|
| 62 |
+
"#9D755D",
|
| 63 |
+
"#BAB0AC",
|
| 64 |
+
]
|
| 65 |
+
Alphabet = [
|
| 66 |
+
"#AA0DFE",
|
| 67 |
+
"#3283FE",
|
| 68 |
+
"#85660D",
|
| 69 |
+
"#782AB6",
|
| 70 |
+
"#565656",
|
| 71 |
+
"#1C8356",
|
| 72 |
+
"#16FF32",
|
| 73 |
+
"#F7E1A0",
|
| 74 |
+
"#E2E2E2",
|
| 75 |
+
"#1CBE4F",
|
| 76 |
+
"#C4451C",
|
| 77 |
+
"#DEA0FD",
|
| 78 |
+
"#FE00FA",
|
| 79 |
+
"#325A9B",
|
| 80 |
+
"#FEAF16",
|
| 81 |
+
"#F8A19F",
|
| 82 |
+
"#90AD1C",
|
| 83 |
+
"#F6222E",
|
| 84 |
+
"#1CFFCE",
|
| 85 |
+
"#2ED9FF",
|
| 86 |
+
"#B10DA1",
|
| 87 |
+
"#C075A6",
|
| 88 |
+
"#FC1CBF",
|
| 89 |
+
"#B00068",
|
| 90 |
+
"#FBE426",
|
| 91 |
+
"#FA0087",
|
| 92 |
+
]
|
| 93 |
+
Dark24 = [
|
| 94 |
+
"#2E91E5",
|
| 95 |
+
"#E15F99",
|
| 96 |
+
"#1CA71C",
|
| 97 |
+
"#FB0D0D",
|
| 98 |
+
"#DA16FF",
|
| 99 |
+
"#222A2A",
|
| 100 |
+
"#B68100",
|
| 101 |
+
"#750D86",
|
| 102 |
+
"#EB663B",
|
| 103 |
+
"#511CFB",
|
| 104 |
+
"#00A08B",
|
| 105 |
+
"#FB00D1",
|
| 106 |
+
"#FC0080",
|
| 107 |
+
"#B2828D",
|
| 108 |
+
"#6C7C32",
|
| 109 |
+
"#778AAE",
|
| 110 |
+
"#862A16",
|
| 111 |
+
"#A777F1",
|
| 112 |
+
"#620042",
|
| 113 |
+
"#1616A7",
|
| 114 |
+
"#DA60CA",
|
| 115 |
+
"#6C4516",
|
| 116 |
+
"#0D2A63",
|
| 117 |
+
"#AF0038",
|
| 118 |
+
]
|
| 119 |
+
Light24 = [
|
| 120 |
+
"#FD3216",
|
| 121 |
+
"#00FE35",
|
| 122 |
+
"#6A76FC",
|
| 123 |
+
"#FED4C4",
|
| 124 |
+
"#FE00CE",
|
| 125 |
+
"#0DF9FF",
|
| 126 |
+
"#F6F926",
|
| 127 |
+
"#FF9616",
|
| 128 |
+
"#479B55",
|
| 129 |
+
"#EEA6FB",
|
| 130 |
+
"#DC587D",
|
| 131 |
+
"#D626FF",
|
| 132 |
+
"#6E899C",
|
| 133 |
+
"#00B5F7",
|
| 134 |
+
"#B68E00",
|
| 135 |
+
"#C9FBE5",
|
| 136 |
+
"#FF0092",
|
| 137 |
+
"#22FFA7",
|
| 138 |
+
"#E3EE9E",
|
| 139 |
+
"#86CE00",
|
| 140 |
+
"#BC7196",
|
| 141 |
+
"#7E7DCD",
|
| 142 |
+
"#FC6955",
|
| 143 |
+
"#E48F72",
|
| 144 |
+
]
|
| 145 |
+
|
| 146 |
+
Alphabet_r = Alphabet[::-1]
|
| 147 |
+
D3_r = D3[::-1]
|
| 148 |
+
Dark24_r = Dark24[::-1]
|
| 149 |
+
G10_r = G10[::-1]
|
| 150 |
+
Light24_r = Light24[::-1]
|
| 151 |
+
Plotly_r = Plotly[::-1]
|
| 152 |
+
T10_r = T10[::-1]
|
| 153 |
+
|
| 154 |
+
from .colorbrewer import ( # noqa: E402 F401
|
| 155 |
+
Set1,
|
| 156 |
+
Pastel1,
|
| 157 |
+
Dark2,
|
| 158 |
+
Set2,
|
| 159 |
+
Pastel2,
|
| 160 |
+
Set3,
|
| 161 |
+
Set1_r,
|
| 162 |
+
Pastel1_r,
|
| 163 |
+
Dark2_r,
|
| 164 |
+
Set2_r,
|
| 165 |
+
Pastel2_r,
|
| 166 |
+
Set3_r,
|
| 167 |
+
)
|
| 168 |
+
from .carto import ( # noqa: E402 F401
|
| 169 |
+
Antique,
|
| 170 |
+
Bold,
|
| 171 |
+
Pastel,
|
| 172 |
+
Prism,
|
| 173 |
+
Safe,
|
| 174 |
+
Vivid,
|
| 175 |
+
Antique_r,
|
| 176 |
+
Bold_r,
|
| 177 |
+
Pastel_r,
|
| 178 |
+
Prism_r,
|
| 179 |
+
Safe_r,
|
| 180 |
+
Vivid_r,
|
| 181 |
+
)
|
| 182 |
+
|
| 183 |
+
|
| 184 |
+
__all__ = ["swatches"]
|
.venv_haddock/lib/python3.12/site-packages/_plotly_utils/colors/sequential.py
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Sequential color scales are appropriate for most continuous data, but in some cases it \
|
| 3 |
+
can be helpful to use a `plotly.colors.diverging` or \
|
| 4 |
+
`plotly.colors.cyclical` scale instead. The color scales in this module are \
|
| 5 |
+
mostly meant to be passed in as the `color_continuous_scale` argument to various functions.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
from ._swatches import _swatches, _swatches_continuous
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def swatches(template=None):
|
| 12 |
+
return _swatches(__name__, globals(), template)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
swatches.__doc__ = _swatches.__doc__
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def swatches_continuous(template=None):
|
| 19 |
+
return _swatches_continuous(__name__, globals(), template)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
swatches_continuous.__doc__ = _swatches_continuous.__doc__
|
| 23 |
+
|
| 24 |
+
Plotly3 = [
|
| 25 |
+
"#0508b8",
|
| 26 |
+
"#1910d8",
|
| 27 |
+
"#3c19f0",
|
| 28 |
+
"#6b1cfb",
|
| 29 |
+
"#981cfd",
|
| 30 |
+
"#bf1cfd",
|
| 31 |
+
"#dd2bfd",
|
| 32 |
+
"#f246fe",
|
| 33 |
+
"#fc67fd",
|
| 34 |
+
"#fe88fc",
|
| 35 |
+
"#fea5fd",
|
| 36 |
+
"#febefe",
|
| 37 |
+
"#fec3fe",
|
| 38 |
+
]
|
| 39 |
+
|
| 40 |
+
Viridis = [
|
| 41 |
+
"#440154",
|
| 42 |
+
"#482878",
|
| 43 |
+
"#3e4989",
|
| 44 |
+
"#31688e",
|
| 45 |
+
"#26828e",
|
| 46 |
+
"#1f9e89",
|
| 47 |
+
"#35b779",
|
| 48 |
+
"#6ece58",
|
| 49 |
+
"#b5de2b",
|
| 50 |
+
"#fde725",
|
| 51 |
+
]
|
| 52 |
+
Cividis = [
|
| 53 |
+
"#00224e",
|
| 54 |
+
"#123570",
|
| 55 |
+
"#3b496c",
|
| 56 |
+
"#575d6d",
|
| 57 |
+
"#707173",
|
| 58 |
+
"#8a8678",
|
| 59 |
+
"#a59c74",
|
| 60 |
+
"#c3b369",
|
| 61 |
+
"#e1cc55",
|
| 62 |
+
"#fee838",
|
| 63 |
+
]
|
| 64 |
+
|
| 65 |
+
Inferno = [
|
| 66 |
+
"#000004",
|
| 67 |
+
"#1b0c41",
|
| 68 |
+
"#4a0c6b",
|
| 69 |
+
"#781c6d",
|
| 70 |
+
"#a52c60",
|
| 71 |
+
"#cf4446",
|
| 72 |
+
"#ed6925",
|
| 73 |
+
"#fb9b06",
|
| 74 |
+
"#f7d13d",
|
| 75 |
+
"#fcffa4",
|
| 76 |
+
]
|
| 77 |
+
Magma = [
|
| 78 |
+
"#000004",
|
| 79 |
+
"#180f3d",
|
| 80 |
+
"#440f76",
|
| 81 |
+
"#721f81",
|
| 82 |
+
"#9e2f7f",
|
| 83 |
+
"#cd4071",
|
| 84 |
+
"#f1605d",
|
| 85 |
+
"#fd9668",
|
| 86 |
+
"#feca8d",
|
| 87 |
+
"#fcfdbf",
|
| 88 |
+
]
|
| 89 |
+
Plasma = [
|
| 90 |
+
"#0d0887",
|
| 91 |
+
"#46039f",
|
| 92 |
+
"#7201a8",
|
| 93 |
+
"#9c179e",
|
| 94 |
+
"#bd3786",
|
| 95 |
+
"#d8576b",
|
| 96 |
+
"#ed7953",
|
| 97 |
+
"#fb9f3a",
|
| 98 |
+
"#fdca26",
|
| 99 |
+
"#f0f921",
|
| 100 |
+
]
|
| 101 |
+
Turbo = [
|
| 102 |
+
"#30123b",
|
| 103 |
+
"#4145ab",
|
| 104 |
+
"#4675ed",
|
| 105 |
+
"#39a2fc",
|
| 106 |
+
"#1bcfd4",
|
| 107 |
+
"#24eca6",
|
| 108 |
+
"#61fc6c",
|
| 109 |
+
"#a4fc3b",
|
| 110 |
+
"#d1e834",
|
| 111 |
+
"#f3c63a",
|
| 112 |
+
"#fe9b2d",
|
| 113 |
+
"#f36315",
|
| 114 |
+
"#d93806",
|
| 115 |
+
"#b11901",
|
| 116 |
+
"#7a0402",
|
| 117 |
+
]
|
| 118 |
+
|
| 119 |
+
Cividis_r = Cividis[::-1]
|
| 120 |
+
Inferno_r = Inferno[::-1]
|
| 121 |
+
Magma_r = Magma[::-1]
|
| 122 |
+
Plasma_r = Plasma[::-1]
|
| 123 |
+
Plotly3_r = Plotly3[::-1]
|
| 124 |
+
Turbo_r = Turbo[::-1]
|
| 125 |
+
Viridis_r = Viridis[::-1]
|
| 126 |
+
|
| 127 |
+
from .plotlyjs import ( # noqa: E402 F401
|
| 128 |
+
Blackbody,
|
| 129 |
+
Bluered,
|
| 130 |
+
Electric,
|
| 131 |
+
Hot,
|
| 132 |
+
Jet,
|
| 133 |
+
Rainbow,
|
| 134 |
+
Blackbody_r,
|
| 135 |
+
Bluered_r,
|
| 136 |
+
Electric_r,
|
| 137 |
+
Hot_r,
|
| 138 |
+
Jet_r,
|
| 139 |
+
Rainbow_r,
|
| 140 |
+
)
|
| 141 |
+
|
| 142 |
+
from .colorbrewer import ( # noqa: E402 F401
|
| 143 |
+
Blues,
|
| 144 |
+
BuGn,
|
| 145 |
+
BuPu,
|
| 146 |
+
GnBu,
|
| 147 |
+
Greens,
|
| 148 |
+
Greys,
|
| 149 |
+
OrRd,
|
| 150 |
+
Oranges,
|
| 151 |
+
PuBu,
|
| 152 |
+
PuBuGn,
|
| 153 |
+
PuRd,
|
| 154 |
+
Purples,
|
| 155 |
+
RdBu,
|
| 156 |
+
RdPu,
|
| 157 |
+
Reds,
|
| 158 |
+
YlGn,
|
| 159 |
+
YlGnBu,
|
| 160 |
+
YlOrBr,
|
| 161 |
+
YlOrRd,
|
| 162 |
+
Blues_r,
|
| 163 |
+
BuGn_r,
|
| 164 |
+
BuPu_r,
|
| 165 |
+
GnBu_r,
|
| 166 |
+
Greens_r,
|
| 167 |
+
Greys_r,
|
| 168 |
+
OrRd_r,
|
| 169 |
+
Oranges_r,
|
| 170 |
+
PuBu_r,
|
| 171 |
+
PuBuGn_r,
|
| 172 |
+
PuRd_r,
|
| 173 |
+
Purples_r,
|
| 174 |
+
RdBu_r,
|
| 175 |
+
RdPu_r,
|
| 176 |
+
Reds_r,
|
| 177 |
+
YlGn_r,
|
| 178 |
+
YlGnBu_r,
|
| 179 |
+
YlOrBr_r,
|
| 180 |
+
YlOrRd_r,
|
| 181 |
+
)
|
| 182 |
+
|
| 183 |
+
from .cmocean import ( # noqa: E402 F401
|
| 184 |
+
turbid,
|
| 185 |
+
thermal,
|
| 186 |
+
haline,
|
| 187 |
+
solar,
|
| 188 |
+
ice,
|
| 189 |
+
gray,
|
| 190 |
+
deep,
|
| 191 |
+
dense,
|
| 192 |
+
algae,
|
| 193 |
+
matter,
|
| 194 |
+
speed,
|
| 195 |
+
amp,
|
| 196 |
+
tempo,
|
| 197 |
+
turbid_r,
|
| 198 |
+
thermal_r,
|
| 199 |
+
haline_r,
|
| 200 |
+
solar_r,
|
| 201 |
+
ice_r,
|
| 202 |
+
gray_r,
|
| 203 |
+
deep_r,
|
| 204 |
+
dense_r,
|
| 205 |
+
algae_r,
|
| 206 |
+
matter_r,
|
| 207 |
+
speed_r,
|
| 208 |
+
amp_r,
|
| 209 |
+
tempo_r,
|
| 210 |
+
)
|
| 211 |
+
|
| 212 |
+
from .carto import ( # noqa: E402 F401
|
| 213 |
+
Burg,
|
| 214 |
+
Burgyl,
|
| 215 |
+
Redor,
|
| 216 |
+
Oryel,
|
| 217 |
+
Peach,
|
| 218 |
+
Pinkyl,
|
| 219 |
+
Mint,
|
| 220 |
+
Blugrn,
|
| 221 |
+
Darkmint,
|
| 222 |
+
Emrld,
|
| 223 |
+
Aggrnyl,
|
| 224 |
+
Bluyl,
|
| 225 |
+
Teal,
|
| 226 |
+
Tealgrn,
|
| 227 |
+
Purp,
|
| 228 |
+
Purpor,
|
| 229 |
+
Sunset,
|
| 230 |
+
Magenta,
|
| 231 |
+
Sunsetdark,
|
| 232 |
+
Agsunset,
|
| 233 |
+
Brwnyl,
|
| 234 |
+
Burg_r,
|
| 235 |
+
Burgyl_r,
|
| 236 |
+
Redor_r,
|
| 237 |
+
Oryel_r,
|
| 238 |
+
Peach_r,
|
| 239 |
+
Pinkyl_r,
|
| 240 |
+
Mint_r,
|
| 241 |
+
Blugrn_r,
|
| 242 |
+
Darkmint_r,
|
| 243 |
+
Emrld_r,
|
| 244 |
+
Aggrnyl_r,
|
| 245 |
+
Bluyl_r,
|
| 246 |
+
Teal_r,
|
| 247 |
+
Tealgrn_r,
|
| 248 |
+
Purp_r,
|
| 249 |
+
Purpor_r,
|
| 250 |
+
Sunset_r,
|
| 251 |
+
Magenta_r,
|
| 252 |
+
Sunsetdark_r,
|
| 253 |
+
Agsunset_r,
|
| 254 |
+
Brwnyl_r,
|
| 255 |
+
)
|
| 256 |
+
|
| 257 |
+
__all__ = ["swatches"]
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/__config__.cpython-312.pyc
ADDED
|
Binary file (4.9 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (28.4 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_array_api_info.cpython-312.pyc
ADDED
|
Binary file (11.2 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_configtool.cpython-312.pyc
ADDED
|
Binary file (1.69 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_distributor_init.cpython-312.pyc
ADDED
|
Binary file (675 Bytes). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_expired_attrs_2_0.cpython-312.pyc
ADDED
|
Binary file (4.26 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_globals.cpython-312.pyc
ADDED
|
Binary file (4.57 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/_pytesttester.cpython-312.pyc
ADDED
|
Binary file (6.74 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/conftest.cpython-312.pyc
ADDED
|
Binary file (9.81 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/dtypes.cpython-312.pyc
ADDED
|
Binary file (1.56 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/exceptions.cpython-312.pyc
ADDED
|
Binary file (8.66 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/matlib.cpython-312.pyc
ADDED
|
Binary file (12 kB). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/__pycache__/version.cpython-312.pyc
ADDED
|
Binary file (564 Bytes). View file
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/_core/__init__.py
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Contains the core of NumPy: ndarray, ufuncs, dtypes, etc.
|
| 3 |
+
|
| 4 |
+
Please note that this module is private. All functions and objects
|
| 5 |
+
are available in the main ``numpy`` namespace - use that instead.
|
| 6 |
+
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
import os
|
| 10 |
+
|
| 11 |
+
from numpy.version import version as __version__
|
| 12 |
+
|
| 13 |
+
# disables OpenBLAS affinity setting of the main thread that limits
|
| 14 |
+
# python threads or processes to one core
|
| 15 |
+
env_added = []
|
| 16 |
+
for envkey in ['OPENBLAS_MAIN_FREE']:
|
| 17 |
+
if envkey not in os.environ:
|
| 18 |
+
# Note: using `putenv` (and `unsetenv` further down) instead of updating
|
| 19 |
+
# `os.environ` on purpose to avoid a race condition, see gh-30627.
|
| 20 |
+
os.putenv(envkey, '1')
|
| 21 |
+
env_added.append(envkey)
|
| 22 |
+
|
| 23 |
+
try:
|
| 24 |
+
from . import multiarray
|
| 25 |
+
except ImportError as exc:
|
| 26 |
+
import sys
|
| 27 |
+
|
| 28 |
+
# Bypass for the module re-initialization opt-out
|
| 29 |
+
if exc.msg == "cannot load module more than once per process":
|
| 30 |
+
raise
|
| 31 |
+
|
| 32 |
+
# Basically always, the problem should be that the C module is wrong/missing...
|
| 33 |
+
if (
|
| 34 |
+
isinstance(exc, ModuleNotFoundError)
|
| 35 |
+
and exc.name == "numpy._core._multiarray_umath"
|
| 36 |
+
):
|
| 37 |
+
import sys
|
| 38 |
+
candidates = []
|
| 39 |
+
for path in __path__:
|
| 40 |
+
candidates.extend(
|
| 41 |
+
f for f in os.listdir(path) if f.startswith("_multiarray_umath"))
|
| 42 |
+
if len(candidates) == 0:
|
| 43 |
+
bad_c_module_info = (
|
| 44 |
+
"We found no compiled module, did NumPy build successfully?\n")
|
| 45 |
+
else:
|
| 46 |
+
candidate_str = '\n * '.join(candidates)
|
| 47 |
+
# cache_tag is documented to be possibly None, so just use name if it is
|
| 48 |
+
# this guesses at cache_tag being the same as the extension module scheme
|
| 49 |
+
tag = sys.implementation.cache_tag or sys.implementation.name
|
| 50 |
+
bad_c_module_info = (
|
| 51 |
+
f"The following compiled module files exist, but seem incompatible\n"
|
| 52 |
+
f"with with either python '{tag}' or the "
|
| 53 |
+
f"platform '{sys.platform}':\n\n * {candidate_str}\n"
|
| 54 |
+
)
|
| 55 |
+
else:
|
| 56 |
+
bad_c_module_info = ""
|
| 57 |
+
|
| 58 |
+
major, minor, *_ = sys.version_info
|
| 59 |
+
msg = f"""
|
| 60 |
+
|
| 61 |
+
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
|
| 62 |
+
|
| 63 |
+
Importing the numpy C-extensions failed. This error can happen for
|
| 64 |
+
many reasons, often due to issues with your setup or how NumPy was
|
| 65 |
+
installed.
|
| 66 |
+
{bad_c_module_info}
|
| 67 |
+
We have compiled some common reasons and troubleshooting tips at:
|
| 68 |
+
|
| 69 |
+
https://numpy.org/devdocs/user/troubleshooting-importerror.html
|
| 70 |
+
|
| 71 |
+
Please note and check the following:
|
| 72 |
+
|
| 73 |
+
* The Python version is: Python {major}.{minor} from "{sys.executable}"
|
| 74 |
+
* The NumPy version is: "{__version__}"
|
| 75 |
+
|
| 76 |
+
and make sure that they are the versions you expect.
|
| 77 |
+
|
| 78 |
+
Please carefully study the information and documentation linked above.
|
| 79 |
+
This is unlikely to be a NumPy issue but will be caused by a bad install
|
| 80 |
+
or environment on your machine.
|
| 81 |
+
|
| 82 |
+
Original error was: {exc}
|
| 83 |
+
"""
|
| 84 |
+
|
| 85 |
+
raise ImportError(msg) from exc
|
| 86 |
+
finally:
|
| 87 |
+
for envkey in env_added:
|
| 88 |
+
os.unsetenv(envkey)
|
| 89 |
+
del envkey
|
| 90 |
+
del env_added
|
| 91 |
+
del os
|
| 92 |
+
|
| 93 |
+
from . import umath
|
| 94 |
+
|
| 95 |
+
# Check that multiarray,umath are pure python modules wrapping
|
| 96 |
+
# _multiarray_umath and not either of the old c-extension modules
|
| 97 |
+
if not (hasattr(multiarray, '_multiarray_umath') and
|
| 98 |
+
hasattr(umath, '_multiarray_umath')):
|
| 99 |
+
import sys
|
| 100 |
+
path = sys.modules['numpy'].__path__
|
| 101 |
+
msg = ("Something is wrong with the numpy installation. "
|
| 102 |
+
"While importing we detected an older version of "
|
| 103 |
+
"numpy in {}. One method of fixing this is to repeatedly uninstall "
|
| 104 |
+
"numpy until none is found, then reinstall this version.")
|
| 105 |
+
raise ImportError(msg.format(path))
|
| 106 |
+
|
| 107 |
+
from . import numerictypes as nt
|
| 108 |
+
from .numerictypes import sctypeDict, sctypes
|
| 109 |
+
|
| 110 |
+
multiarray.set_typeDict(nt.sctypeDict)
|
| 111 |
+
from . import einsumfunc, fromnumeric, function_base, getlimits, numeric, shape_base
|
| 112 |
+
from .einsumfunc import *
|
| 113 |
+
from .fromnumeric import *
|
| 114 |
+
from .function_base import *
|
| 115 |
+
from .getlimits import *
|
| 116 |
+
|
| 117 |
+
# Note: module name memmap is overwritten by a class with same name
|
| 118 |
+
from .memmap import *
|
| 119 |
+
from .numeric import *
|
| 120 |
+
from .records import recarray, record
|
| 121 |
+
from .shape_base import *
|
| 122 |
+
|
| 123 |
+
del nt
|
| 124 |
+
|
| 125 |
+
# do this after everything else, to minimize the chance of this misleadingly
|
| 126 |
+
# appearing in an import-time traceback
|
| 127 |
+
# add these for module-freeze analysis (like PyInstaller)
|
| 128 |
+
from . import (
|
| 129 |
+
_add_newdocs,
|
| 130 |
+
_add_newdocs_scalars,
|
| 131 |
+
_dtype,
|
| 132 |
+
_dtype_ctypes,
|
| 133 |
+
_internal,
|
| 134 |
+
_methods,
|
| 135 |
+
)
|
| 136 |
+
from .numeric import absolute as abs
|
| 137 |
+
|
| 138 |
+
acos = numeric.arccos
|
| 139 |
+
acosh = numeric.arccosh
|
| 140 |
+
asin = numeric.arcsin
|
| 141 |
+
asinh = numeric.arcsinh
|
| 142 |
+
atan = numeric.arctan
|
| 143 |
+
atanh = numeric.arctanh
|
| 144 |
+
atan2 = numeric.arctan2
|
| 145 |
+
concat = numeric.concatenate
|
| 146 |
+
bitwise_left_shift = numeric.left_shift
|
| 147 |
+
bitwise_invert = numeric.invert
|
| 148 |
+
bitwise_right_shift = numeric.right_shift
|
| 149 |
+
permute_dims = numeric.transpose
|
| 150 |
+
pow = numeric.power
|
| 151 |
+
|
| 152 |
+
__all__ = [
|
| 153 |
+
"abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "atan2",
|
| 154 |
+
"bitwise_invert", "bitwise_left_shift", "bitwise_right_shift", "concat",
|
| 155 |
+
"pow", "permute_dims", "memmap", "sctypeDict", "record", "recarray"
|
| 156 |
+
]
|
| 157 |
+
__all__ += numeric.__all__
|
| 158 |
+
__all__ += function_base.__all__
|
| 159 |
+
__all__ += getlimits.__all__
|
| 160 |
+
__all__ += shape_base.__all__
|
| 161 |
+
__all__ += einsumfunc.__all__
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
def _ufunc_reduce(func):
|
| 165 |
+
# Report the `__name__`. pickle will try to find the module. Note that
|
| 166 |
+
# pickle supports for this `__name__` to be a `__qualname__`. It may
|
| 167 |
+
# make sense to add a `__qualname__` to ufuncs, to allow this more
|
| 168 |
+
# explicitly (Numba has ufuncs as attributes).
|
| 169 |
+
# See also: https://github.com/dask/distributed/issues/3450
|
| 170 |
+
return func.__name__
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
def _DType_reconstruct(scalar_type):
|
| 174 |
+
# This is a work-around to pickle type(np.dtype(np.float64)), etc.
|
| 175 |
+
# and it should eventually be replaced with a better solution, e.g. when
|
| 176 |
+
# DTypes become HeapTypes.
|
| 177 |
+
return type(dtype(scalar_type))
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
def _DType_reduce(DType):
|
| 181 |
+
# As types/classes, most DTypes can simply be pickled by their name:
|
| 182 |
+
if not DType._legacy or DType.__module__ == "numpy.dtypes":
|
| 183 |
+
return DType.__name__
|
| 184 |
+
|
| 185 |
+
# However, user defined legacy dtypes (like rational) do not end up in
|
| 186 |
+
# `numpy.dtypes` as module and do not have a public class at all.
|
| 187 |
+
# For these, we pickle them by reconstructing them from the scalar type:
|
| 188 |
+
scalar_type = DType.type
|
| 189 |
+
return _DType_reconstruct, (scalar_type,)
|
| 190 |
+
|
| 191 |
+
|
| 192 |
+
import copyreg
|
| 193 |
+
|
| 194 |
+
copyreg.pickle(ufunc, _ufunc_reduce)
|
| 195 |
+
copyreg.pickle(type(dtype), _DType_reduce, _DType_reconstruct)
|
| 196 |
+
|
| 197 |
+
# Unclutter namespace (must keep _*_reconstruct for unpickling)
|
| 198 |
+
del copyreg, _ufunc_reduce, _DType_reduce
|
| 199 |
+
|
| 200 |
+
from numpy._pytesttester import PytestTester
|
| 201 |
+
|
| 202 |
+
test = PytestTester(__name__)
|
| 203 |
+
del PytestTester
|
.venv_haddock/lib/python3.12/site-packages/numpy/_core/__init__.pyi
ADDED
|
@@ -0,0 +1,666 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# keep in sync with https://github.com/numpy/numtype/blob/main/src/numpy-stubs/_core/__init__.pyi
|
| 2 |
+
|
| 3 |
+
from ._asarray import require
|
| 4 |
+
from ._ufunc_config import (
|
| 5 |
+
errstate,
|
| 6 |
+
getbufsize,
|
| 7 |
+
geterr,
|
| 8 |
+
geterrcall,
|
| 9 |
+
setbufsize,
|
| 10 |
+
seterr,
|
| 11 |
+
seterrcall,
|
| 12 |
+
)
|
| 13 |
+
from .arrayprint import (
|
| 14 |
+
array2string,
|
| 15 |
+
array_repr,
|
| 16 |
+
array_str,
|
| 17 |
+
format_float_positional,
|
| 18 |
+
format_float_scientific,
|
| 19 |
+
get_printoptions,
|
| 20 |
+
printoptions,
|
| 21 |
+
set_printoptions,
|
| 22 |
+
)
|
| 23 |
+
from .einsumfunc import einsum, einsum_path
|
| 24 |
+
from .fromnumeric import (
|
| 25 |
+
all,
|
| 26 |
+
amax,
|
| 27 |
+
amin,
|
| 28 |
+
any,
|
| 29 |
+
argmax,
|
| 30 |
+
argmin,
|
| 31 |
+
argpartition,
|
| 32 |
+
argsort,
|
| 33 |
+
around,
|
| 34 |
+
choose,
|
| 35 |
+
clip,
|
| 36 |
+
compress,
|
| 37 |
+
cumprod,
|
| 38 |
+
cumsum,
|
| 39 |
+
cumulative_prod,
|
| 40 |
+
cumulative_sum,
|
| 41 |
+
diagonal,
|
| 42 |
+
matrix_transpose,
|
| 43 |
+
max,
|
| 44 |
+
mean,
|
| 45 |
+
min,
|
| 46 |
+
ndim,
|
| 47 |
+
nonzero,
|
| 48 |
+
partition,
|
| 49 |
+
prod,
|
| 50 |
+
ptp,
|
| 51 |
+
put,
|
| 52 |
+
ravel,
|
| 53 |
+
repeat,
|
| 54 |
+
reshape,
|
| 55 |
+
resize,
|
| 56 |
+
round,
|
| 57 |
+
searchsorted,
|
| 58 |
+
shape,
|
| 59 |
+
size,
|
| 60 |
+
sort,
|
| 61 |
+
squeeze,
|
| 62 |
+
std,
|
| 63 |
+
sum,
|
| 64 |
+
swapaxes,
|
| 65 |
+
take,
|
| 66 |
+
trace,
|
| 67 |
+
transpose,
|
| 68 |
+
transpose as permute_dims,
|
| 69 |
+
var,
|
| 70 |
+
)
|
| 71 |
+
from .function_base import geomspace, linspace, logspace
|
| 72 |
+
from .getlimits import finfo, iinfo
|
| 73 |
+
from .memmap import memmap
|
| 74 |
+
from .numeric import (
|
| 75 |
+
False_,
|
| 76 |
+
True_,
|
| 77 |
+
allclose,
|
| 78 |
+
arange,
|
| 79 |
+
argwhere,
|
| 80 |
+
array,
|
| 81 |
+
array_equal,
|
| 82 |
+
array_equiv,
|
| 83 |
+
asanyarray,
|
| 84 |
+
asarray,
|
| 85 |
+
ascontiguousarray,
|
| 86 |
+
asfortranarray,
|
| 87 |
+
astype,
|
| 88 |
+
base_repr,
|
| 89 |
+
binary_repr,
|
| 90 |
+
bitwise_not,
|
| 91 |
+
broadcast,
|
| 92 |
+
can_cast,
|
| 93 |
+
concatenate,
|
| 94 |
+
concatenate as concat,
|
| 95 |
+
convolve,
|
| 96 |
+
copyto,
|
| 97 |
+
correlate,
|
| 98 |
+
count_nonzero,
|
| 99 |
+
cross,
|
| 100 |
+
dot,
|
| 101 |
+
dtype,
|
| 102 |
+
empty,
|
| 103 |
+
empty_like,
|
| 104 |
+
flatiter,
|
| 105 |
+
flatnonzero,
|
| 106 |
+
from_dlpack,
|
| 107 |
+
frombuffer,
|
| 108 |
+
fromfile,
|
| 109 |
+
fromfunction,
|
| 110 |
+
fromiter,
|
| 111 |
+
fromstring,
|
| 112 |
+
full,
|
| 113 |
+
full_like,
|
| 114 |
+
identity,
|
| 115 |
+
indices,
|
| 116 |
+
inf,
|
| 117 |
+
inner,
|
| 118 |
+
isclose,
|
| 119 |
+
isfortran,
|
| 120 |
+
isscalar,
|
| 121 |
+
lexsort,
|
| 122 |
+
little_endian,
|
| 123 |
+
matmul,
|
| 124 |
+
may_share_memory,
|
| 125 |
+
min_scalar_type,
|
| 126 |
+
moveaxis,
|
| 127 |
+
nan,
|
| 128 |
+
ndarray,
|
| 129 |
+
nditer,
|
| 130 |
+
nested_iters,
|
| 131 |
+
newaxis,
|
| 132 |
+
ones,
|
| 133 |
+
ones_like,
|
| 134 |
+
outer,
|
| 135 |
+
promote_types,
|
| 136 |
+
putmask,
|
| 137 |
+
result_type,
|
| 138 |
+
roll,
|
| 139 |
+
rollaxis,
|
| 140 |
+
shares_memory,
|
| 141 |
+
tensordot,
|
| 142 |
+
ufunc,
|
| 143 |
+
vdot,
|
| 144 |
+
vecdot,
|
| 145 |
+
where,
|
| 146 |
+
zeros,
|
| 147 |
+
zeros_like,
|
| 148 |
+
)
|
| 149 |
+
from .numerictypes import (
|
| 150 |
+
ScalarType,
|
| 151 |
+
bool,
|
| 152 |
+
bool_,
|
| 153 |
+
busday_count,
|
| 154 |
+
busday_offset,
|
| 155 |
+
busdaycalendar,
|
| 156 |
+
byte,
|
| 157 |
+
bytes_,
|
| 158 |
+
cdouble,
|
| 159 |
+
character,
|
| 160 |
+
clongdouble,
|
| 161 |
+
complex64,
|
| 162 |
+
complex128,
|
| 163 |
+
complex192,
|
| 164 |
+
complex256,
|
| 165 |
+
complexfloating,
|
| 166 |
+
csingle,
|
| 167 |
+
datetime64,
|
| 168 |
+
datetime_as_string,
|
| 169 |
+
datetime_data,
|
| 170 |
+
double,
|
| 171 |
+
flexible,
|
| 172 |
+
float16,
|
| 173 |
+
float32,
|
| 174 |
+
float64,
|
| 175 |
+
float96,
|
| 176 |
+
float128,
|
| 177 |
+
floating,
|
| 178 |
+
generic,
|
| 179 |
+
half,
|
| 180 |
+
inexact,
|
| 181 |
+
int8,
|
| 182 |
+
int16,
|
| 183 |
+
int32,
|
| 184 |
+
int64,
|
| 185 |
+
int_,
|
| 186 |
+
intc,
|
| 187 |
+
integer,
|
| 188 |
+
intp,
|
| 189 |
+
is_busday,
|
| 190 |
+
isdtype,
|
| 191 |
+
issubdtype,
|
| 192 |
+
long,
|
| 193 |
+
longdouble,
|
| 194 |
+
longlong,
|
| 195 |
+
number,
|
| 196 |
+
object_,
|
| 197 |
+
sctypeDict,
|
| 198 |
+
short,
|
| 199 |
+
signedinteger,
|
| 200 |
+
single,
|
| 201 |
+
str_,
|
| 202 |
+
timedelta64,
|
| 203 |
+
typecodes,
|
| 204 |
+
ubyte,
|
| 205 |
+
uint,
|
| 206 |
+
uint8,
|
| 207 |
+
uint16,
|
| 208 |
+
uint32,
|
| 209 |
+
uint64,
|
| 210 |
+
uintc,
|
| 211 |
+
uintp,
|
| 212 |
+
ulong,
|
| 213 |
+
ulonglong,
|
| 214 |
+
unsignedinteger,
|
| 215 |
+
ushort,
|
| 216 |
+
void,
|
| 217 |
+
)
|
| 218 |
+
from .records import recarray, record
|
| 219 |
+
from .shape_base import (
|
| 220 |
+
atleast_1d,
|
| 221 |
+
atleast_2d,
|
| 222 |
+
atleast_3d,
|
| 223 |
+
block,
|
| 224 |
+
hstack,
|
| 225 |
+
stack,
|
| 226 |
+
unstack,
|
| 227 |
+
vstack,
|
| 228 |
+
)
|
| 229 |
+
from .umath import (
|
| 230 |
+
absolute,
|
| 231 |
+
absolute as abs,
|
| 232 |
+
add,
|
| 233 |
+
arccos,
|
| 234 |
+
arccos as acos,
|
| 235 |
+
arccosh,
|
| 236 |
+
arccosh as acosh,
|
| 237 |
+
arcsin,
|
| 238 |
+
arcsin as asin,
|
| 239 |
+
arcsinh,
|
| 240 |
+
arcsinh as asinh,
|
| 241 |
+
arctan,
|
| 242 |
+
arctan as atan,
|
| 243 |
+
arctan2,
|
| 244 |
+
arctan2 as atan2,
|
| 245 |
+
arctanh,
|
| 246 |
+
arctanh as atanh,
|
| 247 |
+
bitwise_and,
|
| 248 |
+
bitwise_count,
|
| 249 |
+
bitwise_or,
|
| 250 |
+
bitwise_xor,
|
| 251 |
+
cbrt,
|
| 252 |
+
ceil,
|
| 253 |
+
conj,
|
| 254 |
+
conjugate,
|
| 255 |
+
copysign,
|
| 256 |
+
cos,
|
| 257 |
+
cosh,
|
| 258 |
+
deg2rad,
|
| 259 |
+
degrees,
|
| 260 |
+
divide,
|
| 261 |
+
divmod,
|
| 262 |
+
e,
|
| 263 |
+
equal,
|
| 264 |
+
euler_gamma,
|
| 265 |
+
exp,
|
| 266 |
+
exp2,
|
| 267 |
+
expm1,
|
| 268 |
+
fabs,
|
| 269 |
+
float_power,
|
| 270 |
+
floor,
|
| 271 |
+
floor_divide,
|
| 272 |
+
fmax,
|
| 273 |
+
fmin,
|
| 274 |
+
fmod,
|
| 275 |
+
frexp,
|
| 276 |
+
frompyfunc,
|
| 277 |
+
gcd,
|
| 278 |
+
greater,
|
| 279 |
+
greater_equal,
|
| 280 |
+
heaviside,
|
| 281 |
+
hypot,
|
| 282 |
+
invert,
|
| 283 |
+
invert as bitwise_invert,
|
| 284 |
+
isfinite,
|
| 285 |
+
isinf,
|
| 286 |
+
isnan,
|
| 287 |
+
isnat,
|
| 288 |
+
lcm,
|
| 289 |
+
ldexp,
|
| 290 |
+
left_shift,
|
| 291 |
+
left_shift as bitwise_left_shift,
|
| 292 |
+
less,
|
| 293 |
+
less_equal,
|
| 294 |
+
log,
|
| 295 |
+
log1p,
|
| 296 |
+
log2,
|
| 297 |
+
log10,
|
| 298 |
+
logaddexp,
|
| 299 |
+
logaddexp2,
|
| 300 |
+
logical_and,
|
| 301 |
+
logical_not,
|
| 302 |
+
logical_or,
|
| 303 |
+
logical_xor,
|
| 304 |
+
matvec,
|
| 305 |
+
maximum,
|
| 306 |
+
minimum,
|
| 307 |
+
mod,
|
| 308 |
+
modf,
|
| 309 |
+
multiply,
|
| 310 |
+
negative,
|
| 311 |
+
nextafter,
|
| 312 |
+
not_equal,
|
| 313 |
+
pi,
|
| 314 |
+
positive,
|
| 315 |
+
power,
|
| 316 |
+
power as pow,
|
| 317 |
+
rad2deg,
|
| 318 |
+
radians,
|
| 319 |
+
reciprocal,
|
| 320 |
+
remainder,
|
| 321 |
+
right_shift,
|
| 322 |
+
right_shift as bitwise_right_shift,
|
| 323 |
+
rint,
|
| 324 |
+
sign,
|
| 325 |
+
signbit,
|
| 326 |
+
sin,
|
| 327 |
+
sinh,
|
| 328 |
+
spacing,
|
| 329 |
+
sqrt,
|
| 330 |
+
square,
|
| 331 |
+
subtract,
|
| 332 |
+
tan,
|
| 333 |
+
tanh,
|
| 334 |
+
true_divide,
|
| 335 |
+
trunc,
|
| 336 |
+
vecmat,
|
| 337 |
+
)
|
| 338 |
+
|
| 339 |
+
__all__ = [
|
| 340 |
+
"False_",
|
| 341 |
+
"ScalarType",
|
| 342 |
+
"True_",
|
| 343 |
+
"abs",
|
| 344 |
+
"absolute",
|
| 345 |
+
"acos",
|
| 346 |
+
"acosh",
|
| 347 |
+
"add",
|
| 348 |
+
"all",
|
| 349 |
+
"allclose",
|
| 350 |
+
"amax",
|
| 351 |
+
"amin",
|
| 352 |
+
"any",
|
| 353 |
+
"arange",
|
| 354 |
+
"arccos",
|
| 355 |
+
"arccosh",
|
| 356 |
+
"arcsin",
|
| 357 |
+
"arcsinh",
|
| 358 |
+
"arctan",
|
| 359 |
+
"arctan2",
|
| 360 |
+
"arctanh",
|
| 361 |
+
"argmax",
|
| 362 |
+
"argmin",
|
| 363 |
+
"argpartition",
|
| 364 |
+
"argsort",
|
| 365 |
+
"argwhere",
|
| 366 |
+
"around",
|
| 367 |
+
"array",
|
| 368 |
+
"array2string",
|
| 369 |
+
"array_equal",
|
| 370 |
+
"array_equiv",
|
| 371 |
+
"array_repr",
|
| 372 |
+
"array_str",
|
| 373 |
+
"asanyarray",
|
| 374 |
+
"asarray",
|
| 375 |
+
"ascontiguousarray",
|
| 376 |
+
"asfortranarray",
|
| 377 |
+
"asin",
|
| 378 |
+
"asinh",
|
| 379 |
+
"astype",
|
| 380 |
+
"atan",
|
| 381 |
+
"atan2",
|
| 382 |
+
"atanh",
|
| 383 |
+
"atleast_1d",
|
| 384 |
+
"atleast_2d",
|
| 385 |
+
"atleast_3d",
|
| 386 |
+
"base_repr",
|
| 387 |
+
"binary_repr",
|
| 388 |
+
"bitwise_and",
|
| 389 |
+
"bitwise_count",
|
| 390 |
+
"bitwise_invert",
|
| 391 |
+
"bitwise_left_shift",
|
| 392 |
+
"bitwise_not",
|
| 393 |
+
"bitwise_or",
|
| 394 |
+
"bitwise_right_shift",
|
| 395 |
+
"bitwise_xor",
|
| 396 |
+
"block",
|
| 397 |
+
"bool",
|
| 398 |
+
"bool_",
|
| 399 |
+
"broadcast",
|
| 400 |
+
"busday_count",
|
| 401 |
+
"busday_offset",
|
| 402 |
+
"busdaycalendar",
|
| 403 |
+
"byte",
|
| 404 |
+
"bytes_",
|
| 405 |
+
"can_cast",
|
| 406 |
+
"cbrt",
|
| 407 |
+
"cdouble",
|
| 408 |
+
"ceil",
|
| 409 |
+
"character",
|
| 410 |
+
"choose",
|
| 411 |
+
"clip",
|
| 412 |
+
"clongdouble",
|
| 413 |
+
"complex64",
|
| 414 |
+
"complex128",
|
| 415 |
+
"complex192",
|
| 416 |
+
"complex256",
|
| 417 |
+
"complexfloating",
|
| 418 |
+
"compress",
|
| 419 |
+
"concat",
|
| 420 |
+
"concatenate",
|
| 421 |
+
"conj",
|
| 422 |
+
"conjugate",
|
| 423 |
+
"convolve",
|
| 424 |
+
"copysign",
|
| 425 |
+
"copyto",
|
| 426 |
+
"correlate",
|
| 427 |
+
"cos",
|
| 428 |
+
"cosh",
|
| 429 |
+
"count_nonzero",
|
| 430 |
+
"cross",
|
| 431 |
+
"csingle",
|
| 432 |
+
"cumprod",
|
| 433 |
+
"cumsum",
|
| 434 |
+
"cumulative_prod",
|
| 435 |
+
"cumulative_sum",
|
| 436 |
+
"datetime64",
|
| 437 |
+
"datetime_as_string",
|
| 438 |
+
"datetime_data",
|
| 439 |
+
"deg2rad",
|
| 440 |
+
"degrees",
|
| 441 |
+
"diagonal",
|
| 442 |
+
"divide",
|
| 443 |
+
"divmod",
|
| 444 |
+
"dot",
|
| 445 |
+
"double",
|
| 446 |
+
"dtype",
|
| 447 |
+
"e",
|
| 448 |
+
"einsum",
|
| 449 |
+
"einsum_path",
|
| 450 |
+
"empty",
|
| 451 |
+
"empty_like",
|
| 452 |
+
"equal",
|
| 453 |
+
"errstate",
|
| 454 |
+
"euler_gamma",
|
| 455 |
+
"exp",
|
| 456 |
+
"exp2",
|
| 457 |
+
"expm1",
|
| 458 |
+
"fabs",
|
| 459 |
+
"finfo",
|
| 460 |
+
"flatiter",
|
| 461 |
+
"flatnonzero",
|
| 462 |
+
"flexible",
|
| 463 |
+
"float16",
|
| 464 |
+
"float32",
|
| 465 |
+
"float64",
|
| 466 |
+
"float96",
|
| 467 |
+
"float128",
|
| 468 |
+
"float_power",
|
| 469 |
+
"floating",
|
| 470 |
+
"floor",
|
| 471 |
+
"floor_divide",
|
| 472 |
+
"fmax",
|
| 473 |
+
"fmin",
|
| 474 |
+
"fmod",
|
| 475 |
+
"format_float_positional",
|
| 476 |
+
"format_float_scientific",
|
| 477 |
+
"frexp",
|
| 478 |
+
"from_dlpack",
|
| 479 |
+
"frombuffer",
|
| 480 |
+
"fromfile",
|
| 481 |
+
"fromfunction",
|
| 482 |
+
"fromiter",
|
| 483 |
+
"frompyfunc",
|
| 484 |
+
"fromstring",
|
| 485 |
+
"full",
|
| 486 |
+
"full_like",
|
| 487 |
+
"gcd",
|
| 488 |
+
"generic",
|
| 489 |
+
"geomspace",
|
| 490 |
+
"get_printoptions",
|
| 491 |
+
"getbufsize",
|
| 492 |
+
"geterr",
|
| 493 |
+
"geterrcall",
|
| 494 |
+
"greater",
|
| 495 |
+
"greater_equal",
|
| 496 |
+
"half",
|
| 497 |
+
"heaviside",
|
| 498 |
+
"hstack",
|
| 499 |
+
"hypot",
|
| 500 |
+
"identity",
|
| 501 |
+
"iinfo",
|
| 502 |
+
"indices",
|
| 503 |
+
"inexact",
|
| 504 |
+
"inf",
|
| 505 |
+
"inner",
|
| 506 |
+
"int8",
|
| 507 |
+
"int16",
|
| 508 |
+
"int32",
|
| 509 |
+
"int64",
|
| 510 |
+
"int_",
|
| 511 |
+
"intc",
|
| 512 |
+
"integer",
|
| 513 |
+
"intp",
|
| 514 |
+
"invert",
|
| 515 |
+
"is_busday",
|
| 516 |
+
"isclose",
|
| 517 |
+
"isdtype",
|
| 518 |
+
"isfinite",
|
| 519 |
+
"isfortran",
|
| 520 |
+
"isinf",
|
| 521 |
+
"isnan",
|
| 522 |
+
"isnat",
|
| 523 |
+
"isscalar",
|
| 524 |
+
"issubdtype",
|
| 525 |
+
"lcm",
|
| 526 |
+
"ldexp",
|
| 527 |
+
"left_shift",
|
| 528 |
+
"less",
|
| 529 |
+
"less_equal",
|
| 530 |
+
"lexsort",
|
| 531 |
+
"linspace",
|
| 532 |
+
"little_endian",
|
| 533 |
+
"log",
|
| 534 |
+
"log1p",
|
| 535 |
+
"log2",
|
| 536 |
+
"log10",
|
| 537 |
+
"logaddexp",
|
| 538 |
+
"logaddexp2",
|
| 539 |
+
"logical_and",
|
| 540 |
+
"logical_not",
|
| 541 |
+
"logical_or",
|
| 542 |
+
"logical_xor",
|
| 543 |
+
"logspace",
|
| 544 |
+
"long",
|
| 545 |
+
"longdouble",
|
| 546 |
+
"longlong",
|
| 547 |
+
"matmul",
|
| 548 |
+
"matrix_transpose",
|
| 549 |
+
"matvec",
|
| 550 |
+
"max",
|
| 551 |
+
"maximum",
|
| 552 |
+
"may_share_memory",
|
| 553 |
+
"mean",
|
| 554 |
+
"memmap",
|
| 555 |
+
"min",
|
| 556 |
+
"min_scalar_type",
|
| 557 |
+
"minimum",
|
| 558 |
+
"mod",
|
| 559 |
+
"modf",
|
| 560 |
+
"moveaxis",
|
| 561 |
+
"multiply",
|
| 562 |
+
"nan",
|
| 563 |
+
"ndarray",
|
| 564 |
+
"ndim",
|
| 565 |
+
"nditer",
|
| 566 |
+
"negative",
|
| 567 |
+
"nested_iters",
|
| 568 |
+
"newaxis",
|
| 569 |
+
"nextafter",
|
| 570 |
+
"nonzero",
|
| 571 |
+
"not_equal",
|
| 572 |
+
"number",
|
| 573 |
+
"object_",
|
| 574 |
+
"ones",
|
| 575 |
+
"ones_like",
|
| 576 |
+
"outer",
|
| 577 |
+
"partition",
|
| 578 |
+
"permute_dims",
|
| 579 |
+
"pi",
|
| 580 |
+
"positive",
|
| 581 |
+
"pow",
|
| 582 |
+
"power",
|
| 583 |
+
"printoptions",
|
| 584 |
+
"prod",
|
| 585 |
+
"promote_types",
|
| 586 |
+
"ptp",
|
| 587 |
+
"put",
|
| 588 |
+
"putmask",
|
| 589 |
+
"rad2deg",
|
| 590 |
+
"radians",
|
| 591 |
+
"ravel",
|
| 592 |
+
"recarray",
|
| 593 |
+
"reciprocal",
|
| 594 |
+
"record",
|
| 595 |
+
"remainder",
|
| 596 |
+
"repeat",
|
| 597 |
+
"require",
|
| 598 |
+
"reshape",
|
| 599 |
+
"resize",
|
| 600 |
+
"result_type",
|
| 601 |
+
"right_shift",
|
| 602 |
+
"rint",
|
| 603 |
+
"roll",
|
| 604 |
+
"rollaxis",
|
| 605 |
+
"round",
|
| 606 |
+
"sctypeDict",
|
| 607 |
+
"searchsorted",
|
| 608 |
+
"set_printoptions",
|
| 609 |
+
"setbufsize",
|
| 610 |
+
"seterr",
|
| 611 |
+
"seterrcall",
|
| 612 |
+
"shape",
|
| 613 |
+
"shares_memory",
|
| 614 |
+
"short",
|
| 615 |
+
"sign",
|
| 616 |
+
"signbit",
|
| 617 |
+
"signedinteger",
|
| 618 |
+
"sin",
|
| 619 |
+
"single",
|
| 620 |
+
"sinh",
|
| 621 |
+
"size",
|
| 622 |
+
"sort",
|
| 623 |
+
"spacing",
|
| 624 |
+
"sqrt",
|
| 625 |
+
"square",
|
| 626 |
+
"squeeze",
|
| 627 |
+
"stack",
|
| 628 |
+
"std",
|
| 629 |
+
"str_",
|
| 630 |
+
"subtract",
|
| 631 |
+
"sum",
|
| 632 |
+
"swapaxes",
|
| 633 |
+
"take",
|
| 634 |
+
"tan",
|
| 635 |
+
"tanh",
|
| 636 |
+
"tensordot",
|
| 637 |
+
"timedelta64",
|
| 638 |
+
"trace",
|
| 639 |
+
"transpose",
|
| 640 |
+
"true_divide",
|
| 641 |
+
"trunc",
|
| 642 |
+
"typecodes",
|
| 643 |
+
"ubyte",
|
| 644 |
+
"ufunc",
|
| 645 |
+
"uint",
|
| 646 |
+
"uint8",
|
| 647 |
+
"uint16",
|
| 648 |
+
"uint32",
|
| 649 |
+
"uint64",
|
| 650 |
+
"uintc",
|
| 651 |
+
"uintp",
|
| 652 |
+
"ulong",
|
| 653 |
+
"ulonglong",
|
| 654 |
+
"unsignedinteger",
|
| 655 |
+
"unstack",
|
| 656 |
+
"ushort",
|
| 657 |
+
"var",
|
| 658 |
+
"vdot",
|
| 659 |
+
"vecdot",
|
| 660 |
+
"vecmat",
|
| 661 |
+
"void",
|
| 662 |
+
"vstack",
|
| 663 |
+
"where",
|
| 664 |
+
"zeros",
|
| 665 |
+
"zeros_like",
|
| 666 |
+
]
|
.venv_haddock/lib/python3.12/site-packages/numpy/_core/_add_newdocs.py
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
.venv_haddock/lib/python3.12/site-packages/numpy/_core/_add_newdocs.pyi
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from .function_base import add_newdoc as add_newdoc
|
| 2 |
+
from .overrides import get_array_function_like_doc as get_array_function_like_doc
|
.venv_haddock/lib/python3.12/site-packages/numpy/_core/_add_newdocs_scalars.py
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
This file is separate from ``_add_newdocs.py`` so that it can be mocked out by
|
| 3 |
+
our sphinx ``conf.py`` during doc builds, where we want to avoid showing
|
| 4 |
+
platform-dependent information.
|
| 5 |
+
"""
|
| 6 |
+
import os
|
| 7 |
+
import sys
|
| 8 |
+
|
| 9 |
+
from numpy._core import dtype, numerictypes as _numerictypes
|
| 10 |
+
from numpy._core.function_base import add_newdoc
|
| 11 |
+
|
| 12 |
+
##############################################################################
|
| 13 |
+
#
|
| 14 |
+
# Documentation for concrete scalar classes
|
| 15 |
+
#
|
| 16 |
+
##############################################################################
|
| 17 |
+
|
| 18 |
+
def numeric_type_aliases(aliases):
|
| 19 |
+
def type_aliases_gen():
|
| 20 |
+
for alias, doc in aliases:
|
| 21 |
+
try:
|
| 22 |
+
alias_type = getattr(_numerictypes, alias)
|
| 23 |
+
except AttributeError:
|
| 24 |
+
# The set of aliases that actually exist varies between platforms
|
| 25 |
+
pass
|
| 26 |
+
else:
|
| 27 |
+
yield (alias_type, alias, doc)
|
| 28 |
+
return list(type_aliases_gen())
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
possible_aliases = numeric_type_aliases([
|
| 32 |
+
('int8', '8-bit signed integer (``-128`` to ``127``)'),
|
| 33 |
+
('int16', '16-bit signed integer (``-32_768`` to ``32_767``)'),
|
| 34 |
+
('int32', '32-bit signed integer (``-2_147_483_648`` to ``2_147_483_647``)'),
|
| 35 |
+
('int64', '64-bit signed integer (``-9_223_372_036_854_775_808`` to ``9_223_372_036_854_775_807``)'),
|
| 36 |
+
('intp', 'Signed integer large enough to fit pointer, compatible with C ``intptr_t``'),
|
| 37 |
+
('uint8', '8-bit unsigned integer (``0`` to ``255``)'),
|
| 38 |
+
('uint16', '16-bit unsigned integer (``0`` to ``65_535``)'),
|
| 39 |
+
('uint32', '32-bit unsigned integer (``0`` to ``4_294_967_295``)'),
|
| 40 |
+
('uint64', '64-bit unsigned integer (``0`` to ``18_446_744_073_709_551_615``)'),
|
| 41 |
+
('uintp', 'Unsigned integer large enough to fit pointer, compatible with C ``uintptr_t``'),
|
| 42 |
+
('float16', '16-bit-precision floating-point number type: sign bit, 5 bits exponent, 10 bits mantissa'),
|
| 43 |
+
('float32', '32-bit-precision floating-point number type: sign bit, 8 bits exponent, 23 bits mantissa'),
|
| 44 |
+
('float64', '64-bit precision floating-point number type: sign bit, 11 bits exponent, 52 bits mantissa'),
|
| 45 |
+
('float96', '96-bit extended-precision floating-point number type'),
|
| 46 |
+
('float128', '128-bit extended-precision floating-point number type'),
|
| 47 |
+
('complex64', 'Complex number type composed of 2 32-bit-precision floating-point numbers'),
|
| 48 |
+
('complex128', 'Complex number type composed of 2 64-bit-precision floating-point numbers'),
|
| 49 |
+
('complex192', 'Complex number type composed of 2 96-bit extended-precision floating-point numbers'),
|
| 50 |
+
('complex256', 'Complex number type composed of 2 128-bit extended-precision floating-point numbers'),
|
| 51 |
+
])
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def _get_platform_and_machine():
|
| 55 |
+
try:
|
| 56 |
+
system, _, _, _, machine = os.uname()
|
| 57 |
+
except AttributeError:
|
| 58 |
+
system = sys.platform
|
| 59 |
+
if system == 'win32':
|
| 60 |
+
machine = os.environ.get('PROCESSOR_ARCHITEW6432', '') \
|
| 61 |
+
or os.environ.get('PROCESSOR_ARCHITECTURE', '')
|
| 62 |
+
else:
|
| 63 |
+
machine = 'unknown'
|
| 64 |
+
return system, machine
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
_system, _machine = _get_platform_and_machine()
|
| 68 |
+
_doc_alias_string = f":Alias on this platform ({_system} {_machine}):"
|
| 69 |
+
|
| 70 |
+
# docstring prefix that cpython uses to populate `__text_signature__`
|
| 71 |
+
_ARGUMENT_CLINIC_TEMPLATE = """{name}{signature}
|
| 72 |
+
--
|
| 73 |
+
|
| 74 |
+
{docstring}"""
|
| 75 |
+
|
| 76 |
+
def add_newdoc_for_scalar_type(name: str, text_signature: str, doc: str) -> None:
|
| 77 |
+
# note: `:field: value` is rST syntax which renders as field lists.
|
| 78 |
+
cls = getattr(_numerictypes, name)
|
| 79 |
+
module = cls.__module__
|
| 80 |
+
|
| 81 |
+
lines_extra = [
|
| 82 |
+
"", # blank line after main doc
|
| 83 |
+
f":Character code: ``{dtype(cls).char!r}``",
|
| 84 |
+
]
|
| 85 |
+
|
| 86 |
+
if name != cls.__name__:
|
| 87 |
+
lines_extra.append(f":Canonical name: `{module}.{name}`")
|
| 88 |
+
|
| 89 |
+
lines_extra.extend(
|
| 90 |
+
f"{_doc_alias_string} `{module}.{alias}`: {doc}."
|
| 91 |
+
for alias_type, alias, doc in possible_aliases
|
| 92 |
+
if alias_type is cls
|
| 93 |
+
)
|
| 94 |
+
|
| 95 |
+
docstring = _ARGUMENT_CLINIC_TEMPLATE.format(
|
| 96 |
+
name=cls.__name__, # must match the class name
|
| 97 |
+
signature=text_signature,
|
| 98 |
+
docstring="\n".join([doc.strip(), *lines_extra]),
|
| 99 |
+
)
|
| 100 |
+
add_newdoc('numpy._core.numerictypes', name, docstring)
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
for bool_name in ('bool', 'bool_'):
|
| 104 |
+
add_newdoc_for_scalar_type(bool_name, '(value=False, /)', """
|
| 105 |
+
Boolean type (True or False), stored as a byte.
|
| 106 |
+
|
| 107 |
+
.. warning::
|
| 108 |
+
|
| 109 |
+
The :class:`bool` type is not a subclass of the :class:`int_` type
|
| 110 |
+
(the :class:`bool` is not even a number type). This is different
|
| 111 |
+
than Python's default implementation of :class:`bool` as a
|
| 112 |
+
sub-class of :class:`int`.
|
| 113 |
+
""")
|
| 114 |
+
|
| 115 |
+
add_newdoc_for_scalar_type('byte', '(value=0, /)', """
|
| 116 |
+
Signed integer type, compatible with C ``char``.
|
| 117 |
+
""")
|
| 118 |
+
|
| 119 |
+
add_newdoc_for_scalar_type('short', '(value=0, /)', """
|
| 120 |
+
Signed integer type, compatible with C ``short``.
|
| 121 |
+
""")
|
| 122 |
+
|
| 123 |
+
add_newdoc_for_scalar_type('intc', '(value=0, /)', """
|
| 124 |
+
Signed integer type, compatible with C ``int``.
|
| 125 |
+
""")
|
| 126 |
+
|
| 127 |
+
add_newdoc_for_scalar_type('long', '(value=0, /)', """
|
| 128 |
+
Signed integer type, compatible with C ``long``.
|
| 129 |
+
""")
|
| 130 |
+
|
| 131 |
+
# TODO: These docs probably need an if to highlight the default rather than
|
| 132 |
+
# the C-types (and be correct).
|
| 133 |
+
add_newdoc_for_scalar_type('int_', '(value=0, /)', """
|
| 134 |
+
Default signed integer type, 64bit on 64bit systems and 32bit on 32bit systems.
|
| 135 |
+
""")
|
| 136 |
+
|
| 137 |
+
add_newdoc_for_scalar_type('longlong', '(value=0, /)', """
|
| 138 |
+
Signed integer type, compatible with C ``long long``.
|
| 139 |
+
""")
|
| 140 |
+
|
| 141 |
+
add_newdoc_for_scalar_type('ubyte', '(value=0, /)', """
|
| 142 |
+
Unsigned integer type, compatible with C ``unsigned char``.
|
| 143 |
+
""")
|
| 144 |
+
|
| 145 |
+
add_newdoc_for_scalar_type('ushort', '(value=0, /)', """
|
| 146 |
+
Unsigned integer type, compatible with C ``unsigned short``.
|
| 147 |
+
""")
|
| 148 |
+
|
| 149 |
+
add_newdoc_for_scalar_type('uintc', '(value=0, /)', """
|
| 150 |
+
Unsigned integer type, compatible with C ``unsigned int``.
|
| 151 |
+
""")
|
| 152 |
+
|
| 153 |
+
add_newdoc_for_scalar_type('uint', '(value=0, /)', """
|
| 154 |
+
Unsigned signed integer type, 64bit on 64bit systems and 32bit on 32bit systems.
|
| 155 |
+
""")
|
| 156 |
+
|
| 157 |
+
add_newdoc_for_scalar_type('ulong', '(value=0, /)', """
|
| 158 |
+
Unsigned integer type, compatible with C ``unsigned long``.
|
| 159 |
+
""")
|
| 160 |
+
|
| 161 |
+
add_newdoc_for_scalar_type('ulonglong', '(value=0, /)', """
|
| 162 |
+
Unsigned integer type, compatible with C ``unsigned long long``.
|
| 163 |
+
""")
|
| 164 |
+
|
| 165 |
+
add_newdoc_for_scalar_type('half', '(value=0, /)', """
|
| 166 |
+
Half-precision floating-point number type.
|
| 167 |
+
""")
|
| 168 |
+
|
| 169 |
+
add_newdoc_for_scalar_type('single', '(value=0, /)', """
|
| 170 |
+
Single-precision floating-point number type, compatible with C ``float``.
|
| 171 |
+
""")
|
| 172 |
+
|
| 173 |
+
add_newdoc_for_scalar_type('double', '(value=0, /)', """
|
| 174 |
+
Double-precision floating-point number type, compatible with Python :class:`float` and C ``double``.
|
| 175 |
+
""")
|
| 176 |
+
|
| 177 |
+
add_newdoc_for_scalar_type('longdouble', '(value=0, /)', """
|
| 178 |
+
Extended-precision floating-point number type, compatible with C ``long double``
|
| 179 |
+
but not necessarily with IEEE 754 quadruple-precision.
|
| 180 |
+
""")
|
| 181 |
+
|
| 182 |
+
add_newdoc_for_scalar_type('csingle', '(real=0, imag=0, /)', """
|
| 183 |
+
Complex number type composed of two single-precision floating-point numbers.
|
| 184 |
+
""")
|
| 185 |
+
|
| 186 |
+
add_newdoc_for_scalar_type('cdouble', '(real=0, imag=0, /)', """
|
| 187 |
+
Complex number type composed of two double-precision floating-point numbers,
|
| 188 |
+
compatible with Python :class:`complex`.
|
| 189 |
+
""")
|
| 190 |
+
|
| 191 |
+
add_newdoc_for_scalar_type('clongdouble', '(real=0, imag=0, /)', """
|
| 192 |
+
Complex number type composed of two extended-precision floating-point numbers.
|
| 193 |
+
""")
|
| 194 |
+
|
| 195 |
+
add_newdoc_for_scalar_type('object_', '(value=None, /)', """
|
| 196 |
+
Any Python object.
|
| 197 |
+
""")
|
| 198 |
+
|
| 199 |
+
add_newdoc_for_scalar_type('str_', '(value="", /, *args, **kwargs)', r"""
|
| 200 |
+
A unicode string.
|
| 201 |
+
|
| 202 |
+
This type strips trailing null codepoints.
|
| 203 |
+
|
| 204 |
+
>>> s = np.str_("abc\x00")
|
| 205 |
+
>>> s
|
| 206 |
+
'abc'
|
| 207 |
+
|
| 208 |
+
Unlike the builtin :class:`str`, this supports the
|
| 209 |
+
:ref:`python:bufferobjects`, exposing its contents as UCS4:
|
| 210 |
+
|
| 211 |
+
>>> m = memoryview(np.str_("abc"))
|
| 212 |
+
>>> m.format
|
| 213 |
+
'3w'
|
| 214 |
+
>>> m.tobytes()
|
| 215 |
+
b'a\x00\x00\x00b\x00\x00\x00c\x00\x00\x00'
|
| 216 |
+
""")
|
| 217 |
+
|
| 218 |
+
add_newdoc_for_scalar_type('bytes_', '(value="", /, *args, **kwargs)', r"""
|
| 219 |
+
A byte string.
|
| 220 |
+
|
| 221 |
+
When used in arrays, this type strips trailing null bytes.
|
| 222 |
+
""")
|
| 223 |
+
|
| 224 |
+
add_newdoc_for_scalar_type('void', '(length_or_data, /, dtype=None)', r"""
|
| 225 |
+
np.void(length_or_data, /, dtype=None)
|
| 226 |
+
|
| 227 |
+
Create a new structured or unstructured void scalar.
|
| 228 |
+
|
| 229 |
+
Parameters
|
| 230 |
+
----------
|
| 231 |
+
length_or_data : int, array-like, bytes-like, object
|
| 232 |
+
One of multiple meanings (see notes). The length or
|
| 233 |
+
bytes data of an unstructured void. Or alternatively,
|
| 234 |
+
the data to be stored in the new scalar when `dtype`
|
| 235 |
+
is provided.
|
| 236 |
+
This can be an array-like, in which case an array may
|
| 237 |
+
be returned.
|
| 238 |
+
dtype : dtype, optional
|
| 239 |
+
If provided the dtype of the new scalar. This dtype must
|
| 240 |
+
be "void" dtype (i.e. a structured or unstructured void,
|
| 241 |
+
see also :ref:`defining-structured-types`).
|
| 242 |
+
|
| 243 |
+
.. versionadded:: 1.24
|
| 244 |
+
|
| 245 |
+
Notes
|
| 246 |
+
-----
|
| 247 |
+
For historical reasons and because void scalars can represent both
|
| 248 |
+
arbitrary byte data and structured dtypes, the void constructor
|
| 249 |
+
has three calling conventions:
|
| 250 |
+
|
| 251 |
+
1. ``np.void(5)`` creates a ``dtype="V5"`` scalar filled with five
|
| 252 |
+
``\0`` bytes. The 5 can be a Python or NumPy integer.
|
| 253 |
+
2. ``np.void(b"bytes-like")`` creates a void scalar from the byte string.
|
| 254 |
+
The dtype itemsize will match the byte string length, here ``"V10"``.
|
| 255 |
+
3. When a ``dtype=`` is passed the call is roughly the same as an
|
| 256 |
+
array creation. However, a void scalar rather than array is returned.
|
| 257 |
+
|
| 258 |
+
Please see the examples which show all three different conventions.
|
| 259 |
+
|
| 260 |
+
Examples
|
| 261 |
+
--------
|
| 262 |
+
>>> np.void(5)
|
| 263 |
+
np.void(b'\x00\x00\x00\x00\x00')
|
| 264 |
+
>>> np.void(b'abcd')
|
| 265 |
+
np.void(b'\x61\x62\x63\x64')
|
| 266 |
+
>>> np.void((3.2, b'eggs'), dtype="d,S5")
|
| 267 |
+
np.void((3.2, b'eggs'), dtype=[('f0', '<f8'), ('f1', 'S5')])
|
| 268 |
+
>>> np.void(3, dtype=[('x', np.int8), ('y', np.int8)])
|
| 269 |
+
np.void((3, 3), dtype=[('x', 'i1'), ('y', 'i1')])
|
| 270 |
+
""")
|
| 271 |
+
|
| 272 |
+
add_newdoc_for_scalar_type('datetime64', '(value=None, /, *args)', """
|
| 273 |
+
If created from a 64-bit integer, it represents an offset from ``1970-01-01T00:00:00``.
|
| 274 |
+
If created from string, the string can be in ISO 8601 date or datetime format.
|
| 275 |
+
|
| 276 |
+
When parsing a string to create a datetime object, if the string contains
|
| 277 |
+
a trailing timezone (A 'Z' or a timezone offset), the timezone will be
|
| 278 |
+
dropped and a User Warning is given.
|
| 279 |
+
|
| 280 |
+
Datetime64 objects should be considered to be UTC and therefore have an
|
| 281 |
+
offset of +0000.
|
| 282 |
+
|
| 283 |
+
>>> np.datetime64(10, 'Y')
|
| 284 |
+
np.datetime64('1980')
|
| 285 |
+
>>> np.datetime64('1980', 'Y')
|
| 286 |
+
np.datetime64('1980')
|
| 287 |
+
>>> np.datetime64(10, 'D')
|
| 288 |
+
np.datetime64('1970-01-11')
|
| 289 |
+
|
| 290 |
+
See :ref:`arrays.datetime` for more information.
|
| 291 |
+
""")
|
| 292 |
+
|
| 293 |
+
add_newdoc_for_scalar_type('timedelta64', '(value=0, /, *args)', """
|
| 294 |
+
A timedelta stored as a 64-bit integer.
|
| 295 |
+
|
| 296 |
+
See :ref:`arrays.datetime` for more information.
|
| 297 |
+
""")
|
| 298 |
+
|
| 299 |
+
add_newdoc('numpy._core.numerictypes', "integer", ('is_integer',
|
| 300 |
+
"""
|
| 301 |
+
is_integer($self, /)
|
| 302 |
+
--
|
| 303 |
+
|
| 304 |
+
integer.is_integer() -> bool
|
| 305 |
+
|
| 306 |
+
Return ``True`` if the number is finite with integral value.
|
| 307 |
+
|
| 308 |
+
.. versionadded:: 1.22
|
| 309 |
+
|
| 310 |
+
Examples
|
| 311 |
+
--------
|
| 312 |
+
>>> import numpy as np
|
| 313 |
+
>>> np.int64(-2).is_integer()
|
| 314 |
+
True
|
| 315 |
+
>>> np.uint32(5).is_integer()
|
| 316 |
+
True
|
| 317 |
+
"""))
|
| 318 |
+
|
| 319 |
+
# TODO: work out how to put this on the base class, np.floating
|
| 320 |
+
for float_name in ('half', 'single', 'double', 'longdouble'):
|
| 321 |
+
add_newdoc('numpy._core.numerictypes', float_name, ('as_integer_ratio',
|
| 322 |
+
f"""
|
| 323 |
+
as_integer_ratio($self, /)
|
| 324 |
+
--
|
| 325 |
+
|
| 326 |
+
{float_name}.as_integer_ratio() -> (int, int)
|
| 327 |
+
|
| 328 |
+
Return a pair of integers, whose ratio is exactly equal to the original
|
| 329 |
+
floating point number, and with a positive denominator.
|
| 330 |
+
Raise `OverflowError` on infinities and a `ValueError` on NaNs.
|
| 331 |
+
|
| 332 |
+
>>> np.{float_name}(10.0).as_integer_ratio()
|
| 333 |
+
(10, 1)
|
| 334 |
+
>>> np.{float_name}(0.0).as_integer_ratio()
|
| 335 |
+
(0, 1)
|
| 336 |
+
>>> np.{float_name}(-.25).as_integer_ratio()
|
| 337 |
+
(-1, 4)
|
| 338 |
+
"""))
|
| 339 |
+
|
| 340 |
+
add_newdoc('numpy._core.numerictypes', float_name, ('is_integer',
|
| 341 |
+
f"""
|
| 342 |
+
is_integer($self, /)
|
| 343 |
+
--
|
| 344 |
+
|
| 345 |
+
{float_name}.is_integer() -> bool
|
| 346 |
+
|
| 347 |
+
Return ``True`` if the floating point number is finite with integral
|
| 348 |
+
value, and ``False`` otherwise.
|
| 349 |
+
|
| 350 |
+
.. versionadded:: 1.22
|
| 351 |
+
|
| 352 |
+
Examples
|
| 353 |
+
--------
|
| 354 |
+
>>> np.{float_name}(-2.0).is_integer()
|
| 355 |
+
True
|
| 356 |
+
>>> np.{float_name}(3.2).is_integer()
|
| 357 |
+
False
|
| 358 |
+
"""))
|
| 359 |
+
|
| 360 |
+
for int_name in ('int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32',
|
| 361 |
+
'int64', 'uint64', 'int64', 'uint64', 'int64', 'uint64',
|
| 362 |
+
'longlong', 'ulonglong'):
|
| 363 |
+
# Add negative examples for signed cases by checking typecode
|
| 364 |
+
add_newdoc('numpy._core.numerictypes', int_name, ('bit_count',
|
| 365 |
+
f"""
|
| 366 |
+
bit_count($self, /)
|
| 367 |
+
--
|
| 368 |
+
|
| 369 |
+
{int_name}.bit_count() -> int
|
| 370 |
+
|
| 371 |
+
Computes the number of 1-bits in the absolute value of the input.
|
| 372 |
+
Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
|
| 373 |
+
|
| 374 |
+
Examples
|
| 375 |
+
--------
|
| 376 |
+
>>> np.{int_name}(127).bit_count()
|
| 377 |
+
7""" +
|
| 378 |
+
(f"""
|
| 379 |
+
>>> np.{int_name}(-127).bit_count()
|
| 380 |
+
7
|
| 381 |
+
""" if dtype(int_name).char.islower() else "")))
|
.venv_haddock/lib/python3.12/site-packages/numpy/_core/_add_newdocs_scalars.pyi
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Final
|
| 2 |
+
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
possible_aliases: Final[list[tuple[type[np.number], str, str]]] = ...
|
| 6 |
+
_system: Final[str] = ...
|
| 7 |
+
_machine: Final[str] = ...
|
| 8 |
+
_doc_alias_string: Final[str] = ...
|
| 9 |
+
_bool_docstring: Final[str] = ...
|
| 10 |
+
bool_name: str = ...
|
| 11 |
+
int_name: str = ...
|
| 12 |
+
float_name: str = ...
|
| 13 |
+
|
| 14 |
+
def numeric_type_aliases(aliases: list[tuple[str, str]]) -> list[tuple[type[np.number], str, str]]: ...
|
| 15 |
+
def add_newdoc_for_scalar_type(name: str, text_signature: str, doc: str) -> None: ...
|
| 16 |
+
def _get_platform_and_machine() -> tuple[str, str]: ...
|
.venv_haddock/lib/python3.12/site-packages/numpy/_core/_asarray.py
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Functions in the ``as*array`` family that promote array-likes into arrays.
|
| 3 |
+
|
| 4 |
+
`require` fits this category despite its name not matching this pattern.
|
| 5 |
+
"""
|
| 6 |
+
from .multiarray import array, asanyarray
|
| 7 |
+
from .overrides import array_function_dispatch, finalize_array_function_like, set_module
|
| 8 |
+
|
| 9 |
+
__all__ = ["require"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
POSSIBLE_FLAGS = {
|
| 13 |
+
'C': 'C', 'C_CONTIGUOUS': 'C', 'CONTIGUOUS': 'C',
|
| 14 |
+
'F': 'F', 'F_CONTIGUOUS': 'F', 'FORTRAN': 'F',
|
| 15 |
+
'A': 'A', 'ALIGNED': 'A',
|
| 16 |
+
'W': 'W', 'WRITEABLE': 'W',
|
| 17 |
+
'O': 'O', 'OWNDATA': 'O',
|
| 18 |
+
'E': 'E', 'ENSUREARRAY': 'E'
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@finalize_array_function_like
|
| 23 |
+
@set_module('numpy')
|
| 24 |
+
def require(a, dtype=None, requirements=None, *, like=None):
|
| 25 |
+
"""
|
| 26 |
+
Return an ndarray of the provided type that satisfies requirements.
|
| 27 |
+
|
| 28 |
+
This function is useful to be sure that an array with the correct flags
|
| 29 |
+
is returned for passing to compiled code (perhaps through ctypes).
|
| 30 |
+
|
| 31 |
+
Parameters
|
| 32 |
+
----------
|
| 33 |
+
a : array_like
|
| 34 |
+
The object to be converted to a type-and-requirement-satisfying array.
|
| 35 |
+
dtype : data-type
|
| 36 |
+
The required data-type. If None preserve the current dtype. If your
|
| 37 |
+
application requires the data to be in native byteorder, include
|
| 38 |
+
a byteorder specification as a part of the dtype specification.
|
| 39 |
+
requirements : str or sequence of str
|
| 40 |
+
The requirements list can be any of the following
|
| 41 |
+
|
| 42 |
+
* 'F_CONTIGUOUS' ('F') - ensure a Fortran-contiguous array
|
| 43 |
+
* 'C_CONTIGUOUS' ('C') - ensure a C-contiguous array
|
| 44 |
+
* 'ALIGNED' ('A') - ensure a data-type aligned array
|
| 45 |
+
* 'WRITEABLE' ('W') - ensure a writable array
|
| 46 |
+
* 'OWNDATA' ('O') - ensure an array that owns its own data
|
| 47 |
+
* 'ENSUREARRAY', ('E') - ensure a base array, instead of a subclass
|
| 48 |
+
${ARRAY_FUNCTION_LIKE}
|
| 49 |
+
|
| 50 |
+
.. versionadded:: 1.20.0
|
| 51 |
+
|
| 52 |
+
Returns
|
| 53 |
+
-------
|
| 54 |
+
out : ndarray
|
| 55 |
+
Array with specified requirements and type if given.
|
| 56 |
+
|
| 57 |
+
See Also
|
| 58 |
+
--------
|
| 59 |
+
asarray : Convert input to an ndarray.
|
| 60 |
+
asanyarray : Convert to an ndarray, but pass through ndarray subclasses.
|
| 61 |
+
ascontiguousarray : Convert input to a contiguous array.
|
| 62 |
+
asfortranarray : Convert input to an ndarray with column-major
|
| 63 |
+
memory order.
|
| 64 |
+
ndarray.flags : Information about the memory layout of the array.
|
| 65 |
+
|
| 66 |
+
Notes
|
| 67 |
+
-----
|
| 68 |
+
The returned array will be guaranteed to have the listed requirements
|
| 69 |
+
by making a copy if needed.
|
| 70 |
+
|
| 71 |
+
Examples
|
| 72 |
+
--------
|
| 73 |
+
>>> import numpy as np
|
| 74 |
+
>>> x = np.arange(6).reshape(2,3)
|
| 75 |
+
>>> x.flags
|
| 76 |
+
C_CONTIGUOUS : True
|
| 77 |
+
F_CONTIGUOUS : False
|
| 78 |
+
OWNDATA : False
|
| 79 |
+
WRITEABLE : True
|
| 80 |
+
ALIGNED : True
|
| 81 |
+
WRITEBACKIFCOPY : False
|
| 82 |
+
|
| 83 |
+
>>> y = np.require(x, dtype=np.float32, requirements=['A', 'O', 'W', 'F'])
|
| 84 |
+
>>> y.flags
|
| 85 |
+
C_CONTIGUOUS : False
|
| 86 |
+
F_CONTIGUOUS : True
|
| 87 |
+
OWNDATA : True
|
| 88 |
+
WRITEABLE : True
|
| 89 |
+
ALIGNED : True
|
| 90 |
+
WRITEBACKIFCOPY : False
|
| 91 |
+
|
| 92 |
+
"""
|
| 93 |
+
if like is not None:
|
| 94 |
+
return _require_with_like(
|
| 95 |
+
like,
|
| 96 |
+
a,
|
| 97 |
+
dtype=dtype,
|
| 98 |
+
requirements=requirements,
|
| 99 |
+
)
|
| 100 |
+
|
| 101 |
+
if not requirements:
|
| 102 |
+
return asanyarray(a, dtype=dtype)
|
| 103 |
+
|
| 104 |
+
requirements = {POSSIBLE_FLAGS[x.upper()] for x in requirements}
|
| 105 |
+
|
| 106 |
+
if 'E' in requirements:
|
| 107 |
+
requirements.remove('E')
|
| 108 |
+
subok = False
|
| 109 |
+
else:
|
| 110 |
+
subok = True
|
| 111 |
+
|
| 112 |
+
order = 'A'
|
| 113 |
+
if requirements >= {'C', 'F'}:
|
| 114 |
+
raise ValueError('Cannot specify both "C" and "F" order')
|
| 115 |
+
elif 'F' in requirements:
|
| 116 |
+
order = 'F'
|
| 117 |
+
requirements.remove('F')
|
| 118 |
+
elif 'C' in requirements:
|
| 119 |
+
order = 'C'
|
| 120 |
+
requirements.remove('C')
|
| 121 |
+
|
| 122 |
+
arr = array(a, dtype=dtype, order=order, copy=None, subok=subok)
|
| 123 |
+
|
| 124 |
+
for prop in requirements:
|
| 125 |
+
if not arr.flags[prop]:
|
| 126 |
+
return arr.copy(order)
|
| 127 |
+
return arr
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
_require_with_like = array_function_dispatch()(require)
|
.venv_haddock/lib/python3.12/site-packages/numpy/_core/_asarray.pyi
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from collections.abc import Iterable
|
| 2 |
+
from typing import Any, Literal, TypeAlias, TypeVar, overload
|
| 3 |
+
|
| 4 |
+
from numpy._typing import DTypeLike, NDArray, _SupportsArrayFunc
|
| 5 |
+
|
| 6 |
+
__all__ = ["require"]
|
| 7 |
+
|
| 8 |
+
_ArrayT = TypeVar("_ArrayT", bound=NDArray[Any])
|
| 9 |
+
|
| 10 |
+
_Requirements: TypeAlias = Literal[
|
| 11 |
+
"C", "C_CONTIGUOUS", "CONTIGUOUS",
|
| 12 |
+
"F", "F_CONTIGUOUS", "FORTRAN",
|
| 13 |
+
"A", "ALIGNED",
|
| 14 |
+
"W", "WRITEABLE",
|
| 15 |
+
"O", "OWNDATA"
|
| 16 |
+
]
|
| 17 |
+
_E: TypeAlias = Literal["E", "ENSUREARRAY"]
|
| 18 |
+
_RequirementsWithE: TypeAlias = _Requirements | _E
|
| 19 |
+
|
| 20 |
+
@overload
|
| 21 |
+
def require(
|
| 22 |
+
a: _ArrayT,
|
| 23 |
+
dtype: None = None,
|
| 24 |
+
requirements: _Requirements | Iterable[_Requirements] | None = None,
|
| 25 |
+
*,
|
| 26 |
+
like: _SupportsArrayFunc | None = None
|
| 27 |
+
) -> _ArrayT: ...
|
| 28 |
+
@overload
|
| 29 |
+
def require(
|
| 30 |
+
a: object,
|
| 31 |
+
dtype: DTypeLike | None = None,
|
| 32 |
+
requirements: _E | Iterable[_RequirementsWithE] | None = None,
|
| 33 |
+
*,
|
| 34 |
+
like: _SupportsArrayFunc | None = None
|
| 35 |
+
) -> NDArray[Any]: ...
|
| 36 |
+
@overload
|
| 37 |
+
def require(
|
| 38 |
+
a: object,
|
| 39 |
+
dtype: DTypeLike | None = None,
|
| 40 |
+
requirements: _Requirements | Iterable[_Requirements] | None = None,
|
| 41 |
+
*,
|
| 42 |
+
like: _SupportsArrayFunc | None = None
|
| 43 |
+
) -> NDArray[Any]: ...
|