Skip to content

Animation#78

Draft
bnlawrence wants to merge 20 commits into
mainfrom
animation
Draft

Animation#78
bnlawrence wants to merge 20 commits into
mainfrom
animation

Conversation

@bnlawrence

Copy link
Copy Markdown
Contributor

This implements animation against a reconfigured cf-plot that has the appropriate hooks.

Currently this is still dependent on the bnlawrence fork of cf-plot, but a pull request against ncas-cms/cf-plot is in flight.

Bryan Lawrence added 13 commits June 17, 2026 08:59
…tion

- animation_protocol.py: Message types (Start/Frame/End/Error) and serialization
- animation_session.py: Backend state machine and session management
- worker.py: Emit helpers for animation frames
- worker_message_router.py: ANIM_* message handlers
- 36 tests passing for protocol and session logic
- docs: design docs and cf-plot guidance
Comprehensive guide covering:
- Task invocation with #ANIMATION:1 header
- AnimationPlaybackWidget placement in stacked layout
- Message routing integration with worker_message_router
- State management and playback controls (play/pause/seek/stop)
- Layout transitions between static plot and animation
- Error handling and edge cases
- Full implementation checklist

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 an end-to-end “animation mode” for 3D selections by enabling worker-side streaming of per-frame renders (via cf-plot animation hooks) and GUI-side buffering/playback/export, alongside a set of related UI and test updates.

Changes:

  • Add an #ANIMATION:1 task header plus worker-side cf-plot wrappers that emit ANIM_START/FRAME/END/ERROR messages.
  • Extend the GUI to support an animation plot action for 3D selections, including buffering/playback controls and export (GIF / PNG sequence).
  • Add new animation session/protocol modules, docs, and expanded test coverage (plus remote configuration UX improvements).

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
xconv2/worker.py Parses animation task header and wraps cf-plot calls to stream animation lifecycle + frames to the GUI.
xconv2/worker_message_router.py Routes ANIM_* messages from worker stdout to host animation handlers.
xconv2/ui/selection_controller.py Enables “animation mode” UX for 3D selections and threads dimensionality into plot/action option updates.
xconv2/ui/plot_view_controller.py Adds animation controls (Play/Stop/Export) and action-mode UI switching logic.
xconv2/ui/dialogs.py Adds AnimationOptionsDialog and improves remote configuration dialogs with edit/delete actions.
xconv2/main_window.py Implements animation buffering/playback state machine and hooks up handlers for ANIM_* messages.
xconv2/main_window_components/plot_ops.py Routes 3D+animation plot requests into worker animation tasks (emit_image disabled, animation flag enabled).
xconv2/core_window.py Adds GIF/PNG-sequence export path for buffered animation frames; adds animation options dialog wiring.
xconv2/cf_templates.py Adds animation as a plot_action option and squeezes plotted fields in generated selection code.
xconv2/animation_session.py New in-memory animation session buffer/controller + playback state enum.
xconv2/animation_protocol.py New helper types and base64(pickle) payload encode/decode utilities for animation messages.
tests/test_worker_remote_tasks.py Adds coverage for parsing #ANIMATION:1 header into worker TaskHeaders.
tests/test_selection_controller.py Updates selection controller tests for the new plot/action option APIs.
tests/test_remote_configuration_dialog.py Adds Qt-backed tests for edit/delete behavior in remote configuration dialog.
tests/test_https_nginx_integration.py Extends HTTPS integration coverage with “index.html instead of autoindex” listing behavior.
tests/test_coordinate_flow.py Adds animation mode flow tests (3D selection → animation action → worker task) and playback/export tests.
tests/test_contour.py Updates fake field to support squeeze() and adds contour template test for animation plot_action.
tests/test_animation_session.py New unit tests for animation session/controller state transitions and buffering.
tests/test_animation_router.py New unit tests for routing ANIM_* payloads through WorkerMessageRouter.
tests/test_animation_protocol.py New unit tests for protocol dataclasses and encode/decode round trips.
tests/conftest.py Adds an nginx HTTPS fixture variant that serves an index page at root (no autoindex).
pyproject.toml Bumps version and adjusts dependencies (notably adds pystac-client).
docs/mac-app.md Updates mac build instructions (removes conda run wrapper example).
docs/gui-animation-integration.md Adds design/implementation strategy documentation for GUI animation integration.
docs/cfplot-animation-guidance.md Adds cf-plot-specific guidance for implementing required animation callback hooks.
docs/animation.md Adds overall animation design draft and protocol notes.

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

Comment on lines 460 to 464
def clear_plot_canvas(self, message: str = "Plot unavailable") -> None:
"""Clear any rendered plot image and show a fallback message."""
self.host._plot_pixmap_original = None
self.host.plot_frame.setPixmap(QPixmap())
self.host.plot_frame.setText(message)
Comment thread xconv2/worker.py Outdated
Comment thread xconv2/ui/dialogs.py
Comment on lines +417 to +421
self.frame_axis_combo = QComboBox(self)
self.frame_axis_combo.addItem("Auto", "auto")
self.frame_axis_combo.addItem("Time", "time")
self.frame_axis_combo.addItem("Level", "level")
self.frame_axis_combo.addItem("Depth", "depth")
Comment thread xconv2/animation_session.py
Comment thread xconv2/animation_session.py
Comment thread xconv2/core_window.py
Comment thread pyproject.toml
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