Skip to content

Conversation

@RahilJain1366
Copy link
Contributor

@RahilJain1366 RahilJain1366 commented Nov 8, 2025

Fixes #7520

@RahilJain1366 RahilJain1366 requested review from a team and vtomole as code owners November 8, 2025 07:01
@RahilJain1366 RahilJain1366 requested a review from viathor November 8, 2025 07:01
@github-actions github-actions bot added the size: L 250< lines changed <1000 label Nov 8, 2025
@pavoljuhas pavoljuhas changed the title Migrate contrib json tests main Migrate contrib json tests to standard json test framework Nov 10, 2025
Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

LGTM after pushing in few small tweaks.
Thank you for taking care of this!

@pavoljuhas pavoljuhas enabled auto-merge November 10, 2025 18:57
The gate has mutable attributes.  Make it unhashable to avoid
failure in `hash_from_pickle_test.py`.  Support for hashing can
be added later if necessary.
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.38%. Comparing base (1deffd6) to head (bdd67f1).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7743   +/-   ##
=======================================
  Coverage   99.38%   99.38%           
=======================================
  Files        1091     1090    -1     
  Lines       97919    97920    +1     
=======================================
+ Hits        97313    97314    +1     
  Misses        606      606           

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pavoljuhas pavoljuhas added this pull request to the merge queue Nov 10, 2025
Merged via the queue into quantumlib:main with commit 77035ba Nov 10, 2025
34 of 35 checks passed
@RahilJain1366
Copy link
Contributor Author

Hi @pavoljuhas

Thank you for the tweaks and letting me contribute to the repo!

A quick doubt on why we are adding @value.value_equality(unhashable=True) in cirq-core/cirq/contrib/bayesian_network/bayesian_network_gate.py?

@pavoljuhas
Copy link
Collaborator

A quick doubt on why we are adding @value.value_equality(unhashable=True) in cirq-core/cirq/contrib/bayesian_network/bayesian_network_gate.py?

To avoid failure of hash_from_pickle_test.py such as here. That test reuses the list of JSON-tested classes to verify consistency of their hash(obj) after pickle serialization / deserialization. The test is skipped for unhashable classes hence the unhashable=True argument to make BayesianNetworkGate unhashable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: L 250< lines changed <1000

Projects

None yet

Development

Successfully merging this pull request may close these issues.

convert tests in cirq.contrib.json_test to common json test framework

2 participants