Creating Computations
Combining configs, AOIs, and TOIs into computations
Creating Computations
Algorithm Computations are the unit of work in the Elements Platform. They combine an Algorithm Configuration to execute an algorithm.
What is a Computation?
A computation represents:
Algorithm Config (What + How) + AOI Collection (Where) + TOI (When) = Computation
Creating a Computation
from elements.sdk.elements_sdk import ElementsSDK
sdk = ElementsSDK()
computation = await sdk.algorithm_computation.create(
algorithm_config_id=config_id,
aoi_collection_id=collection_id,
toi_id=toi_id
)
print(f"Computation created: {computation.id}")Running a Computation
# Start the computation
await sdk.algorithm_computation.run(ids=[computation.id])
# Run multiple computations
await sdk.algorithm_computation.run(ids=[comp1_id, comp2_id, comp3_id])Monitoring Computations
Get Status
comp = await sdk.algorithm_computation.get(algorithm_computation_id=computation.id)
print(f"Status: {comp.status}")View History
history = await sdk.algorithm_computation.history(algorithm_computation_id=computation.id)
for event in history:
print(f"{event.timestamp}: {event.status}")Managing Computations
Pause
await sdk.algorithm_computation.pause(ids=[computation.id])Resume
await sdk.algorithm_computation.resume(ids=[computation.id])Delete
await sdk.algorithm_computation.delete(ids=[computation.id])Next Steps
- Learn how to View Results from completed computations
- See Running Algorithms for the complete workflow
Updated 5 months ago