decentriq_platform.archv2.compute_job
Base compute job class for archv2 DCRs.
This module provides the common ComputeJob base class used by both Media DCR and DataLab v2 compute jobs.
Classes
ComputeJob
ComputeJob(
dcr_id: str,
action: DataRoomComputeAction,
result_zip_file_name: str,
client: Client,
)
Abstract base class for compute jobs in archv2 DCRs.
Initialize a compute job.
Parameters:
dcr_id: The identifier for the DCR or DataLabaction: The compute action to performresult_zip_file_name: The name of the file in the zip to get the result fromclient: The client instance for API communication
Ancestors (in MRO)
- abc.ABC Descendants
- decentriq_platform.data_lab.compute_job.DataLabStatisticsJob
- decentriq_platform.data_lab.compute_job.DataLabValidationStatusJob
- decentriq_platform.data_lab.compute_job.ValidationReportJob
- decentriq_platform.media.compute_job.MediaAudienceUserListJob
- decentriq_platform.media.compute_job.MediaDataAttributesJob
- decentriq_platform.media.compute_job.MediaEstimateAudienceSizeJob
- decentriq_platform.media.compute_job.MediaGetAudiencesJob
- decentriq_platform.media.compute_job.MediaGetCustomAudiencesJob
- decentriq_platform.media.compute_job.MediaGetSeedAudiencesJob
- decentriq_platform.media.compute_job.MediaInsightsJob
- decentriq_platform.media.compute_job.MediaLookalikeAudienceStatisticsJob
- decentriq_platform.media.compute_job.MediaMatchingValidationReportJob
- decentriq_platform.media.compute_job.MediaModelQualityReportJob
- decentriq_platform.media.compute_job.MediaOverlapStatisticsJob
- decentriq_platform.media.compute_job.ValidationReportJob
download_result
def download_result(
self,
task_result_hash: str,
) ‑> io.RawIOBase
Download the result of the compute job.
Parameters:
task_result_hash: The hash of the task result to download
Returns:
- The result of the compute job
get_result
def get_result(
self,
) ‑> bytes
Get the result of the compute job.
Returns:
- The content of the result file as bytes or raises an exception if the job failed
get_result_as_zipfile
def get_result_as_zipfile(
self,
) ‑> zipfile.ZipFile
Get the result of the compute job as a zipfile.ZipFile.
Returns:
- The content of the result file as a zipfile.ZipFile. If the job failed, an Exception will be raised.
is_complete
def is_complete(
self,
) ‑> bool
Check if the compute job is complete.
Returns:
- True if the job is complete, False otherwise
result
def result(
self,
) ‑> Any
Get the parsed result of the compute job.
Each job subclass should implement this method and return the appropriate type which represents the job result.
run
def run(
self,
) ‑> None
Run the compute job.
Raises:
Exception: If the computation has already been run
wait_for_completion
def wait_for_completion(
self,
timeout: Optional[int] = None,
sleep_interval: int = 1,
) ‑> Self
Wait for the compute job to complete.
Parameters:
timeout: The maximum time to wait for the job to complete, in secondssleep_interval: The interval to wait between checks, in seconds
Returns:
- The compute job