SSAGESLabs/PySAGES

Harmonic bias results unaccessible during unpickling due to lack of 'ncalls' parameter provided during __new__

ap-uchi opened this issue · 1 comments

Issue: When unpickling harmonic bias results, HarmonicBiasState requires ncalls but SamplingMethodMeta fails to provide that parameter.

TypeError                                 Traceback (most recent call last)
Cell In[10], [line 2](vscode-notebook-cell:?execution_count=10&line=2)
      [1](vscode-notebook-cell:?execution_count=10&line=1) with open('results.pkl', 'rb') as f:
----> [2](vscode-notebook-cell:?execution_count=10&line=2)     results = pickle.load(f)

TypeError: HarmonicBiasState.__new__() missing 1 required positional argument: 'ncalls'

Steps to reproduce: run a harmonic bias simulation and try to unpickle the results.

PySAGES version: 0.4.1.dev3+gcd6b0a9

By any chance are you trying to deserialize an "older" pickle file. In #292 we introduced a breaking change that changed our serialization. We are trying to figure out a way to fix this for existing users. For the time being you'd have to install a version that does not contain the changes in #292 and onwards.