Skip to content

Update serialising methods and instructions #951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 12, 2025

Conversation

edoaltamura
Copy link
Collaborator

Summary

Mark the legacy save/load methods as deprecated (v0.9.0) and point users to to_dill/from_dill.

Add short usage examples under each serialisation method.

Clarify raised exceptions in argument docs.

Details and comments

Closes #891

@coveralls
Copy link

coveralls commented Jun 9, 2025

Pull Request Test Coverage Report for Build 15610565253

Details

  • 6 of 10 (60.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.07%) to 90.8%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_machine_learning/algorithms/serializable_model.py 6 10 60.0%
Totals Coverage Status
Change from base Build 15574750714: -0.07%
Covered Lines: 4530
Relevant Lines: 4989

💛 - Coveralls

Copy link
Member

@woodsp-ibm woodsp-ibm left a comment

Choose a reason for hiding this comment

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

  • Needs a reno release note to cover the deprecation of save/load and these new replacement methods.

I get that the improved example may well go towards solving the referenced issue. Its just less clear to me how changing the names of the methods helps in that regard. I guess if one cares it makes it clear that its saved as a dill file, otherwise, while names can be changed maybe I am missing something.

@edoaltamura
Copy link
Collaborator Author

The main motivation is to make it clear in which format the io is done, and partially also staying consistent with the syntax used in other libs like pandas, where from_* methods generally denote classmethods. Also added the reno about this change.

@edoaltamura edoaltamura requested a review from woodsp-ibm June 11, 2025 10:10
@woodsp-ibm
Copy link
Member

Also should not this tutorial 09_saving_and_loading_models.ipynb be updated as well to use the replacement methods not the deprecated save/load.

@edoaltamura edoaltamura requested a review from woodsp-ibm June 11, 2025 16:04
@edoaltamura edoaltamura requested a review from woodsp-ibm June 12, 2025 12:31
@edoaltamura edoaltamura merged commit ae3c240 into qiskit-community:main Jun 12, 2025
29 checks passed
@edoaltamura edoaltamura deleted the update-serialisation branch June 12, 2025 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving and Loading Problem of QSVC algorithm
3 participants