Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 71 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import numpy as np

import blosc2
from blosc2.utils import constructors, elementwise_funcs, reducers


def genbody(f, func_list, lib="blosc2"):
Expand Down Expand Up @@ -99,7 +100,7 @@ def genbody(f, func_list, lib="blosc2"):

Their result is always a :ref:`LazyExpr` instance, which can be evaluated (with ``compute`` or ``__getitem__``) to get the actual values of the computation.

Note: The functions ``conj``, ``real``, ``imag``, ``contains``, ``where`` are not technically ufuncs.
Note: The functions ``real``, ``imag``, ``contains``, ``where`` are not technically ufuncs.

.. currentmodule:: blosc2

Expand All @@ -110,7 +111,7 @@ def genbody(f, func_list, lib="blosc2"):
genbody(f, blosc2_ufuncs)

# GENERATE additional_funcs.rst
blosc2_addfuncs = sorted(["conj", "real", "imag", "contains", "where", "clip", "round"])
blosc2_addfuncs = sorted(set(elementwise_funcs) - set(blosc2_ufuncs))
blosc2_dtypefuncs = sorted(["astype", "can_cast", "result_type", "isdtype"])

with open("reference/additional_funcs.rst", "w") as f:
Expand All @@ -133,7 +134,9 @@ def genbody(f, func_list, lib="blosc2"):
)
genbody(f, blosc2_addfuncs)
f.write(
"""Type Utilities
"""

Type Utilities
--------------

The following functions are useful for working with datatypes.
Expand All @@ -158,12 +161,14 @@ def genbody(f, func_list, lib="blosc2"):
"broadcast_to",
"meshgrid",
"indices",
"concat",
"stack",
]
)

with open("reference/index_funcs.rst", "w") as f:
f.write(
"""Indexing Functions and Utilities
"""Indexing and Manipulation Functions and Utilities
=======================================

The following functions are useful for performing indexing and other associated operations.
Expand Down Expand Up @@ -195,7 +200,68 @@ def genbody(f, func_list, lib="blosc2"):

"""
)
genbody(f, linalg_funcs, "blosc2.linalg")
genbody(f, sorted(linalg_funcs), "blosc2.linalg")

with open("reference/reduction_functions.rst", "w") as f:
f.write(
"""Reduction Functions
-------------------

Contrarily to lazy functions, reduction functions are evaluated eagerly, and the result is always a NumPy array (although this can be converted internally into an :ref:`NDArray <NDArray>` if you pass any :func:`blosc2.empty` arguments in ``kwargs``).

Reduction operations can be used with any of :ref:`NDArray <NDArray>`, :ref:`C2Array <C2Array>`, :ref:`NDField <NDField>` and :ref:`LazyExpr <LazyExpr>`. Again, although these can be part of a :ref:`LazyExpr <LazyExpr>`, you must be aware that they are not lazy, but will be evaluated eagerly during the construction of a LazyExpr instance (this might change in the future). When the input is a :ref:`LazyExpr`, reductions accept ``fp_accuracy`` to control floating-point accuracy, and it is forwarded to :func:`LazyExpr.compute`.

.. currentmodule:: blosc2

.. autosummary::

"""
)
genbody(f, sorted(reducers))

with open("reference/ndarray.rst", "w") as f:
f.write(
""".. _NDArray:

NDArray
=======

The multidimensional data array class. Instances may be constructed using the constructor functions in the list below `NDArrayConstructors`_.
In addition, all the functions from the :ref:`Lazy Functions <lazy_functions>` section can be used with NDArray instances.

.. currentmodule:: blosc2

.. autoclass:: NDArray
:members:
:inherited-members:
:exclude-members: get_slice, set_slice, get_slice_numpy, get_oindex_numpy, set_oindex_numpy
:member-order: groupwise

:Special Methods:

.. autosummary::

__iter__
__len__
__getitem__
__setitem__

Utility Methods
---------------

.. automethod:: __iter__
.. automethod:: __len__
.. automethod:: __getitem__
.. automethod:: __setitem__

Constructors
------------
.. _NDArrayConstructors:
.. autosummary::

"""
)
genbody(f, sorted(constructors))

hidden = "_ignore_multiple_size"

Expand Down
6 changes: 4 additions & 2 deletions doc/reference/additional_funcs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Their result is typically a :ref:`LazyExpr` instance, which can be evaluated (wi

.. autosummary::

broadcast_to
clip
conj
contains
imag
real
Expand All @@ -22,13 +22,15 @@ Their result is typically a :ref:`LazyExpr` instance, which can be evaluated (wi



.. autofunction:: blosc2.broadcast_to
.. autofunction:: blosc2.clip
.. autofunction:: blosc2.conj
.. autofunction:: blosc2.contains
.. autofunction:: blosc2.imag
.. autofunction:: blosc2.real
.. autofunction:: blosc2.round
.. autofunction:: blosc2.where


Type Utilities
--------------

Expand Down
2 changes: 1 addition & 1 deletion doc/reference/index_funcs.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Indexing Functions and Utilities
Indexing and Manipulation Functions and Utilities
=======================================

The following functions are useful for performing indexing and other associated operations.
Expand Down
20 changes: 10 additions & 10 deletions doc/reference/linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ The following functions can be used for computing linear algebra operations with

.. autosummary::

diagonal
matmul
tensordot
vecdot
permute_dims
transpose
matrix_transpose
diagonal
outer
permute_dims
tensordot
transpose
vecdot



.. autofunction:: blosc2.linalg.diagonal
.. autofunction:: blosc2.linalg.matmul
.. autofunction:: blosc2.linalg.tensordot
.. autofunction:: blosc2.linalg.vecdot
.. autofunction:: blosc2.linalg.permute_dims
.. autofunction:: blosc2.linalg.transpose
.. autofunction:: blosc2.linalg.matrix_transpose
.. autofunction:: blosc2.linalg.diagonal
.. autofunction:: blosc2.linalg.outer
.. autofunction:: blosc2.linalg.permute_dims
.. autofunction:: blosc2.linalg.tensordot
.. autofunction:: blosc2.linalg.transpose
.. autofunction:: blosc2.linalg.vecdot
5 changes: 4 additions & 1 deletion doc/reference/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This page documents the miscellaneous members of the ``blosc2`` module that do n
:members:
:exclude-members: LazyArray,
LazyExpr,
LazyUDF,
lazyexpr,
lazyudf,
evaluate,
Expand Down Expand Up @@ -227,4 +228,6 @@ This page documents the miscellaneous members of the ``blosc2`` module that do n
round,
are_partitions_aligned,
are_partitions_behaved,
indices
indices,
cumulative_sum,
cumulative_prod,
50 changes: 24 additions & 26 deletions doc/reference/ndarray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@ Constructors

arange
asarray
concat
copy
empty
empty_like
expand_dims
eye
frombuffer
fromiter
fromiter
full
full_like
linspace
Expand All @@ -55,31 +54,30 @@ Constructors
ones
ones_like
reshape
stack
squeeze
uninit
zeros
zeros_like

.. autofunction:: arange
.. autofunction:: asarray
.. autofunction:: concat
.. autofunction:: copy
.. autofunction:: empty
.. autofunction:: empty_like
.. autofunction:: expand_dims
.. autofunction:: eye
.. autofunction:: frombuffer
.. autofunction:: fromiter
.. autofunction:: full
.. autofunction:: full_like
.. autofunction:: linspace
.. autofunction:: nans
.. autofunction:: ndarray_from_cframe
.. autofunction:: ones
.. autofunction:: ones_like
.. autofunction:: reshape
.. autofunction:: stack
.. autofunction:: uninit
.. autofunction:: zeros
.. autofunction:: zeros_like


.. autofunction:: blosc2.arange
.. autofunction:: blosc2.asarray
.. autofunction:: blosc2.copy
.. autofunction:: blosc2.empty
.. autofunction:: blosc2.empty_like
.. autofunction:: blosc2.eye
.. autofunction:: blosc2.frombuffer
.. autofunction:: blosc2.fromiter
.. autofunction:: blosc2.fromiter
.. autofunction:: blosc2.full
.. autofunction:: blosc2.full_like
.. autofunction:: blosc2.linspace
.. autofunction:: blosc2.meshgrid
.. autofunction:: blosc2.nans
.. autofunction:: blosc2.ndarray_from_cframe
.. autofunction:: blosc2.ones
.. autofunction:: blosc2.ones_like
.. autofunction:: blosc2.reshape
.. autofunction:: blosc2.uninit
.. autofunction:: blosc2.zeros
.. autofunction:: blosc2.zeros_like
42 changes: 25 additions & 17 deletions doc/reference/reduction_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,32 @@ Reduction operations can be used with any of :ref:`NDArray <NDArray>`, :ref:`C2A

all
any
sum
prod
argmax
argmin
count_nonzero
cumulative_prod
cumulative_sum
max
mean
min
prod
std
sum
var
min
max
argmin
argmax

.. autofunction:: all
.. autofunction:: any
.. autofunction:: sum
.. autofunction:: prod
.. autofunction:: mean
.. autofunction:: std
.. autofunction:: var
.. autofunction:: min
.. autofunction:: max
.. autofunction:: argmin
.. autofunction:: argmax


.. autofunction:: blosc2.all
.. autofunction:: blosc2.any
.. autofunction:: blosc2.argmax
.. autofunction:: blosc2.argmin
.. autofunction:: blosc2.count_nonzero
.. autofunction:: blosc2.cumulative_prod
.. autofunction:: blosc2.cumulative_sum
.. autofunction:: blosc2.max
.. autofunction:: blosc2.mean
.. autofunction:: blosc2.min
.. autofunction:: blosc2.prod
.. autofunction:: blosc2.std
.. autofunction:: blosc2.sum
.. autofunction:: blosc2.var
2 changes: 1 addition & 1 deletion doc/reference/ufuncs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following elementwise functions can be used for computing with any of :ref:`

Their result is always a :ref:`LazyExpr` instance, which can be evaluated (with ``compute`` or ``__getitem__``) to get the actual values of the computation.

Note: The functions ``conj``, ``real``, ``imag``, ``contains``, ``where`` are not technically ufuncs.
Note: The functions ``real``, ``imag``, ``contains``, ``where`` are not technically ufuncs.

.. currentmodule:: blosc2

Expand Down
4 changes: 4 additions & 0 deletions src/blosc2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@ def _raise(exc):
cos,
cosh,
count_nonzero,
cumulative_prod,
cumulative_sum,
divide,
equal,
exp,
Expand Down Expand Up @@ -719,6 +721,8 @@ def _raise(exc):
"count_nonzero",
"cparams_dflts",
"cpu_info",
"cumulative_prod",
"cumulative_sum",
"decompress",
"decompress2",
"detect_number_of_cores",
Expand Down
Loading
Loading