Skip to content

Make PyACECalculator deal with pickle#99

Open
pmrv wants to merge 1 commit intoICAMS:masterfrom
pmrv:pickle
Open

Make PyACECalculator deal with pickle#99
pmrv wants to merge 1 commit intoICAMS:masterfrom
pmrv:pickle

Conversation

@pmrv
Copy link
Copy Markdown

@pmrv pmrv commented Apr 3, 2026

Pull Request Template

Thank you for contributing to our project! Please review the checklist and fill out the details below.

Description of Changes

The default reducer puts out the evaluator and a bunch of other C++ extension types that pickle then chokes on. Side step the problem here by providing a reducer that just makes unpickling equivalent to a new instantiation. The only difficulty here is that basis_set stays a file name if initialized like that and that PyACECalculator.init expects it as a positional argument.
Avoid the filename by dumping the whole bbasis config, so that unpickling can happen on other machines or in different locations.

Checklist

  • Code is well-documented.
  • All tests have been run and passed.
  • Relevant documentation has been updated if necessary.

License Agreement

By submitting this pull request, I agree that:

  • The code submitted in this pull request will be distributed under the Academic Software License (free for academic non-commercial use, not free for commercial use), see LICENSE.md for more details.
  • The copyright for the code, including the submitted code, remains with Ruhr University Bochum. Ruhr University Bochum retains the right to transfer or modify the copyright.

Thank you for your contribution!

The default reducer puts out the evaluator and a bunch of
other C++ extension types that pickle then chokes on.
Side step the problem here by providing a reducer that just
makes unpickling equivalent to a new instantiation.
The only difficulty here is that basis_set stays a file name
if initialized like that and that PyACECalculator.__init__
expects it as a positional argument.
Avoid the filename by dumping the whole bbasis config, so that
unpickling can happen on other machines or in different locations.
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.

1 participant