Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-12 08:24:55

0001 """
0002 Utility commands for AID2E CLI.
0003 
0004 Auxiliary commands for displaying information and managing resources:
0005 - list: Show available optimizers/templates/problems
0006 - version: Display version information
0007 - init: Create configs from templates (planned)
0008 - graph: Visualize workflow structure (planned)
0009 """
0010 
0011 from typing import Optional
0012 
0013 import click
0014 
0015 from aid2e import __MAIN_VERSION__
0016 
0017 
0018 @click.command()
0019 @click.argument("item_type", type=click.Choice(["optimizers", "templates", "problems"]), required=False)
0020 def list_resources(item_type: Optional[str]):
0021     """
0022     List available optimizers, templates, or problem types.
0023     
0024     Examples:
0025         aid2e list optimizers
0026         aid2e list templates
0027         aid2e list problems
0028         aid2e list  # Shows all categories
0029     """
0030     if item_type is None or item_type == "optimizers":
0031         click.echo(click.style("Available Optimizers:", fg="cyan", bold=True))
0032         click.echo("  • ax (Bayesian Optimization)")
0033         click.echo("    - Initialization: Sobol quasi-random")
0034         click.echo("    - Surrogate: SAASBO (Sparse Axis-Aligned Subspace BO)")
0035         click.echo("    - Acquisition: qNEHVI (Noisy Expected Hypervolume Improvement)")
0036         click.echo("    - Use case: Multi-objective optimization, continuous parameters")
0037         click.echo()
0038     
0039     if item_type is None or item_type == "templates":
0040         click.echo(click.style("Available Templates:", fg="cyan", bold=True))
0041         click.echo("  • dtlz2 - Multi-objective test problem (2 objectives, 10 variables)")
0042         click.echo("  • basic - Minimal configuration template")
0043         click.echo("  • epic_tracking - EPIC detector tracking optimization")
0044         click.echo()
0045     
0046     if item_type is None or item_type == "problems":
0047         click.echo(click.style("Supported Problem Types:", fg="cyan", bold=True))
0048         click.echo("  • toy - Benchmark test problems (DTLZ2, ZDT, etc.)")
0049         click.echo("  • epic_tracking - EPIC detector tracking system")
0050         click.echo("  • custom - User-defined evaluation functions")
0051         click.echo()
0052 
0053 
0054 @click.command()
0055 def version():
0056     """Display version information."""
0057     click.echo(f"AID2E Framework v{__MAIN_VERSION__}")
0058     click.echo("AI assisted Detector Design for EIC")
0059 
0060 
0061 # Future commands (placeholders for documentation)
0062 
0063 def init_command():
0064     """
0065     Create configuration files from templates (PLANNED).
0066     
0067     Will support:
0068     - Template-based generation
0069     - Interactive wizard mode
0070     - Type-specific templates (design/problem/optimization)
0071     
0072     Usage:
0073         aid2e init --template dtlz2
0074         aid2e init --type design > design.yml
0075         aid2e init --interactive
0076     """
0077     pass
0078 
0079 
0080 def graph_command():
0081     """
0082     Visualize workflow structure and dependencies (PLANNED).
0083     
0084     Will support:
0085     - Dependency graph generation
0086     - Export to PNG/SVG/DOT
0087     - Show parameter flow
0088     
0089     Usage:
0090         aid2e graph config.yml
0091         aid2e graph config.yml --output workflow.png
0092         aid2e graph config.yml --format svg
0093     """
0094     pass