Example

End to end demonstration of how to create, run and download simulation results using the Lexset management API.

import lexsetAPI as lexset

token = "user token" #your token
SimulationConfig = "config.yaml"
numberOfImages = 1 #The number of data points you want your simulation to generate
userID = 999 #your user ID
nodes = 1 #The number GPU nodes you want to use to run this simulation
simulationName = "test mutiple nodes"
simulationDescription = "test five nodes API job"
randomSeed = 1

mySimulation = lexset.simulation(token,SimulationConfig,numberOfImages,userID,nodes,simulationName,simulationDescription,randomSeed)

mySimulation.createSimulation()

print("Your dataset ID")
print(mySimulation.dataID) #get your dataset ID
print("Your simulation ID")
print(mySimulation.simID)  #get your Simulation ID

mySimulation.startSimulation()

while mySimulation.isComplete == False:
    mySimulation.getStatus()
    print("simulation running")
    mySimulation.getProgress()
else:
    print("simulation is done!")
    mySimulation.downloadData()

Last updated