Skip to content

feat: add progress_callback to GVM process_sequence#166

Open
JamesNyeVRGuy wants to merge 1 commit intonikopueringer:mainfrom
JamesNyeVRGuy:fix/gvm-progress-callback
Open

feat: add progress_callback to GVM process_sequence#166
JamesNyeVRGuy wants to merge 1 commit intonikopueringer:mainfrom
JamesNyeVRGuy:fix/gvm-progress-callback

Conversation

@JamesNyeVRGuy
Copy link

Adds an optional progress_callback parameter to
GVMProcessor.process_sequence(). Called after each batch with (current_batch, total_batches). Backwards-compatible — defaults to None with no behavior change when not passed.

This enables callers (CLI, WebUI, etc.) to report per-batch progress during GVM alpha generation.

Adds an optional progress_callback parameter to
GVMProcessor.process_sequence(). Called after each batch with
(current_batch, total_batches). Backwards-compatible — defaults to
None with no behavior change when not passed.

This enables callers (CLI, WebUI, etc.) to report per-batch progress
during GVM alpha generation.
Copy link
Contributor

@shezmic shezmic left a comment

Choose a reason for hiding this comment

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

This fixes an existing TypeError on upstream main.

backend/service.py (line 861) already calls:

gvm.process_sequence(
    ...
    progress_callback=_gvm_progress,
)

But gvm_core/wrapper.py's process_sequence() signature on main doesn't include progress_callback. Every call to service.run_gvm() currently throws:

TypeError: process_sequence() got an unexpected keyword argument 'progress_callback'

The implementation here is correct. The callback is called with (batch_id + 1, len(dataloader)), which matches the _gvm_progress(batch_idx, total_batches) contract in service.py. The None default preserves backward compatibility for any direct callers.

No no-go zones touched. Looks good to me.

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