Skip to content

Cam sweep implementation#2

Merged
importly merged 8 commits into
masterfrom
cam-sweep-implementation
Jun 14, 2026
Merged

Cam sweep implementation#2
importly merged 8 commits into
masterfrom
cam-sweep-implementation

Conversation

@importly

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a “camera sync-sweep” workflow for running timing-sweep manifests with a single persistent DVXplorer camera open, alongside new tooling for post-processing existing AEDAT4 recordings and a broad formatting/cleanup pass across tests, scripts, and core modules.

Changes:

  • Add dmdcontrol camera sync-sweep (manifest-driven) plus run_camera_sync_sweep.sh/xinitrc_camera_sync_sweep.sh launchers and README guidance.
  • Add AEDAT4 reprocessing (dmdcontrol camera reprocess-aedat4) and shared utilities (support/argparse_types.py, patterns/bitplanes.py) used across camera/pattern/preview code.
  • Apply consistent formatting (YAPF config + formatting updates) and expand test coverage for the new camera workflows and refactors.

Reviewed changes

Copilot reviewed 93 out of 97 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_visual_patterns.py Formatting-only updates in visual pattern tests.
tests/test_trigger_timing.py Formatting-only updates in trigger timing tests.
tests/test_timing_notebooks.py New test ensuring timing notebooks exist and contain required terms.
tests/test_runtime_loop_until_close.py Formatting-only updates in runtime loop tests.
tests/test_raw_batch_probe.py New tests for debug_scripts/raw_batch_probe CLI and behavior.
tests/test_persistent_camera_liveness.py New tests for persistent camera liveness helper.
tests/test_persistent_camera_liveness_official.py New tests for “official” persistent liveness accumulator flow.
tests/test_paired_pattern_engine.py Adds coverage for numbers bitplane order + decimal number rendering; formatting updates.
tests/test_paired_lifecycle.py Small tuple formatting tweak in fake DLPC call tracking.
tests/test_pair_wrappers.py Adds runner tests for sync-sweep scripts + formatting cleanups.
tests/test_numbers_mode.py Formatting updates + tests around number rendering/size warnings.
tests/test_main_post_arm_prime.py Formatting-only updates.
tests/test_main_pair_config.py Formatting updates; preserves behavioral assertions for pair config/preview metadata.
tests/test_main_calibration_square_control.py Formatting-only updates.
tests/test_kernel_runtime.py Formatting-only updates and minor tuple formatting in assertions.
tests/test_dmdcontrol_cli.py Adds AST-based guard against importlib.import_module usage; formatting updates.
tests/test_dmd_usb_mapping.py Formatting updates in USB mapping tests.
tests/test_dmd_preview_server.py Formatting updates in preview server tests.
tests/test_dmd_preview_render.py Formatting updates in LUT preview metadata tests.
tests/test_dmd_preview_package.py Formatting-only updates.
tests/test_camera_usb_reset.py Formatting updates around monkeypatching ioctl/open failures.
tests/test_camera_sync_sweep.py New tests covering manifest-driven sync-sweep behavior (dry-run + live resource reuse).
tests/test_camera_session.py Updates expectations for new session lifecycle/flush + trigger configuration plumbing.
tests/test_camera_reprocess_aedat4.py New tests for AEDAT4 reprocessing CLI and trigger parsing.
tests/test_camera_probe.py Formatting updates in camera probe tests.
tests/test_camera_pair_capture.py Formatting updates in pair-capture tests.
tests/test_camera_local_support_filter.py Formatting updates in local-support filter tests.
tests/test_camera_discovery.py Adds tests for rising-edge trigger configuration reporting + formatting updates.
tests/test_camera_cli.py Expands camera subcommand help coverage to include reprocess-aedat4.
tests/test_camera_capture.py Adds/updates coverage for flush stats, trigger setup errors, and capture edge cases.
tests/test_calibration_square_runtime.py Formatting-only updates.
tests/test_calibration_square_mode.py Formatting-only updates.
scripts/xinit/xinitrc_camera_sync_sweep.sh New xinit wrapper for sync-sweep paired X screen setup and launch.
run_camera_sync_sweep.sh New top-level runner for persistent sync-sweep (dry-run bypass + DP wake + xinit).
README.md Documents sync-sweep runner and recommended timing-sweep workflow.
pyproject.toml Adds YAPF formatting configuration.
notebooks/03_accumulation_offset_rescan.ipynb New notebook for rescan analysis of accumulation window offsets.
notebooks/01_generate_timing_sweep_commands.ipynb New notebook to generate sync-sweep manifest/launcher commands.
hannah_cam_code/utils/env.py Removes stray blank line (formatting cleanup).
hannah_cam_code/capture_accumulate.py Formatting refactor only (no functional intent apparent).
hannah_cam_code/camera.py Formatting refactor only (no functional intent apparent).
format.py New formatting helper script to run YAPF across selected roots.
dmdcontrol/support/logging.py Formatting-only change to RichHandler configuration layout.
dmdcontrol/support/argparse_types.py New shared argparse type validators/parsers.
dmdcontrol/runtime/loop.py Minor refactor/formatting in watchdog logging and loop signature.
dmdcontrol/preview/server.py Minor refactor removing _query_int helper; direct int conversion for frame.
dmdcontrol/preview/render.py Refactors bitplane pack/unpack via shared helpers; minor cleanup.
dmdcontrol/patterns/visual.py Slice formatting cleanup; no logic change intended.
dmdcontrol/patterns/numbered_regions.py Formatting-only updates.
dmdcontrol/patterns/kernel.py Formatting-only updates; minor list/slice style cleanup.
dmdcontrol/patterns/engine.py Refactors bitplane pack/unpack to shared patterns/bitplanes.py; removes unused legacy helpers.
dmdcontrol/patterns/calibration_square.py Formatting-only updates; no logic change intended.
dmdcontrol/patterns/bitplanes.py New shared bitplane packing/unpacking helpers.
dmdcontrol/hardware/wake.py Uses DLPC900 convenience method for DP wake instead of raw packet write.
dmdcontrol/hardware/usb.py Formatting-only updates; no behavioral change intended.
dmdcontrol/hardware/mapping.py Removes small helper in favor of inline field formatting.
dmdcontrol/hardware/flood.py Refactors internal test pattern setup to use DLPC900 convenience methods.
dmdcontrol/cli/preview.py Simplifies preview CLI import path (removes wrapper).
dmdcontrol/cli/pair.py Inlines runtime-seconds presence check.
dmdcontrol/cli/main.py Replaces dynamic import_module routing with explicit imports and handler mapping; adds new camera subcommands.
dmdcontrol/cli/config.py Simplifies mapping serialization to attribute-based dict.
dmdcontrol/cli/camera.py Adds sync-sweep + reprocess-aedat4 handlers; removes import_module usage.
dmdcontrol/camera/usb_reset.py Formatting and minor structure cleanup; behavior preserved.
dmdcontrol/camera/sync_sweep.py New manifest-driven “sync-sweep” implementation (single camera open, per-row runs).
dmdcontrol/camera/session.py Refactors camera open lifecycle to support “capture-only open” and attaches initial flush metadata.
dmdcontrol/camera/reprocess_aedat4.py New AEDAT4 reprocessing command to regenerate derived artifacts from existing recordings.
dmdcontrol/camera/pair_capture.py Refactors to shared argparse types + shared artifact/metadata helpers; removes import_module usage.
dmdcontrol/camera/local_support_filter.py Switches to shared argparse type validators; removes duplicate parsers.
dmdcontrol/camera/discovery.py Adds structured trigger-detector configuration reporting and error capture.
dmdcontrol/camera/accumulation.py Improves event/triggers field handling + adds optional window start offset for accumulation.
debug_scripts/writer_mono_dvs.py New debug script for recording a mono camera stream to AEDAT4.
debug_scripts/raw_batch_probe.py New minimal DVXplorer raw-batch probe script.
debug_scripts/dvx_min_raw_liveness.py New minimal liveness probe variant saving JSON summaries.
debug_scripts/debug_numbered_regions.py Formatting-only updates.
debug_scripts/camera_probe.py Formatting-only updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +13 to +18
from dmdcontrol.camera.runs import (
CameraRunDirectory,
write_capture_artifacts,
write_json,
write_run_metadata,
)
@importly importly merged commit 3fa1542 into master Jun 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants