AttributeLoadingJob

ppg2.AttributeLoadingJob #

ppg2.AttributeLoadingJob(
        job_id,
        obj,
        attr_name
        load_function,
        resources: Resources = Resources.SingleCore,
        depend_on_function=True,
    ):

A DataLoadingJob that stores it’s results in obj.<attr_name>.

  • obj - the oject to store data in
  • attr_name the attribute name to store the data at.

For further parameters, see DataLoadingJob.

This job runs in the controlling process (see process-structure).

The load_function’s return value is stored in attr_name of obj. It’s DeepHashed representation is used to calculate the tracking hash.

If you already have a hash handy, or need to work around an object type that is not supported by DeepDiff/DeepHash, you can return a ppg2.ValuePlusHash(value, hash_hexdigest) object to circumvent the pickling requirement.

Alternatively, you may return UseInputHashesForOutput, which signals the job to use a hash of it’s input hashes as the tracking hash, making it essentially ’transparent’. This is useful for objects that are currently not supported by DeepDiff.