Core API reference
Core classes and functionality for idmtools.
Overview
The idmtools.core package provides the foundational classes and interfaces for building simulations, experiments, and interacting with platforms.
Quick reference
Core classes
| Class | Module | Description |
|---|---|---|
Platform |
idmtools.core.platform_factory |
Creates a connection to a compute platform |
Experiment |
idmtools.entities.experiment |
A collection of simulations |
Simulation |
idmtools.entities.simulation |
A single model run with specific parameters |
SimulationBuilder |
idmtools.builders |
Builds simulations from parameter sweeps |
CommandLine |
idmtools.entities |
Defines the command to execute |
AssetCollection |
idmtools.assets |
A collection of files for simulations |
Asset |
idmtools.assets |
A single file asset |
ITask |
idmtools.entities.itask |
Base class for all tasks |
IAnalyzer |
idmtools.entities |
Base class for analyzers |
Common methods
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Platform factory
Platform
The main entry point for creating platform instances:
1 2 3 4 | |
Key Methods:
get_item()- Retrieve entity by IDcreate_items()- Create entities on platformget_directory()- Get working directory for entityrefresh_status()- Update entity status
Entities
IEntity
Base interface for all entities: Experiment, Simulation, Suite, ITask, AssetCollection, IWorkflowItem
Methods:
pre_creation()- Hook called before creationpost_creation()- Hook called after creationto_dict()- Serialize to dictionaryfrom_dict()- Deserialize from dictionary
Simulation
Represents a single simulation:
1 2 3 4 5 | |
Key Methods:
- from_task() - Create from task
- add_asset() - Add input file
- set_parameter() - Set task parameter
Experiment
Collection of simulations:
1 2 3 4 5 | |
Key Methods:
- from_task() - Create from Task
- from_template() - Create from TemplatedSimulations
- from_builder() - Create from SimulationBuilder
- run() - Execute on platform
- refresh_status() - Update status
Suite
Collection of experiments:
1 2 3 4 5 6 | |
Key Methods:
add_experiment()- Add experiment to suiterun()- Execute all experiments
Tasks
ITask
Base interface for tasks:
Methods:
set_parameter()- Set parameter valueget_parameter()- Get parameter valuepre_creation()- Pre-execution hook
CommandTask
Execute shell commands:
1 2 3 4 | |
Attributes:
command- Command to executeparameters- Command parameters
Builders
SimulationBuilder
Build parameter sweeps:
1 2 3 4 5 6 7 | |
Key Methods:
add_sweep_definition()- Add parameter sweepbuild()- Generate simulations
Assets
AssetCollection
Manage input files:
1 2 3 4 5 | |
Key Methods:
add_asset()- Add single fileadd_directory()- Add directoryget_asset()- Get asset by nameremove_asset()- Remove asset
Asset
Represents a single file:
1 2 3 4 5 6 | |
Attributes:
absolute_path- Source file pathrelative_path- Destination path in simulationfilename- File name
Platform interface
IPlatform
Interface all platforms implement:
Key Methods:
create_items()- Create entitiesget_item()- Retrieve entityrefresh_status()- Update statusget_directory()- Get working directoryget_files()- List entity filesretrieve_output_files()- Download outputs
EntityStatus
Entity status values:
1 2 3 4 5 6 7 | |
Configuration
IdmConfigParser
Configuration file parser:
1 2 3 4 | |
Key Methods:
load()- Load configurationget_section()- Get config sectionget_option()- Get config option
Hooks and callbacks
Pre/post creation hooks
1 2 3 4 5 6 7 8 | |
See also
- Models API - Task implementations
- Platforms API - Platform implementations
- User Guide - Usage examples
- Tutorials - Hands-on examples