Placeholder Python package for the sqzc3d C/C++ library (bindings upcoming).
Project description
Squeezed C3D (sqzc3d)
Squeezed C3D (sqzc3d) is a small C/C++ library for:
- parsing C3D point/analog data,
- building compact chunk structures,
- querying selected markers/channels by index/label,
- exporting/importing persisted bundle files.
It is designed as a pure dependency for higher-level projects (for example sikc) and keeps a minimal runtime API surface.
Why Squeezed C3D
Why Squeezed C3D (benchmark intent)
Only performance-relevant signals are shown:
- Chunk materialize: build a compact, contiguous
doublebuffer[frame][point][3](+ valid mask). - Access patterns: copy/extract frame & window outputs, marker-trajectory access, reorder (frame-major -> point-major).
- Peak memory: avoid a full object graph; keep only needed arrays.
Bench method: fully load a C3D file, then measure access patterns on each library's native loaded representation.
For sqzc3d, the native representation is the chunk's contiguous frame-major array; for ezc3d, it is
ezc3d::c3d's in-memory frame/point containers. Numbers below are from the C++ sample benches (repeat=1):
bench_sqzc3d <file.c3d> 1bench_ezc3d <file.c3d> 1
Load & memory (C++)
| Dataset | Frames | Points | sqzc3d load_ms |
ezc3d load_ms |
load_speedup_x |
sqzc3d peak_rss_mb |
ezc3d peak_rss_mb |
rss_ratio_x |
|---|---|---|---|---|---|---|---|---|
| PFERD (117.96 MB) | 55,844 | 132 | 171.385 | 3,717.442 | 21.7 | 182.090 | 1,019.414 | 5.6 |
load_speedup_x = ezc3d / sqzc3d, rss_ratio_x = ezc3d / sqzc3d (higher is better for sqzc3d).
Access patterns (native, after load; PFERD, T=256)
All numbers are per-operation milliseconds unless noted.
| Metric | sqzc3d | ezc3d | speedup_x |
|---|---|---|---|
frame_view_ns_kall (ns/op) |
4.196 | 76.054 | 18.1x |
frame_copy_ms_kall |
0.000096 | 0.002589 | 27.0x |
window_read_ms_T256_kall |
0.009656 | 0.143652 | 14.9x |
traj_strided_ms_T256_kall |
0.075748 | 0.228896 | 3.0x |
traj_strided_ms_Tfull_k1 |
0.132440 | 3.362906 | 25.4x |
reorder_ms_T256_kall |
0.132432 | 0.167740 | 1.27x |
sel_apply_ms_T256_k32 |
0.005532 | 0.046642 | 8.4x |
speedup_x = ezc3d / sqzc3d (higher is better for sqzc3d).
Streaming mode (sqzc3d-only, low memory)
Optional extreme low-memory mode that reads from the file on demand (e.g. WASM VFS):
bench_sqzc3d_stream <file.c3d> 1
Example (PFERD, repeat=1):
| Metric | sqzc3d stream |
|---|---|
open_ms |
1.289 |
peak_rss_delta_mb |
2.762 |
read_window_ms_T256_kall |
0.532 |
read_window_ms_T256_k32 |
0.889 |
Feature profile
- Core + easy split: stable C API (
sqzc3d.h) plus ergonomic C++ helper layer (sqzc3d_easy.h). - Preset-first workflow: shared presets for common read patterns.
- Chunk-first runtime contracts: frame-major point arrays + explicit valid mask.
- Type-group aware filtering:
type_group_*metadata for marker set control. - Build split:
SQZC3D_WITH_EZC3D=OFFstill supports bundle-only runtime.
New in 0.2
- Preset builders for common workflows (
stream_frame_all,stream_frame_sel,window_analysis,interpolation_ready). - Dual-layer API:
- C layer for stable runtime ABI (
sqzc3d.h). - C++ easy layer for ergonomic one-shot window reads (
sqzc3d_easy.h).
- C layer for stable runtime ABI (
- Type-group metadata in chunk for marker-group-aware workflows.
Build
cmake -S . -B build
cmake --build build --config Release --parallel
Common options
SQZC3D_WITH_EZC3D(ON|OFF, defaultON)
enable/disable the C3D parser feature.SQZC3D_FETCH_EZC3D(ON|OFF, defaultON)
auto-fetch ezc3d when not found in the current toolchain.SQZC3D_BUILD_EXAMPLES(ON|OFF, defaultOFF)
build CLI samples.SQZC3D_EZC3D_GIT_REPOSITORY/SQZC3D_EZC3D_GIT_TAG
control fetch source whenSQZC3D_FETCH_EZC3D=ON.
Compatibility note: legacy
sqzc3d_WITH_EZC3Dis tolerated for CMake compatibility and mapped to the canonicalSQZC3D_WITH_EZC3D.
Runtime capability matrix
| Feature | ON | OFF |
|---|---|---|
C3D parsing (open_file/open_memory) |
✅ | ❌ |
Chunk build (build_chunks) |
✅ | ❌ |
| Bundle export/load | ✅ | ✅ |
| Analog support | ✅ | ✅ |
Runtime availability is always queryable via sqzc3d_get_features().
CMake usage (dependency)
add_subdirectory(path/to/sqzc3d)
target_link_libraries(your_target PRIVATE sqzc3d)
Quick start
1) Parse C3D and build chunks
sqzc3d_default_open_opt(&open_opt);
sqzc3d_open_file(&dec, path, &open_opt);
sqzc3d_default_build_opt(&build_opt);
sqzc3d_build_chunks(dec, &build_opt, &chunk);
// use chunk metadata/queries/views
sqzc3d_free_chunk(chunk);
sqzc3d_close_dec(dec);
2) Load from bundle
sqzc3d_load_bundle(bundle_path, &chunk);
sqzc3d_free_chunk(chunk);
All API contracts use plain integers and pointers, so this is usable from both C and C++ projects.
Quickly check runtime identity:
printf("sqzc3d version=%s abi=%d\n", sqzc3d_version(), sqzc3d_abi_version());
3) C++ easy entry (sqzc3d_easy.h)
#include "sqzc3d_easy.h"
sqzc3d::ReadPointsWindow(dec, 0, 32, nullptr, 0, nullptr, &chunk);
const auto view = sqzc3d::FrameMajorPointsView(chunk);
sqzc3d_easy.h is a lightweight C++ helper that builds common window reads with defaults and exposes
PointWindow / AnalogWindow lightweight views plus frame-major -> point-major reorder.
4) Fast onboarding (selection + shape assumptions)
- For one-off integration, start from C++ easy helpers (
ReadPointsWindow,FrameMajorPointsView) to get a deterministicn_frames x n_points x 3layout and explicit[frame][point]validity. - For production bindings, use the C API directly and keep
sqzc3d_points_view_*/sqzc3d_analogs_view_*explicit.
Data model at a glance
- Open
sqzc3d_open_file/sqzc3d_open_memory(memory-open currently writes a temporary file before parsing) - Build
sqzc3d_build_chunks - Query
metadata APIs + label/index helpers + frame/point/channel views, optionaltype_group_*metadata. - Type groups (if present)
n_type_groupstype_group_names(group labels)type_group_starts(n_type_groups + 1prefix offsets)type_group_indices(flat point-index list inpoint_labelsorder)
- Easy-layer shape contract: points are returned as
FrameMajor PointWindow(n_frames x n_points x 3) withframe_stride = n_points * 3,point_stride = 3; valid mask is[n_frames x n_points]. - Persist/load
sqzc3d_export_bundle/sqzc3d_load_bundle
Public structs:
sqzc3d_open_opt_tsqzc3d_build_opt_tsqzc3d_chunk_tsqzc3d_points_view_tsqzc3d_analogs_view_t
Return value conventions are C-style integers. See include/sqzc3d_types.h for status constants.
Feature flags and capabilities
sqzc3d_get_features();
Capability bits are available in include/sqzc3d.h:
SQZC3D_FEATURE_OPEN_FILESQZC3D_FEATURE_OPEN_MEMORYSQZC3D_FEATURE_BUILD_CHUNKSSQZC3D_FEATURE_BUNDLESQZC3D_FEATURE_ANALOG
Use this to adapt behavior for ON/OFF builds at runtime.
Validation
sqzc3d_load_bundle_with_optionssupports strict mode.samples/*provide smoke tests:bench_sqzc3dbench_ezc3dbench_sqzc3d_streamc3dinfo_sqzc3dexport_sqzc3d_bundleverify_correctness_matrix_sqzc3deasy_window_sqzc3d
Documentation
- Public API details:
docs/API.md - Build and usage notes: this file
- Development milestones:
PLAN.md - Dependencies and notices:
DEPENDENCIES.md/NOTICE
License
Squeezed C3D (sqzc3d) is released under MIT.
ezc3d upstream license is MIT.
License & third-party notices
See LICENSE and NOTICE for dependency/license notes, DEPENDENCIES.md for build requirements.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqzc3d-0.0.2.tar.gz.
File metadata
- Download URL: sqzc3d-0.0.2.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ce9010a4c9b13a9861a272107d91dbc7f165d57cbf3c5708cceb499969095ac
|
|
| MD5 |
ded9d3b9c27220ba97909cc822d76774
|
|
| BLAKE2b-256 |
f0d23b2c51c3162f570d2ddedfc3bb74ab3b74a71e404f18a6b54f5cfada8768
|
Provenance
The following attestation bundles were made for sqzc3d-0.0.2.tar.gz:
Publisher:
pypi.yml on lshdlut/squeezc3d
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqzc3d-0.0.2.tar.gz -
Subject digest:
4ce9010a4c9b13a9861a272107d91dbc7f165d57cbf3c5708cceb499969095ac - Sigstore transparency entry: 962439166
- Sigstore integration time:
-
Permalink:
lshdlut/squeezc3d@9a7728f0dca35da83f98eff1d19e93960c231c78 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/lshdlut
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@9a7728f0dca35da83f98eff1d19e93960c231c78 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sqzc3d-0.0.2-py3-none-any.whl.
File metadata
- Download URL: sqzc3d-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b1555a7dd9c0e3bc7b48c9bb8e2c2aa5e8b63fb39ff043ddda35e8333f09290
|
|
| MD5 |
813d4e9e8c61bad9802caa128196cd08
|
|
| BLAKE2b-256 |
a5560099a1adbe93462488cd31437b6d059a5ac57059b03876807ccfcd256a9e
|
Provenance
The following attestation bundles were made for sqzc3d-0.0.2-py3-none-any.whl:
Publisher:
pypi.yml on lshdlut/squeezc3d
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqzc3d-0.0.2-py3-none-any.whl -
Subject digest:
0b1555a7dd9c0e3bc7b48c9bb8e2c2aa5e8b63fb39ff043ddda35e8333f09290 - Sigstore transparency entry: 962439174
- Sigstore integration time:
-
Permalink:
lshdlut/squeezc3d@9a7728f0dca35da83f98eff1d19e93960c231c78 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/lshdlut
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@9a7728f0dca35da83f98eff1d19e93960c231c78 -
Trigger Event:
push
-
Statement type: