buffalo_wings.airfoil.AirfoilFactory
- class buffalo_wings.airfoil.AirfoilFactory[source]
Bases:
objectConstruct public airfoil runtime objects from user-facing specs.
This factory centralizes the mapping from serialized airfoil schema objects to the concrete runtime classes used by the geometry library.
Methods
camber_curve_from_document(document, *, name)Resolve one named document curve into a runtime camber result.
curve_from_document(document, *, name)Resolve one named document curve into a runtime open-curve object.
curve_result_from_document(document, *, name)Resolve one named document curve plus its provenance metadata.
default_spec(type_name, *[, source])Return the canonical starter spec for one public airfoil family.
describe_spec(spec)Return a human-readable summary for one airfoil definition spec.
exact_source_choices(type_name)Return exact-switch source choices for one airfoil family.
from_spec(spec)Build an airfoil runtime object from a validated schema definition.
mapping_source(mapping)Return which mutually exclusive source branch a mapping uses.
naca4_from_designation(designation)Build a classic NACA 4-digit airfoil from its designation string.
naca4_from_params(*, m, p, t[, ...])Build a parametric NACA 4-digit airfoil from explicit parameters.
naca4_modified_from_designation(designation)Build a classic modified NACA 4-digit airfoil from a designation.
naca4_modified_from_params(*, m, p, t, ...)Build a parametric modified NACA 4-digit airfoil from parameters.
naca5_from_designation(designation)Build a classic NACA 5-digit airfoil from its designation string.
naca5_from_params(*, ideal_lift_coefficient, ...)Build a parametric NACA 5-digit airfoil from explicit parameters.
naca5_modified_from_designation(designation)Build a classic modified NACA 5-digit airfoil from a designation.
naca5_modified_from_params(*, ...[, ...])Build a parametric modified NACA 5-digit airfoil from parameters.
Return stable metadata for public airfoil schema families.
switch_source_approx(mapping, target_source)Switch one airfoil family between source branches approximately.
switch_source_approx_result(mapping, ...)Switch one airfoil family approximately and report metadata.
switch_source_exact(mapping, target_source)Switch one exact-only NACA family between source branches.
- static from_spec(spec)[source]
Build an airfoil runtime object from a validated schema definition.
- Parameters:
spec (
AirfoilDefinitionSpec) – User-facing airfoil definition to dispatch to the appropriate runtime family.- Returns:
Concrete airfoil runtime instance compatible with
spec.- Return type:
- Raises:
TypeError – If
specdoes not belong to a supported schema family.ValueError – If
specfails family-specific validation during construction.
- static camber_curve_from_document(document, *, name)[source]
Resolve one named document curve into a runtime camber result.
- Parameters:
document (
AirfoilDocumentSpec) – Document containing named airfoils and named curves.name (
str) – Name of the curve entry indocument.curvesto resolve.
- Returns:
Exact or approximate runtime camber-curve result.
- Return type:
- Raises:
KeyError – If
nameor the referenced source airfoil name is unknown.NotImplementedError – If the referenced airfoil family is not constructable by the current runtime factory.
ValueError – If the curve approximation settings are invalid.
- static curve_from_document(document, *, name)[source]
Resolve one named document curve into a runtime open-curve object.
- Parameters:
document (
AirfoilDocumentSpec) – Document containing named airfoils and named curves.name (
str) – Name of the curve entry indocument.curvesto resolve.
- Returns:
Runtime open-curve object compatible with the named document entry.
- Return type:
- static curve_result_from_document(document, *, name)[source]
Resolve one named document curve plus its provenance metadata.
- Parameters:
document (
AirfoilDocumentSpec) – Document containing named airfoils and named curves.name (
str) – Name of the curve entry indocument.curvesto resolve.
- Returns:
Runtime curve together with schema and source metadata useful for downstream UI and analysis workflows.
- Return type:
- static describe_spec(spec)[source]
Return a human-readable summary for one airfoil definition spec.
- Parameters:
spec (
AirfoilDefinitionSpec) – User-facing airfoil definition to summarize.- Returns:
Immutable compact and verbose descriptions for
spec.- Return type:
- static supported_families()[source]
Return stable metadata for public airfoil schema families.
- Returns:
Ordered family descriptors for the currently recognized public schema surface.
- Return type:
tuple[AirfoilFamilyInfo,]
Notes
constructableidentifies which families the runtime factory can build today. Non-constructable families may still be part of the documented schema surface or planned public roadmap.
- static default_spec(type_name, *, source=None)[source]
Return the canonical starter spec for one public airfoil family.
- Parameters:
type_name (
str) – Stable public family discriminator fromAirfoilFactory.supported_families().source (
{"designation", "params"}| None, optional) – Requested source branch for families that support multiple construction forms. When omitted, this method uses the family’s canonicaldefault_sourcemetadata.
- Returns:
Schema-valid, editor-appropriate starter spec for the requested family.
- Return type:
AirfoilDefinitionSpec- Raises:
ValueError – If
type_nameis unsupported orsourceis incompatible with the requested family.
- static exact_source_choices(type_name)[source]
Return exact-switch source choices for one airfoil family.
- Return type:
tuple[DefaultSpecSource, …]
- static mapping_source(mapping)[source]
Return which mutually exclusive source branch a mapping uses.
- Return type:
DefaultSpecSource | None
- static switch_source_exact(mapping, target_source)[source]
Switch one exact-only NACA family between source branches.
- Return type:
Naca4AirfoilSpec | Naca4ModifiedAirfoilSpec | Naca5AirfoilSpec | Naca5ModifiedAirfoilSpec | Naca16AirfoilSpec | FlatPlateAirfoilSpec | BiconvexAirfoilSpec | BiconvexParabolaAirfoilSpec | PolygonAirfoilSpec | EllipseAirfoilSpec | CircularArcAirfoilSpec | JoukowskiAirfoilSpec | Naca6AirfoilSpec | Naca6AAirfoilSpec | FileAirfoilSpec | PointsAirfoilSpec | SplineAirfoilSpec | CstAirfoilSpec | ParsecAirfoilSpec
- static switch_source_approx_result(mapping, target_source)[source]
Switch one airfoil family approximately and report metadata.
- Return type:
- static switch_source_approx(mapping, target_source)[source]
Switch one airfoil family between source branches approximately.
- Return type:
Naca4AirfoilSpec | Naca4ModifiedAirfoilSpec | Naca5AirfoilSpec | Naca5ModifiedAirfoilSpec | Naca16AirfoilSpec | FlatPlateAirfoilSpec | BiconvexAirfoilSpec | BiconvexParabolaAirfoilSpec | PolygonAirfoilSpec | EllipseAirfoilSpec | CircularArcAirfoilSpec | JoukowskiAirfoilSpec | Naca6AirfoilSpec | Naca6AAirfoilSpec | FileAirfoilSpec | PointsAirfoilSpec | SplineAirfoilSpec | CstAirfoilSpec | ParsecAirfoilSpec
- static naca4_from_designation(designation)[source]
Build a classic NACA 4-digit airfoil from its designation string.
- Parameters:
designation (
str) – Four-digit NACA designation such as"2412".- Returns:
Runtime NACA 4-digit airfoil matching
designation.- Return type:
- Raises:
ValueError – If
designationis not a valid classic NACA 4-digit code.
- static naca4_from_params(*, m, p, t, trailing_edge='standard', leading_edge_radius='standard')[source]
Build a parametric NACA 4-digit airfoil from explicit parameters.
- Parameters:
m (
float) – Maximum camber as a fraction of chord.p (
float) – Chordwise location of maximum camber as a fraction of chord.t (
float) – Maximum thickness as a fraction of chord.trailing_edge (
{"standard", "sharp"}, default"standard") – Trailing-edge closure model for the thickness relation.leading_edge_radius (
{"standard", "exact"}, default"standard") – Leading-edge radius treatment for the thickness relation.
- Returns:
Runtime NACA 4-digit airfoil built from the supplied parameters.
- Return type:
- Raises:
ValueError – If any parameter falls outside the supported NACA 4-digit range.
- static naca4_modified_from_designation(designation)[source]
Build a classic modified NACA 4-digit airfoil from a designation.
- Parameters:
designation (
str) – Modified NACA 4-digit designation string.- Returns:
Runtime modified NACA 4-digit airfoil matching
designation.- Return type:
- Raises:
ValueError – If
designationis not a valid modified NACA 4-digit code.
- static naca4_modified_from_params(*, m, p, t, leading_edge_index, max_thickness_location, trailing_edge='standard')[source]
Build a parametric modified NACA 4-digit airfoil from parameters.
- Parameters:
m (
float) – Maximum camber as a fraction of chord.p (
float) – Chordwise location of maximum camber as a fraction of chord.t (
float) – Maximum thickness as a fraction of chord.leading_edge_index (
float) – Modified NACA leading-edge index used by the thickness model.max_thickness_location (
float) – Chordwise location of maximum thickness as a fraction of chord.trailing_edge (
{"standard", "sharp"}, default"standard") – Trailing-edge closure model for the thickness relation.
- Returns:
Runtime modified NACA 4-digit airfoil built from the supplied parameters.
- Return type:
- Raises:
ValueError – If any parameter falls outside the supported modified NACA 4-digit range.
- static naca5_from_designation(designation)[source]
Build a classic NACA 5-digit airfoil from its designation string.
- Parameters:
designation (
str) – Five-digit NACA designation such as"23012".- Returns:
Runtime NACA 5-digit airfoil matching
designation.- Return type:
- Raises:
ValueError – If
designationis not a valid classic NACA 5-digit code.
- static naca5_from_params(*, ideal_lift_coefficient, max_camber_location, reflexed, t, trailing_edge='standard', leading_edge_radius='standard')[source]
Build a parametric NACA 5-digit airfoil from explicit parameters.
- Parameters:
ideal_lift_coefficient (
float) – Design lift coefficient encoded by the NACA 5-digit family.max_camber_location (
float) – Chordwise location of maximum camber as a fraction of chord.reflexed (
bool) – Whether to use the reflexed camber-line variant.t (
float) – Maximum thickness as a fraction of chord.trailing_edge (
{"standard", "sharp"}, default"standard") – Trailing-edge closure model for the thickness relation.leading_edge_radius (
{"standard", "exact"}, default"standard") – Leading-edge radius treatment for the thickness relation.
- Returns:
Runtime NACA 5-digit airfoil built from the supplied parameters.
- Return type:
- Raises:
ValueError – If any parameter falls outside the supported NACA 5-digit range.
- static naca5_modified_from_designation(designation)[source]
Build a classic modified NACA 5-digit airfoil from a designation.
- Parameters:
designation (
str) – Modified NACA 5-digit designation string.- Returns:
Runtime modified NACA 5-digit airfoil matching
designation.- Return type:
- Raises:
ValueError – If
designationis not a valid modified NACA 5-digit code.
- static naca5_modified_from_params(*, ideal_lift_coefficient, max_camber_location, reflexed, t, leading_edge_index, max_thickness_location, trailing_edge='standard')[source]
Build a parametric modified NACA 5-digit airfoil from parameters.
- Parameters:
ideal_lift_coefficient (
float) – Design lift coefficient encoded by the NACA 5-digit family.max_camber_location (
float) – Chordwise location of maximum camber as a fraction of chord.reflexed (
bool) – Whether to use the reflexed camber-line variant.t (
float) – Maximum thickness as a fraction of chord.leading_edge_index (
float) – Modified NACA leading-edge index used by the thickness model.max_thickness_location (
float) – Chordwise location of maximum thickness as a fraction of chord.trailing_edge (
{"standard", "sharp"}, default"standard") – Trailing-edge closure model for the thickness relation.
- Returns:
Runtime modified NACA 5-digit airfoil built from the supplied parameters.
- Return type:
- Raises:
ValueError – If any parameter falls outside the supported modified NACA 5-digit range.