Skip to content

Conversation

@Aniketsy
Copy link
Contributor

#681
This PR adds a check to format_check.sh to ensure all Jupyter Notebook (.ipynb) files are in the correct format before merging. The script now uses nbstripout --check to verify that notebooks do not contain unwanted outputs or metadata.

Please let me know if this fix needs any improvements . I’m open to feedback and happy to make changes based on suggestions.
Thankyou!

@Aniketsy
Copy link
Contributor Author

@mhucka Please review these changes when you have a chance.

@Aniketsy
Copy link
Contributor Author

======================================================================
FAIL: test_3_qubit_circuit (__main__.SPSAMinimizerTest)
SPSAMinimizerTest.test_3_qubit_circuit
Test quantum circuit optimization, adapted from Qiskit SPSA testing
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/.cache/bazel/_bazel_runner/865e0ada367db183bc26de9a3083631f/execroot/__main__/bazel-out/k8-opt/bin/tensorflow_quantum/python/optimizers/spsa_minimizer_test.runfiles/__main__/tensorflow_quantum/python/optimizers/spsa_minimizer_test.py", line 219, in test_3_qubit_circuit
    self.assertLess(result.objective_value.numpy(), -0.95)
AssertionError: -0.8339844 not less than -0.95

I dont think this CI check fail related to these changes , please correct me if i am wrong also i'm getting same check fail in other #903

@mhucka mhucka self-assigned this Dec 8, 2025
@mhucka
Copy link
Member

mhucka commented Dec 8, 2025

Thanks for this. I think it will be better to take this in a different direction, and use nbformat rather than introduce a new dependency (nbstripout). The former is already being used in TFQ. nbformat has validation facilities.

@Aniketsy Let us know if you would like to update this PR accordingly. No worries if you do not have the time or are not interested in pursuing it.

@Aniketsy
Copy link
Contributor Author

Aniketsy commented Dec 9, 2025

@mhucka Thanks for the feedback. I’ll update the code with the suggested changes.

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