Skip to content

fix: allow computing MeasuredEntry expectation from program set measurements - #1349

Merged
speller26 merged 4 commits into
mainfrom
rmshaffer/fix-1316
Sep 16, 2026
Merged

speller26 merged 4 commits into
mainfrom
rmshaffer/fix-1316

Conversation

@rmshaffer

@rmshaffer rmshaffer commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Issue #, if available:
Resolves #1316.

Description of changes:
In cases where the MeasuredEntry did not have an observable set, the expectation property returns None. However, the consumer may know which observable should be computed. This PR adds a compute_expectation function to MeasuredEntry which accepts an observable and computes the corresponding expectation.

Testing done:
Test added for new functionality. tox passes.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov

codecov Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (14ad7d5) to head (5931666).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1349   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          171       171           
  Lines        11647     11649    +2     
  Branches      1539      1539           
=========================================
+ Hits         11647     11649    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rmshaffer
rmshaffer marked this pull request as ready for review September 1, 2026 20:05
@rmshaffer
rmshaffer requested a review from a team as a code owner September 1, 2026 20:05
@rmshaffer rmshaffer changed the title fix: compute ProgramSet MeasuredEntry expectation from measurements fix: allow computing MeasuredEntry expectation from program set measurements Sep 1, 2026
@speller26
speller26 merged commit 874122d into main Sep 16, 2026
22 checks passed
@speller26
speller26 deleted the rmshaffer/fix-1316 branch September 16, 2026 19:44
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.

ProgramSet MeasuredEntry.expectation() returns None when no observable is attached (unimplemented)

2 participants