Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

163 total results found

Report Lambda Cheatset

Developer Manual Python - Report Lambdas

Define Report Program

Developer Manual Python - Report Lambdas

This example creates a new report program. result = vf.create_lambda_python( project=project, type=vf.lambda_type.Report, name="My Volume Report Lambda", fields={}, code=open('./lambdas/ComputeVolumeLambda.py').read()) if not resul...

Run Process Lambda

Developer Manual Python - Process Lambdas

This example runs a lambda process in the platform: result = vf.create_process_entity( project=projectId, type=vf.entity_type.Process, name="Generate Tetra Model " + strand, fields={ 'file_...

Run Report Program

Developer Manual Python - Report Lambdas

The following example runs an existing Report Program with a given set of inputs. # We will use a region that defines an 160 meter cube centered in the origin region = '1,-80,80,-80,-80,80,-80,80,80,-80,80' result = vf.create_report( project=project, ...

Read Report Results

Developer Manual Python - Report Lambdas

This example shows how to read the results of a Report Lambda execution. # The "project" variable contains the Project ID # The "report_id" variable contains the ID for the report entity csvdata = vf.get_file(project, report_id, 'report.csv')  

Initialize Report Lambda

Developer Manual Python - Report Lambdas

This example shows how to initialize the Voxel Farm library in a report Lambda program. import voxelfarm as vf  

Read inputs of Report Lambda

Developer Manual Python - Report Lambdas

The following example shows how to read inputs from a report lambda program. mesh_entity = vf.input_entity("mesh_entity_id", "Entity", vf.type.voxel_mesh) string_input = vf.input_string("string_input", "String Input", "") numerical_input = vf.input("numeric...

Volumetric Booleans in Report

Developer Manual Python - Report Lambdas

This example shows how to create volumetric boolean operations between volumetric datasets.   # Get inputs, in this case the entities that will have they volumes computed entityA = vf.input_entity("entityA", "Select Entity A", vf.type.voxel_generator | vf.t...

Read Process Results

Developer Manual Python - Process Lambdas

This example shows how to read the results of a Process Lambda execution. # The "project" variable contains the Project ID # The "process_id" variable contains the ID for the report entity csvdata = vf.get_file(project, process_id, 'my_result_data.csv')

Load and Write Pandas

Developer Manual Python - Report Lambdas

This example shows how to create a Pandas dataframe from voxels inside a Report Lambda program and output a different dataframe as a result.   import pandas import voxelfarm as vf entity = vf.input_entity("entity", "Select Entity", vf.type.block_model) ...

Initialize Process Lambda

Developer Manual Python - Process Lambdas

The following example shows how to obtain the lambda_host interface: from voxelfarm import process_lambda lambda_host = process_lambda.process_lambda_host()

Read inputs of Process Lambda

Developer Manual Python - Process Lambdas

The following example shows how to read inputs from a process lambda program: from voxelfarm import process_lambda lambda_host = process_lambda.process_lambda_host() mesh_entity = lambda_host.input_entity("mesh_entity_id", "Entity", vf.type.voxel_mesh) s...

Downloading files in Process Lambda

Developer Manual Python - Process Lambdas

This example shows how to download all files attached to an entity: from voxelfarm import process_lambda lambda_host = process_lambda.process_lambda_host() ml_files = lambda_host.download_entity_files(ml_entity)

Getting temp folder in Process Lambda

Developer Manual Python - Process Lambdas

This example shows how to get the path to the large capacity temp folder used for temporary storage: from voxelfarm import process_lambda lambda_host = process_lambda.process_lambda_host() scrap_folder = lambda_host.get_scrap_folder()

Attach file to Process Lambda

Developer Manual Python - Process Lambdas

The following example shows how to attach a file from the temporary drive to the running process lambda entity: from voxelfarm import process_lambda lambda_host = process_lambda.process_lambda_host() floor = os.path.join(scrap, 'tetra_mesh_floor.obj') la...

Log from Process Lambda

Developer Manual Python - Process Lambdas

The following example shows how to send a new line to the processing log: from voxelfarm import process_lambda lambda_host = process_lambda.process_lambda_host() lambda_host.log('My log message here)  

Set exit code for Process Lambda

Developer Manual Python - Process Lambdas

The following example shows how to set the exit code for a Process Lambda: from voxelfarm import process_lambda lambda_host = process_lambda.process_lambda_host() lambda_host.set_exit_code(0)  

Create Version from Blob Upload

Developer Manual Python - Workflow Interface

This example shows how to create a new version for a product by uploading files to a designated workflow blob drop-in: import os from azure.storage.blob import BlobServiceClient from io import BufferedReader from io import BytesIO import json CONTAINER...

Workflow Definition

Developer Manual Python - Workflow Interface

# This code runs inside the Voxel Farm platform # Import the workflow lambda api from voxelfarm import workflow_lambda # Also import the voxelfarm client from voxelfarm import voxelfarmclient # Define the workflow callback functions def receive_dat...

Read a Product property

Developer Manual Python - Workflow Interface

The following example reads the value of a property for a given product: # Import voxel farm client and workflow lambda from voxelfarm import voxelfarmclient from voxelfarm import workflow_lambda # Obtain the workflow_api interface workflow_api = workf...