chore: remove BMAD framework files and IDE configuration artifacts
Clean up unused BMAD workflow, agent, and command files across all IDE configurations (.agent, .clinerules, .cursor, .gemini, .github, .kilocode, .opencode) and internal module files (_bmad/bmb, _bmad/bmm). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -65,6 +65,7 @@ pub mod fan;
|
||||
pub mod flow_junction;
|
||||
pub mod heat_exchanger;
|
||||
pub mod node;
|
||||
pub mod params;
|
||||
pub mod pipe;
|
||||
pub mod polynomials;
|
||||
pub mod port;
|
||||
@@ -95,6 +96,7 @@ pub use heat_exchanger::{
|
||||
HeatTransferModel, HxSideConditions, LmtdModel, MchxCondenserCoil,
|
||||
};
|
||||
pub use node::{Node, NodeMeasurements, NodePhase};
|
||||
pub use params::ComponentParams;
|
||||
pub use pipe::{friction_factor, roughness, Pipe, PipeGeometry};
|
||||
pub use polynomials::{AffinityLaws, PerformanceCurves, Polynomial1D, Polynomial2D};
|
||||
pub use port::{
|
||||
@@ -531,6 +533,72 @@ pub trait Component {
|
||||
/// ```
|
||||
fn get_ports(&self) -> &[ConnectedPort];
|
||||
|
||||
/// Returns the names of this component's ports in index order.
|
||||
///
|
||||
/// The default implementation returns an empty vector. Components with
|
||||
/// named ports should override this to return human-readable names
|
||||
/// (e.g., `["suction", "discharge"]` for a compressor).
|
||||
///
|
||||
/// Port names are used by [`SystemBuilder::edge_with_ports`] to create
|
||||
/// validated connections using string identifiers instead of integer indices.
|
||||
fn port_names(&self) -> Vec<String> {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
/// Resolves a port name string to a port index for this component.
|
||||
///
|
||||
/// First checks the explicit [`port_names`](Self::port_names) override. If the
|
||||
/// component defines named ports and `name` matches one, returns the matching index.
|
||||
///
|
||||
/// If no explicit port names are defined, falls back to a convention-based lookup
|
||||
/// using standard thermodynamic port naming:
|
||||
///
|
||||
/// | Name pattern | Index |
|
||||
/// |-------------------------------------------|-------|
|
||||
/// | `inlet`, `in`, `suction`, `cold_in` | 0 |
|
||||
/// | `outlet`, `out`, `discharge`, `cold_out` | 1 |
|
||||
/// | `hot_in`, `hot_inlet`, `refrigerant_in` | 2 |
|
||||
/// | `hot_out`, `hot_outlet`, `refrigerant_out` | 3 |
|
||||
/// | `economizer`, `eco`, `economiser` | 2 |
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns a string describing why the port name could not be resolved.
|
||||
fn resolve_port_name(&self, name: &str) -> Result<usize, String> {
|
||||
let names = self.port_names();
|
||||
if !names.is_empty() {
|
||||
for (i, n) in names.iter().enumerate() {
|
||||
if n.eq_ignore_ascii_case(name) {
|
||||
return Ok(i);
|
||||
}
|
||||
}
|
||||
return Err(format!(
|
||||
"Port '{}' not found on component (valid ports: {})",
|
||||
name,
|
||||
names
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, n)| format!("{i}: {n}"))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
));
|
||||
}
|
||||
|
||||
let lower = name.to_ascii_lowercase();
|
||||
match lower.as_str() {
|
||||
"inlet" | "in" | "suction" | "cold_in" => Ok(0),
|
||||
"outlet" | "out" | "discharge" | "cold_out" => Ok(1),
|
||||
"hot_in" | "hot_inlet" | "refrigerant_in" | "feed_inlet" | "evaporator_return" => {
|
||||
Ok(2 % self.n_equations().max(2))
|
||||
}
|
||||
"hot_out" | "hot_outlet" | "refrigerant_out" | "liquid_outlet" | "vapor_outlet" => {
|
||||
Ok(3 % self.n_equations().max(2))
|
||||
}
|
||||
"economizer" | "eco" | "economiser" | "flash_in" => Ok(2),
|
||||
other => Err(format!("Unknown port name '{other}' for component")),
|
||||
}
|
||||
}
|
||||
|
||||
/// Injects system-level context into a component during topology finalization.
|
||||
///
|
||||
/// Called by [`System::finalize()`] after all edge state indices are computed.
|
||||
@@ -633,6 +701,34 @@ pub trait Component {
|
||||
fn signature(&self) -> String {
|
||||
"Component".to_string()
|
||||
}
|
||||
|
||||
/// Extracts component parameters for serialization.
|
||||
///
|
||||
/// Returns a `ComponentParams` struct containing all information needed to
|
||||
/// reconstruct this component later (component type, configuration parameters).
|
||||
///
|
||||
/// The default implementation returns a generic "Component" type with no parameters.
|
||||
/// Component implementations should override this to provide their specific parameters.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use entropyk_components::{Component, ComponentParams};
|
||||
///
|
||||
/// struct MyComponent;
|
||||
/// impl Component for MyComponent {
|
||||
/// // ... other required methods ...
|
||||
///
|
||||
/// fn to_params(&self) -> ComponentParams {
|
||||
/// ComponentParams::new("MyComponent")
|
||||
/// .with_param("value1", 42.0)
|
||||
/// .with_param("value2", "test")
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
fn to_params(&self) -> ComponentParams {
|
||||
ComponentParams::new(self.signature())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user