Skip to content

Validate provided scheduler before qompile#199

Merged
masa10-f merged 1 commit into
masterfrom
issue-154-scheduler-validation
May 13, 2026
Merged

Validate provided scheduler before qompile#199
masa10-f merged 1 commit into
masterfrom
issue-154-scheduler-validation

Conversation

@masa10-f
Copy link
Copy Markdown
Collaborator

Before submitting, please check the following:

  • Make sure you have tests for the new code and that test passes (run pytest)
  • If applicable, add a line to the [unreleased] part of CHANGELOG.md, following keep-a-changelog.
  • Format added code by ruff
  • Type checking by mypy and pyright
  • Make sure the checks (github actions) pass.
  • Check that the docs compile without errors (run make html in ./docs/ - you may need to install dependency for sphinx docs, see docs/requirements.txt.)

Then, please fill in below:

Context (if applicable):

qompile() accepted user-provided Scheduler instances without validating their schedules first, so invalid manual schedules could reach pattern generation and fail later or produce incorrect command timing.

Description of the change:

  • Validate a provided scheduler in _qompile() before reading its timeline.
  • Keep the existing internal scheduler path unchanged when no scheduler is provided.
  • Add a regression test covering DAG-violating scheduler input to qompile().
  • Record the fix in the Unreleased changelog.

Validation performed locally:

  • python -m ruff check ./graphqomb ./tests ./examples
  • python -m ruff format --check --diff
  • python -m pytest -m "not pyzx"
  • python -m pytest -m pyzx
  • python -m pytest --cov=graphqomb --cov-report=term-missing --cov-report=xml --cov-branch
  • python -m mypy
  • pyright
  • env PRE_COMMIT_HOME=/tmp/pre-commit pre-commit run --all-files
  • sphinx-build -W docs/source docs/build

Related issue:

Closes #154

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.13%. Comparing base (54d917d) to head (4f1270c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #199   +/-   ##
=======================================
  Coverage   85.13%   85.13%           
=======================================
  Files          24       24           
  Lines        3242     3243    +1     
  Branches      563      563           
=======================================
+ Hits         2760     2761    +1     
  Misses        352      352           
  Partials      130      130           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@masa10-f masa10-f marked this pull request as ready for review May 13, 2026 01:15
@masa10-f masa10-f self-assigned this May 13, 2026
@masa10-f
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@masa10-f masa10-f merged commit 1b173cc into master May 13, 2026
24 checks passed
@masa10-f masa10-f deleted the issue-154-scheduler-validation branch May 13, 2026 01:20
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.

Add automatic schedule validation before qompile execution

1 participant