Metadata-Version: 2.4
Name: numba-toolbox
Version: 0.1.0
Summary: A toolbox for Numba projects, currently providing mutable scalar helpers.
Project-URL: Homepage, https://github.com/cognitive-modeling/numba-toolbox
Project-URL: Issues, https://github.com/cognitive-modeling/numba-toolbox/issues
Project-URL: Repository, https://github.com/cognitive-modeling/numba-toolbox
Author: Dominik Magiera
License-Expression: MIT
License-File: LICENSE
Keywords: jit,numba,numpy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: numba
Description-Content-Type: text/markdown

# Numba Toolbox

Numba Toolbox is a small, growing collection of reusable helpers for Numba-based projects.
The toolbox will expand as new shared needs emerge.

## Installation

```console
pip install numba-toolbox
```

## Mutable scalars

The current feature set provides mutable scalar values for use in Numba-compiled code.
They are useful when a value is stored inside an immutable container, such as a named tuple, but still needs to be updated without replacing the container or rebinding the value.

```python
from typing import NamedTuple

from numba import jit
from numba_toolbox import MutableInt32, mutable_int32

class State(NamedTuple):
    counter: MutableInt32

state = State(counter=mutable_int32(0))

@jit
def increment(state):
    state.counter.value += 1

increment(state)
assert state.counter.value == 1
```

Factories are currently available for mutable booleans and signed or unsigned integers with 8-, 16-, 32-, and 64-bit storage.


## Future direction

Additional utilities will be added when they solve recurring needs across our Numba-based projects.
