Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
128954c
Correct handling of disable_overloaded_equal
lshaw8317 Sep 12, 2025
7d54fe4
Finetune handling of disable_overloaded_equal
lshaw8317 Sep 12, 2025
15310df
Adding meshgrid
lshaw8317 Sep 12, 2025
607ba6d
Fix matrix_transpose/permute_dims to accept np.ndarray
lshaw8317 Sep 12, 2025
78f8f54
Add matmul support for N-D arrays, modify squeeze to comply with arra…
lshaw8317 Sep 12, 2025
da27d58
Added tensordot, need to optimise
lshaw8317 Sep 15, 2025
7cd11d6
Fix bug in tensordot and optimise slightly
lshaw8317 Sep 16, 2025
515d597
Added vecdot function
lshaw8317 Sep 16, 2025
6c84cee
Fix vecdot bug, add vecdot tests, rename test_matmul file
lshaw8317 Sep 17, 2025
a81215e
Add aliases and where method to Operand
lshaw8317 Sep 17, 2025
b6b90d1
Fix asarray to avoid weird view behaviour
lshaw8317 Sep 17, 2025
4bc8d6f
Add properties and functions, organise linalg tests
lshaw8317 Sep 17, 2025
073d74f
Fix typo
lshaw8317 Sep 17, 2025
5baedd5
Fix typo
lshaw8317 Sep 17, 2025
1a4d82f
Fix typo
lshaw8317 Sep 17, 2025
59eeb53
Merge branch 'main' into arrayapi
lshaw8317 Sep 17, 2025
e522f0d
Adding functions
lshaw8317 Sep 18, 2025
ef27f73
Adding more functions
lshaw8317 Sep 18, 2025
5b11306
Adding functions, linalg module
lshaw8317 Sep 19, 2025
8435178
Add fft module
lshaw8317 Sep 19, 2025
a416e45
Add necessary linalg imports
lshaw8317 Sep 19, 2025
e92596c
Add dummy fft funcs
lshaw8317 Sep 19, 2025
166f51c
Fixing linalg funcs
lshaw8317 Sep 19, 2025
2280ba0
Add various elementwise functions from numexpr
lshaw8317 Sep 23, 2025
1d67ff0
Add logaddexp, clip functions
lshaw8317 Sep 23, 2025
59f1458
Editing take and take_along_axis
lshaw8317 Sep 23, 2025
0d4d56b
Add tests for elementwise functions
lshaw8317 Sep 25, 2025
033049f
Add test file
lshaw8317 Sep 25, 2025
62c2837
Improving documentation
lshaw8317 Sep 25, 2025
f8ae851
Adding new doc files
lshaw8317 Sep 25, 2025
a609e36
Finish documentation
lshaw8317 Sep 26, 2025
5d67ab9
Add new rst files
lshaw8317 Sep 26, 2025
696d35f
Added take tests
lshaw8317 Sep 26, 2025
cbbe99c
Relax tests for NaN handling
lshaw8317 Sep 26, 2025
a9705eb
Bumpy numexpr and c-blosc2 versions
lshaw8317 Sep 26, 2025
b2c062e
Fix bitwise_shift tests
lshaw8317 Sep 26, 2025
48c7dec
Recomment line
lshaw8317 Sep 26, 2025
ea3090f
Fix generator
lshaw8317 Sep 26, 2025
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else()
include(FetchContent)
FetchContent_Declare(blosc2
GIT_REPOSITORY https://github.com/Blosc/c-blosc2
GIT_TAG 82a85f9d285d7ae6d141c73e84c7574bfc24a134 # v2.21.2
GIT_TAG 0c853a639ba97997e33e29db9eed202459ebc6f0 # v2.21.3
)
FetchContent_MakeAvailable(blosc2)
include_directories("${blosc2_SOURCE_DIR}/include")
Expand Down
127 changes: 127 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
# -- Path setup --------------------------------------------------------------
import inspect
import os
import sys

import numpy as np

import blosc2


def genbody(f, func_list, lib="blosc2"):
for func in func_list:
f.write(f" {func}\n")

f.write("\n\n\n")
for func in func_list:
f.write(f".. autofunction:: {lib}.{func}\n\n")


sys.path.insert(0, os.path.abspath(os.path.dirname(blosc2.__file__)))

project = "Python-Blosc2"
Expand Down Expand Up @@ -69,6 +82,120 @@
html_show_sourcelink = False

autosummary_generate_overwrite = False
autosummary_generate = True

# GENERATE ufuncs.rst
blosc2_ufuncs = []
for name, obj in vars(np).items():
if isinstance(obj, np.ufunc) and hasattr(blosc2, name):
blosc2_ufuncs.append(name)

