Metadata-Version: 2.1
Name: madsci.experiment_application
Version: 0.5.0rc1
Summary: The Modular Autonomous Discovery for Science (MADSci) Experiment Application framework.
Author-Email: Tobias Ginsburg <tginsburg@anl.gov>, "Ryan D. Lewis" <ryan.lewis@anl.gov>, Casey Stone <cstone@anl.gov>, Doga Ozgulbas <dozgulbas@anl.gov>
License: MIT
Project-URL: Homepage, https://github.com/AD-SDL/MADSci
Requires-Python: >=3.9.1
Requires-Dist: madsci.common
Requires-Dist: madsci.client
Requires-Dist: madsci.node_module
Requires-Dist: rich>=10.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: typing-extensions>=4.0.0
Description-Content-Type: text/markdown

# MADSci Experiment Application

The MADSci Experiment Application provides a framework for creating and managing scientific experiments within the MADSci ecosystem.

## Overview

The `ExperimentApplication` class serves as a base class for creating experiment applications that can:

- Manage experiment lifecycle (start, pause, cancel, end)
- Interact with MADSci manager services (experiment, data, resource, workcell, event)
- Handle experiment conditions and resource validation
- Operate in both standalone and server modes

## Key Features

- **Experiment Management**: Start, pause, resume, cancel, and end experiments
- **Resource Validation**: Evaluate resource conditions before experiment execution
- **Event Logging**: Integrated logging through the event management system
- **Context Management**: Automatic experiment context handling
- **Server Mode**: Can operate as a REST node for remote experiment execution

## Dependencies

- `madsci.common`: Shared types and utilities
- `madsci.client`: Client libraries for MADSci services
- `madsci.node_module`: Node framework for REST endpoints

## Usage

```python
from madsci.experiment_application import ExperimentApplication

# Create an experiment application
app = ExperimentApplication(
    experiment_design=my_experiment_design,
    experiment_server_url="http://localhost:8002"
)

# Start and manage an experiment
with app.manage_experiment(run_name="My Experiment"):
    # Your experiment code here
    pass
```

## Configuration

The application can be configured through environment variables, TOML files, or direct instantiation:

- Environment prefix: `EXPERIMENT_`
- Config files: `experiment.env`, `experiment.settings.toml`, etc.
