How plaid-lib/plaid works
Project type and purpose
• PLAID is a Python library (package) providing a datamodel and workflows for machine‐learning on physics simulation data. It is not a full‐stack web app but a domain‐specific library with core modules, data adapters (“bridges”), container objects, problem definitions, post‐processing, utilities, and type definitions.
a. Core Package (src/plaid)
• constants.py – shared configuration values
• types/ – data type definitions (CGNS types, common types)
• containers/ – Dataset and Sample containers, plus utility methods
• problem_definition.py – problem metadata and splitting rules
• bridges/ – adapters for external frameworks (e.g. Huggingface)
• post/ – post‐processing modules (bisect, metrics)
• utils/ – supporting functions (IO helpers, interpolation, stats, split)
b. External Interfaces
• File System I/O (CGNS mesh files, CSV scalar data, YAML/JSON configs)
• External ML frameworks (Huggingface via huggingface_bridge)
• Muscat (optional dependency for advanced sampling)
c. Examples & Tests
• examples/ – demonstration scripts invoking the core package
• tests/ – unit tests organized by module, verifying end‐to‐end flows
Relationships and data flow
a. User code → bridges → containers (loading data)
b. containers → problem_definition (defining train/test splits and problem metadata)
c. containers + problem_definition → model training/inference (outside PLAID)
d. model outputs (predictions) → post modules → metrics and bisect analyses
e. utils and types are supporting layers: all modules import from utils and types
Architectural patterns and design principles
• Modular package structure with clear separation of concerns
• Adapters (“bridges”) encapsulate external dependencies
• Immutable data containers for Dataset and Sample
• Config‐driven workflows (environment.yml, pyproject.toml, JSON/YAML in benchmarks and examples)
Final recommendations
• Be precise: capture all six core subpackages under src/plaid
• External dependencies (Huggingface, Muscat) even if optional
• CI/Test and docs workflows optionally as side notes