Coverage for openhcs/core/memory/__init__.py: 100.0%

9 statements  

« prev     ^ index     » next       coverage.py v7.10.3, created at 2025-08-14 05:57 +0000

1""" 

2Memory module for OpenHCS. 

3 

4This module provides classes and utilities for working with in-memory data arrays 

5with explicit type declarations and conversion methods, enforcing Clause 251 

6(Declarative Memory Conversion Interface) and Clause 106-A (Declared Memory Types). 

7""" 

8 

9from openhcs.constants.constants import MemoryType 

10 

11from .decorators import cupy, jax, memory_types, numpy, tensorflow, torch 

12from .wrapper import MemoryWrapper 

13 

14# Define memory type constants 

15MEMORY_TYPE_NUMPY = MemoryType.NUMPY.value 

16MEMORY_TYPE_CUPY = MemoryType.CUPY.value 

17MEMORY_TYPE_TORCH = MemoryType.TORCH.value 

18MEMORY_TYPE_TENSORFLOW = MemoryType.TENSORFLOW.value 

19MEMORY_TYPE_JAX = MemoryType.JAX.value 

20 

21__all__ = [ 

22 'MemoryWrapper', 

23 'MEMORY_TYPE_NUMPY', 

24 'MEMORY_TYPE_CUPY', 

25 'MEMORY_TYPE_TORCH', 

26 'MEMORY_TYPE_TENSORFLOW', 

27 'MEMORY_TYPE_JAX', 

28 'memory_types', 

29 'numpy', 

30 'cupy', 

31 'torch', 

32 'tensorflow', 

33 'jax', 

34]