Back to home page

EIC code displayed by LXR

 
 

    


Warning, /AID2E-framework/docs/index.md is written in an unsupported language. File is not indexed.

0001 # AID2E Framework
0002 
0003 AI assisted Detector Design for EIC (AID2E) is a Python framework for configuring and running detector design optimization workflows. It provides typed configuration models, optimizer and scheduler integrations, workflow execution, a command-line interface, and ePIC-specific utilities.
0004 
0005 ## Start Here
0006 
0007 - [Installation](getting-started/installation.md): Install AID2E and optional dependencies.
0008 - [Quick Start](getting-started/quick-start.md): Validate and run the DTLZ2 example.
0009 
0010 ## User Guide
0011 
0012 - [Configuration](user-guide/configuration.md): Define problems, design spaces, optimizers, schedulers, and workflows.
0013 - [Workflows](user-guide/workflows.md): Execute stages, jobs, stack layers, and objective plans.
0014 - [Optimizers](user-guide/optimizers.md): Configure Ax and PyMOO.
0015 - [Schedulers](user-guide/schedulers.md): Configure JobLib, Slurm, and PanDA/iDDS.
0016 - [CLI](user-guide/cli.md): Inspect configurations and run optimization workflows.
0017 
0018 ## How Optimization Runs
0019 
0020 When a user runs `aid2e optimize`, the framework:
0021 
0022 1. Loads and validates the full configuration.
0023 2. Builds the configured optimizer and schedulers.
0024 3. Requests a batch of candidate design points from the optimizer.
0025 4. Executes one configured workflow for each candidate.
0026 5. Collects the objective values and updates the optimizer.
0027 6. Saves the run results and requests another batch until the configured evaluation budget is complete.
0028 
0029 ## Contributing
0030 
0031 ### Development Setup
0032 
0033 Follow the [installation guide](getting-started/installation.md), then install the development and documentation tools:
0034 
0035 ```bash
0036 python -m pip install -e ".[dev,docs]"
0037 ```
0038 
0039 ### Contribution Workflow
0040 
0041 1. **Create a branch** for your changes:
0042 ```bash
0043    git checkout -b feature/your-feature-name
0044 ```
0045 
0046 2. **Make changes** in `src/aid2e/`. Keep imports under the `aid2e` namespace.
0047 
0048 3. **Add tests** in the corresponding `tests/` directory. Update documentation and fixtures when changing configuration schemas.
0049 
0050 4. **Run tests**:
0051 ```bash
0052    # Run all tests
0053    pytest tests/
0054 
0055    # Run with coverage
0056    pytest tests/ --cov=src/aid2e --cov-report=html
0057 
0058    # Run a specific test file
0059    pytest tests/test_cli/test_cli.py
0060 ```
0061 
0062    Example fixtures live in `tests/test_utilities/fixtures/dtlz2/`
0063    (`design.params`, `problem.config`).
0064 
0065 5. **Format and lint** the code:
0066 ```bash
0067    black src/ tests/
0068    isort src/ tests/
0069    flake8 src/ tests/
0070    mypy src/
0071 ```
0072 
0073 6. **Commit and push**:
0074 ```bash
0075    git add .
0076    git commit -m "Description of changes"
0077    git push origin feature/your-feature-name
0078 ```
0079 
0080 7. **Open a pull request** on GitHub.
0081 
0082 **CLI design principles**
0083 
0084 The CLI follows these design principles:
0085 
0086 1. **Auto-detection**: Commands should detect config type automatically.
0087 2. **Consistency**: Similar output formats across commands.
0088 3. **Composability**: JSON and YAML output formats for scripting.
0089 4. **Clear errors**: Specific, actionable error messages.
0090 5. **Progressive disclosure**: Compact by default, detailed on demand.
0091 6. **Exit codes**: `0` for success, `1` for command failures, and `2` for invalid CLI usage.
0092 
0093 ### Maintaining Documentation
0094 
0095 **Build and preview**
0096 
0097 The repository provides scripts to build or preview the documentation:
0098 
0099 ```bash
0100 # Build the static site into site/
0101 ./scripts/docs-build.sh
0102 
0103 # Preview locally with live reload
0104 ./scripts/docs-serve.sh
0105 ```
0106 
0107 When previewing, the documentation is available at `http://localhost:8000/`.
0108 
0109 **Writing and API documentation**
0110 
0111 MkDocs site sources are under `docs/` using the Material theme. Navigation is defined in `mkdocs.yml`.
0112 
0113 - Add new pages under `docs/` as `.md` files.
0114 - Update navigation in `mkdocs.yml` under the `nav:` section.
0115 - Use Markdown and admonitions supported by the Material theme.
0116 
0117 MkDocs uses `mkdocstrings` to generate Python API documentation. Ensure modules under `src/aid2e/` are importable when building the site.
0118 
0119 **Deployment**
0120 
0121 Pushes to `main` and manual workflow runs deploy the documentation through `.github/workflows/docs-deploy.yml`.
0122 
0123 To deploy manually to GitHub Pages:
0124 
0125 ```bash
0126 ./scripts/docs-deploy-ghpages.sh
0127 ```
0128 
0129 GitHub Pages must be enabled in the repository settings before using the manual
0130 deployment script.
0131 
0132 **Troubleshooting**
0133 
0134 - If `mkdocs` is not found, install the documentation extras with `python -m pip install -e ".[docs]"`.
0135 - If API pages fail to render, verify the import paths in `mkdocs.yml` and that the package is installed in editable mode with `python -m pip install -e .`.
0136 
0137 ## Repository Structure
0138 
0139 ```text
0140 AID2E-framework/
0141 |-- src/aid2e/
0142 |   |-- cli/
0143 |   |-- optimizers/
0144 |   |-- schedulers/
0145 |   `-- utilities/
0146 |       |-- configurations/
0147 |       |-- epic_utils/
0148 |       `-- workflows/
0149 |-- examples/
0150 |-- tests/
0151 |-- docs/
0152 |-- scripts/
0153 |-- .github/workflows/
0154 |-- pyproject.toml
0155 |-- mkdocs.yml
0156 `-- pytest.ini
0157 ```
0158 
0159 ## Support
0160 
0161 For issues or questions, use the [AID2E issue tracker](https://github.com/aid2e/AID2E-framework/issues).