Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Document minimum delay constraints for sweep operations#33

Merged
caidish merged 3 commits intomasterfrom
copilot/document-min-delay-values
Jan 26, 2026
Merged

Document minimum delay constraints for sweep operations#33
caidish merged 3 commits intomasterfrom
copilot/document-min-delay-values

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

MeasureIt enforces minimum delay values (inter_delay >= 0.01s, outer_delay >= 0.1s) for thread-safe operation, but these constraints are undocumented, causing users to discover them via ValueError at runtime.

Changes

Docstrings (base_sweep.py, sweep2d.py)

  • Added minimum and default values to inter_delay and outer_delay parameter documentation

README

  • Added "Sweep Timing Constraints" section with constraint table and usage example

Example

# Valid - meets minimums
sweep2d = measureit.Sweep2D(
    in_params=[inner_param, 0, 1, 0.01],
    out_params=[outer_param, 0, 10, 0.1],
    inter_delay=0.01,   # >= 0.01s required
    outer_delay=0.1      # >= 0.1s required
)

# Raises ValueError: inter_delay too small
sweep2d = measureit.Sweep2D(..., inter_delay=0.005)

No code changes - validation logic already existed.

Original prompt

This section details on the original issue you should resolve

<issue_title>Document minimum inter_delay/outer_delay values in Sweep2D template and README</issue_title>
<issue_description>## Description

MeasureIt enforces minimum delay values for sweeps, but these are not prominently documented. Users encounter ValueError exceptions without prior warning.

Minimum Values

Parameter Minimum Enforcement Location
inter_delay 0.01s src/measureit/sweep/base_sweep.py:187-190
outer_delay 0.1s src/measureit/sweep/sweep2d.py:223-226

Current Behavior

When users set delays below minimums, they get:

ValueError: inter_delay=0.0s is too small; must be at least 0.01s to protect runner thread timing.

While the error message is helpful, users discover this only after their first failed attempt.

Agent Feedback

100+ agent runs hit these constraints during QDevBench experiments. Common feedback:

  • "Initial Sweep2D failed because outer_delay was set to 0.05 s (<0.1 s minimum)"
  • "Consider adding minimum allowed inter_delay/outer_delay values to the Sweep2D template"
  • "Document that Sweep2D 'err' is a fractional tolerance of the step size and that outer_delay must be ≥0.1 s"

Example Runs Affected

  • batch_20260123_195005/QDB_2IGTQSJV6/codex_gpt-5.1-codex-max-medium_20260123_210856
  • combined_20260123_193247/QDB_22J3OAL1N/codex_gpt-5.1-codex-max-high_20260116_063317

Proposed Documentation Updates

1. In docstrings (sweep1d.py, sweep2d.py)

Add to parameter descriptions:

inter_delay : float, optional
    Delay between inner sweep points. Must be >= 0.01s.
    Default: 0.1s

outer_delay : float, optional
    Delay between outer sweep lines. Must be >= 0.1s.
    Default: 1.0s

2. In README.md or timing guide

Add a section on sweep timing constraints explaining the thread safety rationale.

3. In MCP templates (if applicable)

Add comments in sweep templates:

# Note: inter_delay >= 0.01s, outer_delay >= 0.1s required
s = Sweep2D(..., inter_delay=0.02, outer_delay=0.1)

Issue generated from analysis of 870 agent feedback entries in QDevBench.</issue_description>

<agent_instructions>Only implementation of dcostrings and README is needed. </agent_instructions>

Comments on the Issue (you are @copilot in this section)

@caidish This is simply docstring update. Assigned to Copilot to fix.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Document minimum inter_delay and outer_delay values Document minimum delay constraints for sweep operations Jan 26, 2026
Copilot AI requested a review from caidish January 26, 2026 01:57
@caidish caidish marked this pull request as ready for review January 26, 2026 04:13
@caidish caidish merged commit 8a27380 into master Jan 26, 2026
4 checks 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.

Document minimum inter_delay/outer_delay values in Sweep2D template and README

2 participants