with open("reference/ufuncs.rst", "w") as f:
f.write(
"""Universal Functions (`ufuncs`)
------------------------------

The following elementwise functions can be used for computing with any of :ref:`NDArray <NDArray>`, :ref:`C2Array <C2Array>`, :ref:`NDField <NDField>` and :ref:`LazyExpr <LazyExpr>`.

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.

.. currentmodule:: blosc2

.. autosummary::

"""
)
genbody(f, blosc2_ufuncs)

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

with open("reference/additional_funcs.rst", "w") as f:
f.write(
"""Additional Functions and Type Utilities
=======================================

Functions
---------

The following functions can also be used for computing with any of :ref:`NDArray <NDArray>`, :ref:`C2Array <C2Array>`, :ref:`NDField <NDField>` and :ref:`LazyExpr <LazyExpr>`.

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

.. currentmodule:: blosc2

.. autosummary::

"""
)
genbody(f, blosc2_addfuncs)
f.write(
"""Type Utilities
--------------

The following functions are useful for working with datatypes.

.. currentmodule:: blosc2

.. autosummary::

"""
)
genbody(f, blosc2_dtypefuncs)

# GENERATE index_funcs.rst
blosc2_indexfuncs = sorted(
[
"count_nonzero",
"squeeze",
"expand_dims",
"sort",
"take",
"take_along_axis",
"broadcast_to",
"meshgrid",
"indices",
]
)

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

The following functions are useful for performing indexing and oter associated operations.

.. currentmodule:: blosc2

.. autosummary::

"""
)
genbody(f, blosc2_indexfuncs)

# GENERATE linear_algebra.rst
linalg_funcs = [
name
for name, obj in vars(blosc2.linalg).items()
if (inspect.isfunction(obj) and getattr(obj, "__doc__", None))
]

with open("reference/linalg.rst", "w") as f:
f.write(
"""Linear Algebra
-----------------
The following functions can be used for computing linear algebra operations with :ref:`NDArray <NDArray>`.

.. currentmodule:: blosc2.linalg

.. autosummary::

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

hidden = "_ignore_multiple_size"

Expand Down
61 changes: 61 additions & 0 deletions doc/reference/additional_funcs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Additional Functions and Type Utilities
=======================================

Functions
---------

The following functions can also be used for computing with any of :ref:`NDArray <NDArray>`, :ref:`C2Array <C2Array>`, :ref:`NDField <NDField>` and :ref:`LazyExpr <LazyExpr>`.

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

.. currentmodule:: blosc2

.. autosummary::

clip
conj
contains
imag
real
round
where



.. autofunction:: blosc2.clip

.. autofunction:: blosc2.conj

.. autofunction:: blosc2.contains

.. autofunction:: blosc2.imag

.. autofunction:: blosc2.real

.. autofunction:: blosc2.round

.. autofunction:: blosc2.where

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

The following functions are useful for working with datatypes.

.. currentmodule:: blosc2

.. autosummary::

astype
can_cast
isdtype
result_type



.. autofunction:: blosc2.astype

.. autofunction:: blosc2.can_cast

.. autofunction:: blosc2.isdtype

.. autofunction:: blosc2.result_type
6 changes: 4 additions & 2 deletions doc/reference/array_operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Operations with arrays
.. toctree::
:maxdepth: 1

lazy_functions
ufuncs
reduction_functions
linear_algebra
linalg
additional_funcs
index_funcs
38 changes: 38 additions & 0 deletions doc/reference/index_funcs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Indexing Functions and Utilities
=======================================

The following functions are useful for performing indexing and oter associated operations.

.. currentmodule:: blosc2

.. autosummary::

broadcast_to
count_nonzero
expand_dims
indices
meshgrid
sort
squeeze
take
take_along_axis



.. autofunction:: blosc2.broadcast_to

.. autofunction:: blosc2.count_nonzero

.. autofunction:: blosc2.expand_dims

.. autofunction:: blosc2.indices

.. autofunction:: blosc2.meshgrid

.. autofunction:: blosc2.sort

.. autofunction:: blosc2.squeeze

.. autofunction:: blosc2.take

.. autofunction:: blosc2.take_along_axis
63 changes: 0 additions & 63 deletions doc/reference/lazy_functions.rst

This file was deleted.

34 changes: 34 additions & 0 deletions doc/reference/linalg.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Linear Algebra
-----------------
The following functions can be used for computing linear algebra operations with :ref:`NDArray <NDArray>`.

.. currentmodule:: blosc2.linalg

.. autosummary::

matmul
tensordot
vecdot
permute_dims
transpose
matrix_transpose
diagonal
outer



.. 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
17 changes: 0 additions & 17 deletions doc/reference/linear_algebra.rst

This file was deleted.

Loading
Loading