This error can be reproduced with the following code (from the pst_tests::reweight_test function):
import os
import numpy as np
from pyemu import Pst
pst_dir = os.path.join("pst")
p = Pst(os.path.join(pst_dir, "pest.pst"))
obsgrp_dict = {"pred": 0., "head": 1.0, "conc": 1.0}
p.adjust_weights(obsgrp_dict=obsgrp_dict)
which results in:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "/Users/aleaf/Documents/GitHub/pyemu/pyemu/pst/pst_handler.py", line 2588, in adjust_weights
for grp, contrib in obsgrp_dict.items():
RuntimeError: dictionary changed size during iteration
This error can be reproduced with the following code (from the
pst_tests::reweight_test
function):which results in: