Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Add validation of sizes of arguments of OptimizationResults and unit tests #1167

Merged
merged 3 commits into from
Aug 5, 2020

Conversation

t-imamichi
Copy link
Contributor

@t-imamichi t-imamichi commented Aug 5, 2020

Summary

OptimizationResult newly introduced variables class variables in #1122.
But, there is not enough check of arguments. So I added a check of sizes of OptimizationResult._x and OptimizationResult._variables.
I fix bugs of generation of OptimizationResult detected by this check.

#1131 modifies the way to interpret OptimizationResult so that OptimizationResult becomes read-only.
But, some interpret did not treat variables correctly. I notice that there is no unit test about OptimizationResult.variable_names and OptimizationResult.variables_dict.
So I added some relevant unit tests.

Details and comments

@t-imamichi t-imamichi marked this pull request as ready for review August 5, 2020 05:33
@t-imamichi t-imamichi requested a review from adekusar-drl August 5, 2020 05:49
Copy link
Contributor

@adekusar-drl adekusar-drl left a comment

Choose a reason for hiding this comment

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

Looks good.

@t-imamichi
Copy link
Contributor Author

@manoelmarques @woodsp-ibm If possible, could you include it in the new release? It is a bug fix of the converter rework #1061 and #1131.

@woodsp-ibm woodsp-ibm merged commit 18dbf71 into qiskit-community:master Aug 5, 2020
@t-imamichi t-imamichi deleted the opt_result_test branch August 5, 2020 15:47
@t-imamichi
Copy link
Contributor Author

Thank you for merging this bug fix at the last moment to release the new version.

pbark pushed a commit to pbark/qiskit-aqua that referenced this pull request Sep 16, 2020
…tests (qiskit-community#1167)

* add more unit tests of converters

* fix min_eigen_optimizer
manoelmarques pushed a commit to qiskit-community/qiskit-optimization that referenced this pull request Jan 14, 2021
…tests (qiskit-community/qiskit-aqua#1167)

* add more unit tests of converters

* fix min_eigen_optimizer
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants