Back to home page

EIC code displayed by LXR

 
 

    


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

0001 # AID2E Framework - Installation Guide
0002 
0003 ## Overview
0004 
0005 The AID2E Framework is a modular project containing the CLI, optimizers, schedulers, and utilities for AI-assisted detector design for the EIC. All modules are organized within the `src/aid2e/` directory structure.
0006 
0007 ## Installation
0008 
0009 ### Install with Core Dependencies
0010 
0011 ```bash
0012 pip install -e .
0013 ```
0014 
0015 This installs the framework with core dependencies:
0016 - `pyyaml>=5.4` - YAML configuration parsing
0017 - `pydantic>=2.0` - Data validation
0018 - `click>=8.0` - CLI framework
0019 
0020 ### Install with Development Tools
0021 
0022 ```bash
0023 pip install -e ".[dev]"
0024 ```
0025 
0026 Installs development tools for testing and code quality:
0027 - `pytest>=6.0` - Testing framework
0028 - `pytest-cov>=2.12` - Code coverage
0029 - `black>=21.0` - Code formatter
0030 - `flake8>=3.9` - Linter
0031 - `isort>=5.9` - Import sorting
0032 - `mypy>=0.910` - Type checking
0033 
0034 ### Install with Documentation Tools
0035 
0036 ```bash
0037 pip install -e ".[docs]"
0038 ```
0039 
0040 Installs documentation generation tools:
0041 - `mkdocs>=1.2` - Documentation generator
0042 - `mkdocs-material>=7.1` - Material theme
0043 - `mkdocstrings>=0.18` - API documentation
0044 - `mkdocstrings-python>=1.0.0` - Python docstring support
0045 
0046 ### Install Everything
0047 
0048 ```bash
0049 pip install -e ".[dev,docs]"
0050 ```
0051 
0052 ## Project Structure
0053 
0054 ```
0055 AID2E-framework/
0056 ├── src/aid2e/                     # Main source package
0057 │   ├── __init__.py
0058 │   ├── cli/                       # Command-line interface
0059 │   │   ├── __init__.py
0060 │   │   └── aid2e_cli.py
0061 │   ├── optimizers/                # Optimization algorithms
0062 │   │   └── __init__.py
0063 │   ├── schedulers/                # Job schedulers
0064 │   │   └── __init__.py
0065 │   └── utilities/                 # Utility modules
0066 │       ├── __init__.py
0067 │       ├── configurations/        # Configuration loading
0068 │       │   ├── __init__.py
0069 │       │   ├── base_models.py
0070 │       │   ├── design_config.py
0071 │       │   ├── problem_config.py
0072 │       │   ├── optimization_config.py
0073 │       │   ├── optimization_registry.py
0074 │       │   └── full_config.py
0075 │       └── epic_utils/            # EIC physics utilities
0076 │           ├── __init__.py
0077 │           ├── epic_design_config.py
0078 │           ├── epic_env_config.py
0079 │           └── epic_problem_config.py
00800081 ├── tests/                         # Test suite
0082 │   ├── __init__.py
0083 │   ├── conftest.py
0084 │   ├── test_integration.py
0085 │   ├── test_cli/
0086 │   │   ├── test_cli_module.py
0087 │   │   └── test_cli.py
0088 │   ├── test_optimizers/
0089 │   │   └── test_optimizers_module.py
0090 │   ├── test_schedulers/
0091 │   │   └── test_schedulers_module.py
0092 │   ├── test_utilities/
0093 │   │   ├── test_utilities_module.py
0094 │   │   ├── test_configurations/
0095 │   │   │   ├── test_config_file_loading.py
0096 │   │   │   └── test_configurations_module.py
0097 │   │   └── test_epic_utils/
0098 │   │       ├── test_epic_design_config.py
0099 │   │       └── test_epic_utils_module.py
0100 │   └── integration/
0101 │       └── test_integration_example.py
01020103 ├── docs/                          # Documentation (MkDocs)
0104 │   ├── README.md
0105 │   ├── docs-guide.md
0106 │   ├── user-guide/
0107 │   │   └── overview.md
0108 │   └── api-reference/
0109 │       ├── cli.md
0110 │       ├── optimizers.md
0111 │       ├── schedulers.md
0112 │       └── utilities.md
01130114 ├── examples/                      # Configuration examples
0115 │   ├── basic/
0116 │   │   ├── design.params
0117 │   │   ├── full_example.yml
0118 │   │   ├── optimizer.config
0119 │   │   ├── problem.config
0120 │   │   └── slurm.template
0121 │   └── configurations/
0122 │       ├── dtlz2_optimization.yml
0123 │       ├── epic_tracking_optimization.yml
0124 │       └── README.md
01250126 ├── scripts/                       # Helper scripts
0127 │   ├── docs-build.sh
0128 │   ├── docs-deploy-ghpages.sh
0129 │   └── docs-serve.sh
01300131 ├── .github/
0132 │   └── instructions/              # Project instructions
0133 │       └── project-def.instructions.md
01340135 ├── pyproject.toml                 # Project configuration
0136 ├── pytest.ini                     # Pytest configuration
0137 ├── mkdocs.yml                     # Documentation configuration
0138 ├── README.md                      # Project overview
0139 └── INSTALLATION.md                # This file
0140 ```
0141 
0142 ## Using the AID2E CLI
0143 
0144 After installation, the `aid2e` command-line tool is available:
0145 
0146 ```bash
0147 # Display version
0148 aid2e --version
0149 
0150 # Show available commands
0151 aid2e --help
0152 
0153 # Load and display configuration
0154 aid2e load examples/basic/full_example.yml
0155 
0156 # Show configuration details
0157 aid2e info examples/basic/full_example.yml
0158 ```
0159 
0160 ## Import Examples
0161 
0162 ### Using Modules in Python
0163 
0164 ```python
0165 # CLI module
0166 from aid2e.cli import cli
0167 
0168 # Optimizers module
0169 from aid2e.optimizers import SomeOptimizer
0170 
0171 # Schedulers module
0172 from aid2e.schedulers import SomeScheduler
0173 
0174 # Configuration utilities
0175 from aid2e.utilities.configurations import load_config, FullConfig
0176 from aid2e.utilities.epic_utils import some_function
0177 ```
0178 
0179 ### Loading Configurations
0180 
0181 ```python
0182 from aid2e.utilities.configurations import load_config
0183 
0184 # Load a full configuration
0185 config = load_config('examples/basic/full_example.yml')
0186 
0187 # Access configuration components
0188 print(config.design)
0189 print(config.problem)
0190 print(config.optimization)
0191 ```
0192 
0193 ## Development Workflow
0194 
0195 ### Setting Up for Development
0196 
0197 ```bash
0198 # Clone the repository
0199 git clone https://github.com/aid2e/AID2E-framework.git
0200 cd AID2E-framework
0201 
0202 # Create a virtual environment
0203 python -m venv .venv
0204 source .venv/bin/activate  # On Windows: .venv\Scripts\activate
0205 
0206 # Install with all development tools
0207 pip install -e ".[dev,docs]"
0208 ```
0209 
0210 ### Running Tests
0211 
0212 ```bash
0213 # Run all tests
0214 pytest tests/
0215 
0216 # Run with verbose output
0217 pytest tests/ -v
0218 
0219 # Run with coverage report
0220 pytest tests/ --cov=src/aid2e --cov-report=html
0221 
0222 # Run specific test file
0223 pytest tests/test_cli/test_aid2e_cli.py
0224 ```
0225 
0226 ### Building Documentation Locally
0227 
0228 ```bash
0229 # Build static site
0230 mkdocs build
0231 
0232 # Serve documentation locally (with live reload)
0233 mkdocs serve
0234 ```
0235 
0236 The documentation will be available at `http://localhost:8000/`
0237 
0238 ### Code Quality
0239 
0240 ```bash
0241 # Format code with black
0242 black src/ tests/
0243 
0244 # Check code style with flake8
0245 flake8 src/ tests/
0246 
0247 # Sort imports with isort
0248 isort src/ tests/
0249 
0250 # Type checking with mypy
0251 mypy src/
0252 ```
0253 
0254 ### Making Changes
0255 
0256 1. **Create a branch** for your changes:
0257    ```bash
0258    git checkout -b feature/your-feature-name
0259    ```
0260 
0261 2. **Make changes** to files in `src/aid2e/`
0262 
0263 3. **Write tests** in the corresponding `tests/` directory
0264 
0265 4. **Run tests** to ensure everything works:
0266    ```bash
0267    pytest tests/ -v
0268    ```
0269 
0270 5. **Format and lint** your code:
0271    ```bash
0272    black src/ tests/
0273    isort src/ tests/
0274    flake8 src/ tests/
0275    ```
0276 
0277 6. **Commit and push**:
0278    ```bash
0279    git add .
0280    git commit -m "Description of changes"
0281    git push origin feature/your-feature-name
0282    ```
0283 
0284 7. **Open a Pull Request** on GitHub