Open
Description
π New repository
Here is the associated repository: https://github.com/DataLab-Platform/sigima
β¨ Objective
Create a standalone Python package named datalab-processing
that consolidates the computation engine, data I/O logic (except HDF5), and the simple XML-RPC client for DataLab.
This package will serve as the non-GUI backend for DataLab, and provide reusable functionality for headless applications and remote control workflows.
π§ Scope of sigima
The datalab-processing
package will include:
- π§ Signal and image processing logic (
BaseProcessor
,SignalProcessor
,ImageProcessor
) - ποΈ I/O and file format support for signals and images (except HDF5)
- π§© I/O plugin system (moved out of the GUI package)
- π§ͺ Internal validation and test datasets (optional)
- π¦ Type annotations and compatibility with
mypy
,pytest
, and other quality tools
Options (to be discussed):
- π°οΈ Lightweight XML-RPC client to control a remote instance of DataLab
Note: HDF5 file handling will temporarily remain in datalab-app
, but all other input/output logic (including the plugin mechanism for custom readers/writers) will be moved to sigima
.
β
To Extract into sigima
1. cdl.algorithms
- β All core functions operating on raw NumPy arrays
- π Refactored under
sigima.algorithms
2. cdl.computation
- β
All functions operating on
SignalObj
andImageObj
- π Refactored into two top-level modules:
sigima.signal
β forSignalObj
-based operationssigima.image
β forImageObj
-based operations
3. cdl.core.model
- β³ Partially extract:
SignalObj
,ImageObj
- Other basic computation-related objects (e.g. wrappers for result types)
- β Leave GUI- or application-specific classes in DataLab
- π Refactored under
sigima.datatypes
4. cdl.core.io
- β³ Partially extract:
- I/O for signals/images that are not tied to HDF5 or GUI persistence
- β Exclude HDF5-specific or GUI-related I/O
- π Refactored under
sigima.io
5. cdl.plugins
- β Do not reuse existing plugin classes (tightly coupled to DataLab GUI)
- β
Instead, define a clean plugin interface under
sigima.plugins
- For extendable compute operations
6. cdl.tests
- β
Migrate tests related to:
cdl.algorithms
cdl.computation
- π Refactor under
tests/
insigima
, preserving coverage
7. cdl.utils
- β³ Only migrate utility functions strictly required by above modules
- π Refactor and isolate as
sigima.utils
(minimal)
8. Test Infrastructure & Data
- β
Migrate reusable parts:
tests.data/
- Core test helpers
- CI-compatible test layout
π Refactoring Considerations
- β
Isolate any dependency on
cdl.config
,cdl.qt
, orcdl.app
- β Ensure standalone execution with no Qt/UI import chain
- β
Prepare
pyproject.toml
with optionalplugin
extras
π Proposed Package Layout
sigima/
βββ algorithms/ # NumPy-based processing functions
βββ signal/ # SignalObj-based operations (e.g., normalize, filter, resample)
β βββ __init__.py
β βββ processing.py
βββ image/ # ImageObj-based operations (e.g., ROI, threshold, morphology)
β βββ __init__.py
β βββ filters.py
βββ datatypes/ # SignalObj, ImageObj, Result wrappers
βββ io/ # Portable I/O for signal/image
βββ plugins/ # Plugin architecture for compute functions
βββ utils/ # Minimal utilities used by core modules
βββ tests/ # Pytest-compatible test suite
β βββ data/ # Test images/signals
β βββ ...
βββ __init__.py
βββ pyproject.toml
π Notes
- The name
sigima
emphasizes the unification of signal and image processing logic. - GUI-specific functionality remains in
datalab-app
. - The library will be MIT-licensed and documented as a reusable scientific computing core.
- With this structure, common imports become clean and readable:
from sigima.signal import normalize
from sigima.image import enhance_contrast
π§ Tasks
- Extract computation and non-HDF5 I/O logic from
cdl/
intosigima/
- Migrate the plugin-based I/O mechanism for signals/images
- Clean up internal dependencies and prepare
pyproject.toml
structure - (eventually) Integrate the simple XML-RPC client (previously
cdlclient
) - Write unit tests and CI configuration (GitHub Actions)
- Add Sphinx documentation and usage examples
- Publish to PyPI as
sigima
π Context
This package replaces and unifies:
- the computational backend of the original DataLab codebase (
cdl
) - (eventually) the external
cdlclient
RPC wrapper - the future programmatic API surface of DataLab (headless usage, scripting, integration)
It complements:
datalab-app
: GUI frontend (HDF5 support remains here temporarily)sigimax
: reusable GUI components and infrastructure