idmtools_platform_local.platform_operations.simulation_operations module¶
-
class
idmtools_platform_local.platform_operations.simulation_operations.
LocalPlatformSimulationOperations
(platform: 'LocalPlatform', platform_type: type = <class 'idmtools_platform_local.platform_operations.uitils.SimulationDict'>)¶ Bases:
idmtools.entities.iplatform_ops.iplatform_simulation_operations.IPlatformSimulationOperations
-
platform
: ‘LocalPlatform’¶
-
platform_type
¶ alias of
idmtools_platform_local.platform_operations.uitils.SimulationDict
-
get
(simulation_id: uuid.UUID, **kwargs) → Dict¶ Fetch simulation with specified id :param simulation_id: simulation id :param **kwargs:
- Returns
SimulationDIct
-
platform_create
(simulation: idmtools.entities.simulation.Simulation, **kwargs) → Dict¶ Create a simulation object
- Parameters
simulation – Simulation to create
**kwargs –
- Returns
Simulation dict and created id
-
batch_create
(sims: List[idmtools.entities.simulation.Simulation], **kwargs) → List[idmtools_platform_local.platform_operations.uitils.SimulationDict]¶ Batch creation of simulations.
This is optimized by bulk uploading assets after creating of all the assets
- Parameters
sims – List of sims to create
**kwargs –
- Returns
List of SimulationDict object and their IDs
-
get_parent
(simulation: idmtools_platform_local.platform_operations.uitils.SimulationDict, **kwargs) → idmtools_platform_local.platform_operations.uitils.ExperimentDict¶ Get the parent of a simulation, aka its experiment
- Parameters
simulation – Simulation to get parent from
**kwargs –
- Returns
ExperimentDict object
-
platform_run_item
(simulation: idmtools.entities.simulation.Simulation, **kwargs)¶ On the local platform, simulations are ran by queue and commissioned through create :param simulation:
Returns:
-
send_assets
(simulation: idmtools.entities.simulation.Simulation, worker: docker.models.containers.Container = None, **kwargs)¶ Transfer assets to local sim folder for simulation
- Parameters
simulation – Simulation object
worker – docker worker containers. Useful in batches
Returns:
-
refresh_status
(simulation: idmtools.entities.simulation.Simulation, **kwargs)¶ Refresh status of a sim
- Parameters
simulation –
Returns:
-
get_assets
(simulation: idmtools.entities.simulation.Simulation, files: List[str], **kwargs) → Dict[str, bytearray]¶ Get assets for a specific simulation
- Parameters
simulation – Simulation object to fetch files for
files – List of files to fetch
- Returns
Returns a dict containing mapping of filename->bytearry
-
list_assets
(simulation: idmtools.entities.simulation.Simulation, **kwargs) → List[idmtools.assets.asset.Asset]¶ List assets for a sim
- Parameters
simulation – Simulation object
Returns:
-
to_entity
(local_sim: Dict, load_task: bool = False, parent: Optional[idmtools.entities.experiment.Experiment] = None, **kwargs) → idmtools.entities.simulation.Simulation¶ Convert a sim dict object to an ISimulation
- Parameters
local_sim – simulation to convert
load_task – Load Task Object as well. Can take much longer and have more data on platform
parent – optional experiment object
**kwargs –
- Returns
ISimulation object
-