Skip to content

Commit 68d67fa

Browse files
committed
Improve doc
1 parent 2f70a64 commit 68d67fa

File tree

7 files changed

+140
-18
lines changed

7 files changed

+140
-18
lines changed

RELEASING.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ python-blosc2 release procedure
33

44
Preliminaries
55
-------------
6-
* Make sure that the c-blosc2 submodule is updated to the latest version (or a specific version that
7-
will be documented in the `RELEASE_NOTES.md`)::
6+
* Make sure that the c-blosc2 submodule is updated to the latest version (or a specific version that will be documented in the `RELEASE_NOTES.md`)::
87

98
cd blosc2/c-blosc2
109
git switch <desired branch or tag>

blosc2/__init__.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414
# Filters
1515
from .blosc2_ext import NOFILTER, SHUFFLE, BITSHUFFLE, DELTA, TRUNC_PREC
1616

17-
# Filter names
18-
filter_names = {
19-
NOFILTER: "nofilter",
20-
SHUFFLE: "shuffle",
21-
BITSHUFFLE: "bitshuffle",
22-
DELTA: "delta",
23-
TRUNC_PREC: "trun_prec",
24-
}
2517

2618
# Public API for container module
2719
from .utils import (compress, decompress, set_compressor, free_resources, set_nthreads,
@@ -32,6 +24,15 @@
3224
from .blosc2_ext import MAX_TYPESIZE, MAX_BUFFERSIZE, VERSION_STRING, VERSION_DATE
3325
blosclib_version = "%s (%s)" % (VERSION_STRING, VERSION_DATE)
3426

27+
# Filter names
28+
filter_names = {
29+
NOFILTER: "nofilter",
30+
SHUFFLE: "shuffle",
31+
BITSHUFFLE: "bitshuffle",
32+
DELTA: "delta",
33+
TRUNC_PREC: "trun_prec",
34+
}
35+
3536
# Internal Blosc threading
3637
nthreads = ncores = detect_number_of_cores()
3738
# Protection against too many cores

blosc2/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def compress(src, typesize=8, clevel=9, shuffle=blosc2_ext.SHUFFLE, cname='blosc
6464
The name of the compressor used internally in Blosc. It can be
6565
any of the supported by Blosc ( `blosclz` , `lz4` , `lz4hc` ,
6666
`zlib` , `zstd` and maybe others too). The default is
67-
`blosclz` .
67+
`blosclz` .
6868
6969
Returns
7070
-------
@@ -240,12 +240,12 @@ def unpack(packed_object, **kwargs):
240240
>>> len(parray) < a.size*a.itemsize
241241
True
242242
>>> a2 = blosc2.unpack(parray)
243-
>>> numpy.alltrue(a == a2)
243+
>>> numpy.array_equal(a, a2)
244244
True
245245
>>> a = numpy.array(['å', 'ç', 'ø'])
246246
>>> parray = blosc2.pack(a)
247247
>>> a2 = blosc2.unpack(parray)
248-
>>> numpy.alltrue(a == a2)
248+
>>> numpy.array_equal(a, a2)
249249
True
250250
"""
251251
pickled_object = decompress(packed_object)
@@ -336,12 +336,12 @@ def unpack_array(packed_array, **kwargs):
336336
>>> len(parray) < a.size*a.itemsize
337337
True
338338
>>> a2 = blosc2.unpack_array(parray)
339-
>>> numpy.alltrue(a == a2)
339+
>>> numpy.array_equal(a, a2)
340340
True
341341
>>> a = numpy.array(['å', 'ç', 'ø'])
342342
>>> parray = blosc2.pack_array(a)
343343
>>> a2 = blosc2.unpack_array(parray)
344-
>>> numpy.alltrue(a == a2)
344+
>>> numpy.array_equal(a, a2)
345345
True
346346
"""
347347
pickled_array = decompress(packed_array)

doc/_static/css/custom.css

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
:root {
2+
/*****************************************************************************
3+
* Theme config
4+
**/
5+
--pst-header-height: 60px;
6+
7+
/*****************************************************************************
8+
* Font size
9+
**/
10+
--pst-font-size-base: 15px; /* base font size - applied at body / html level */
11+
12+
/* heading font sizes */
13+
--pst-font-size-h1: 36px;
14+
--pst-font-size-h2: 32px;
15+
--pst-font-size-h3: 26px;
16+
--pst-font-size-h4: 21px;
17+
--pst-font-size-h5: 18px;
18+
--pst-font-size-h6: 16px;
19+
20+
/* smaller then heading font sizes*/
21+
--pst-font-size-milli: 12px;
22+
23+
--pst-sidebar-font-size: .9em;
24+
--pst-sidebar-caption-font-size: .9em;
25+
26+
/*****************************************************************************
27+
* Font family
28+
**/
29+
/* These are adapted from https://systemfontstack.com/ */
30+
--pst-font-family-base-system: -apple-system, BlinkMacSystemFont, Segoe UI, "Helvetica Neue",
31+
Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
32+
--pst-font-family-monospace-system: "SFMono-Regular", Menlo, Consolas, Monaco,
33+
Liberation Mono, Lucida Console, monospace;
34+
35+
--pst-font-family-base: var(--pst-font-family-base-system);
36+
--pst-font-family-heading: var(--pst-font-family-base);
37+
--pst-font-family-monospace: var(--pst-font-family-monospace-system);
38+
39+
/*****************************************************************************
40+
* Color
41+
*
42+
* Colors are defined in rgb string way, "red, green, blue"
43+
**/
44+
--pst-color-primary: 3, 134, 150;
45+
--pst-color-primary-dark: 2, 89, 100;
46+
--pst-color-secondary: 230, 169, 10;
47+
--pst-color-success: 40, 167, 69;
48+
--pst-color-info: 0, 123, 255; /*23, 162, 184;*/
49+
--pst-color-warning: 255, 193, 7;
50+
--pst-color-danger: 220, 53, 69;
51+
--pst-color-text-base: 51, 51, 51;
52+
53+
--pst-color-h1: var(--pst-color-primary-dark);
54+
--pst-color-h2: var(--pst-color-primary-dark);
55+
--pst-color-h3: var(--pst-color-text-base);
56+
--pst-color-h4: var(--pst-color-text-base);
57+
--pst-color-h5: var(--pst-color-text-base);
58+
--pst-color-h6: var(--pst-color-text-base);
59+
--pst-color-paragraph: var(--pst-color-text-base);
60+
--pst-color-link: var(--pst-color-primary);
61+
--pst-color-link-hover: var(--pst-color-secondary);
62+
--pst-color-headerlink: var(--pst-color-primary);
63+
--pst-color-headerlink-hover: 255, 255, 255;
64+
--pst-color-preformatted-text: 34, 34, 34;
65+
--pst-color-preformatted-background: 250, 250, 250;
66+
--pst-color-inline-code: var(--pst-color-primary);
67+
68+
--pst-color-active-navigation: var(--pst-color-secondary);
69+
--pst-color-navbar-link: 77, 77, 77;
70+
--pst-color-navbar-link-hover: var(--pst-color-active-navigation);
71+
--pst-color-navbar-link-active: var(--pst-color-active-navigation);
72+
--pst-color-sidebar-link: 77, 77, 77;
73+
--pst-color-sidebar-link-hover: var(--pst-color-active-navigation);
74+
--pst-color-sidebar-link-active: var(--pst-color-active-navigation);
75+
--pst-color-sidebar-expander-background-hover: 244, 244, 244;
76+
--pst-color-sidebar-caption: 77, 77, 77;
77+
--pst-color-toc-link: 119, 117, 122;
78+
--pst-color-toc-link-hover: var(--pst-color-active-navigation);
79+
--pst-color-toc-link-active: var(--pst-color-active-navigation);
80+
81+
/*****************************************************************************
82+
* Icon
83+
**/
84+
85+
/* font awesome icons*/
86+
--pst-icon-check-circle: '\f058';
87+
--pst-icon-info-circle: '\f05a';
88+
--pst-icon-exclamation-triangle: '\f071';
89+
--pst-icon-exclamation-circle: '\f06a';
90+
--pst-icon-times-circle: '\f057';
91+
--pst-icon-lightbulb: '\f0eb';
92+
93+
/*****************************************************************************
94+
* Admonitions
95+
**/
96+
97+
--pst-color-admonition-default: var(--pst-color-info);
98+
--pst-color-admonition-note: var(--pst-color-info);
99+
--pst-color-admonition-attention: var(--pst-color-warning);
100+
--pst-color-admonition-caution: var(--pst-color-warning);
101+
--pst-color-admonition-warning: var(--pst-color-warning);
102+
--pst-color-admonition-danger: var(--pst-color-danger);
103+
--pst-color-admonition-error: var(--pst-color-danger);
104+
--pst-color-admonition-hint: var(--pst-color-success);
105+
--pst-color-admonition-tip: var(--pst-color-success);
106+
--pst-color-admonition-important: var(--pst-color-success);
107+
108+
--pst-icon-admonition-default: var(--pst-icon-info-circle);
109+
--pst-icon-admonition-note: var(--pst-icon-info-circle);
110+
--pst-icon-admonition-attention: var(--pst-icon-exclamation-circle);
111+
--pst-icon-admonition-caution: var(--pst-icon-exclamation-triangle);
112+
--pst-icon-admonition-warning: var(--pst-icon-exclamation-triangle);
113+
--pst-icon-admonition-danger: var(--pst-icon-exclamation-triangle);
114+
--pst-icon-admonition-error: var(--pst-icon-times-circle);
115+
--pst-icon-admonition-hint: var(--pst-icon-lightbulb);
116+
--pst-icon-admonition-tip: var(--pst-icon-lightbulb);
117+
--pst-icon-admonition-important: var(--pst-icon-exclamation-circle);
118+
119+
}

doc/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,7 @@
5858
# Add any paths that contain custom static files (such as style sheets) here,
5959
# relative to this directory. They are copied after the builtin static files,
6060
# so a file named "default.css" will overwrite the builtin "default.css".
61-
html_static_path = ['_static']
61+
62+
html_css_files = [
63+
'css/custom.css',
64+
]

requirements-tests.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
pytest~=6.2.2
2-
numpy~=1.20.1

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
scikit-build>=0.11.1
22
cython>=0.29
3-
py-cpuinfo
3+
py-cpuinfo
4+
numpy~=1.20.1

0 commit comments

Comments
 (0)