Coverage for /home/shudson/libensemble/rsync-to-clusters/nkag-fresh-checkout/libensemble_master/libensemble/history.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#For debug messages - uncomment #logger.setLevel(logging.DEBUG)
"""The History Class provides methods for managing the history array.
Attributes ---------- H: numpy structured array History array storing rows for each point. Field names are in libensemble/libE_fields.py
offset: integer Starting index for this ensemble (after H0 read in)
index: integer Where libEnsemble should start filling in H
given_count: integer Number of points given to sim fuctions (according to H)
sim_count: integer Number of points evaluated (according to H)
Note that index, given_count and sim_count reflect the total number of points in H, and therefore include those prepended to H in addition to the current run.
"""
# Not currently using libE_specs, persis_info - need to add parameters #def __init__(self, libE_specs, alloc_specs, sim_specs, gen_specs, exit_criteria, H0, persis_info): """ Forms the numpy structured array that records everything from the libEnsemble run
""" #import pdb; pdb.set_trace()
# for ind, val in np.ndenumerate(H0[field]): # Works if H0[field] has arbitrary dimension but is slow # H[field][ind] = val
# Prepend H with H0
#self.offset = 0
# libE.check_inputs also checks that all points in H0 are 'returned', so gen and sim have been run. #assert np.all(H0['given']), "H0 contains unreturned points. Exiting"
#assert np.all(H0['returned']), "H0 contains unreturned points. Exiting"
""" Updates the history (in place) after new points have been evaluated """
else: #len or np.size else:
""" Updates the history (in place) when new points have been given out to be evaluated
Parameters ---------- q_inds: numpy array Row IDs for history array H
sim_worker: integer Worker ID """
else:
""" Updates the history (in place) when new points have been returned from a gen
Parameters ---------- gen_worker: integer The worker who generated these points O: numpy array Output from gen_func """
# gen method must not be adjusting sim_id, just append to self.H
else: # gen method is building sim_id.
""" libEnsemble is requesting k rows be added to H because the gen_func produced more points than rows in H.
Parameters ---------- k: integer Number of rows to add to H """
# Could be arguments here to return different truncations eg. all done, given etc... """Returns truncated array""" |