Pull in refactor from old branch.#70
Merged
kbonney merged 4 commits intosandialabs:mainfrom Feb 24, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cleans up core abstractions in
src/pynumad/objects/, improves separation of concerns, eliminates dead code, and replaces parallel array structures withpandas.DataFrame.Structural / design changes
Blade.ispanis now a@propertydelegating todefinition.ispan, eliminating the need to keep two copies in syncBillOfMaterialsandMaterialDatabaseno longer inherit fromdict; both are plain classes with typed attributesBladeSettingscollapsed intoBlade(mesh_size: float = 0.45);settings.pydeletedStack/Plymoved to a newobjects/stack.pymodule;Layermoved frommaterialdb.pytomaterial.pyKEY_LABELSextracted as a module-level constant inkeypoints.pyand imported bycomponent.pyispanconsolidated toDefinition: Removedself.ispanfromGeometryentirely.Geometry.generate()now uses a local variable,update_oml_geometry()receives span location as an explicittransZparameter, and all external callers (KeyPoints,BillOfMaterials, analysis modules) read directly fromblade.definition.ispan.Data model changes
Definitionparallelndarrayattributes (chord,degreestwist,leband,sparcapwidth_hp, etc.) replaced by twopd.DataFrameobjects —span_data(indexed by span location) andispan_data(indexed by ispan location); original attribute names remain as properties for backward compatibilityBillOfMaterialshp/lp/swchanged from lists ofBillOfMaterialsEntryobjects topd.DataFrame; the separateindicesdict is removed and its contents are now columns within the same DataFrames;swconsolidates from a list-of-lists to a single DataFrame with aweb_idcolumnMaterialDatabaseEntryconverted to a@dataclassCode quality
Material,BillOfMaterialsEntry(now removed),Ply,Layer, andStationconverted to@dataclassrotate2dmoved toutils/affinetrans.py; airfoil utility functions made private (_prefix); dead_adjust_tedeletedComponent._compare()and redundant_compare()onLayerremoved in favor of__eq__ShearWebclass, MATLAB-remnant comment blocks, unreachableswRegionbranch, commented-outStationproperty stubsKeyPoints.generate()no longer mutatesdefinition.leband/definition.tebandGeometryconfig flags (_natural_offset,_rotorspin,_swtwisted) initialized toNonein__init__rather than hardcoded defaultsBillOfMaterials.generate()explicit inputs: Signature changed fromgenerate(definition, keypoints)togenerate(ispan, components, materials, keypoints), naming its actual dependencies rather than accepting the entireDefinitionobject.Bug fixes
Blade.__init__file-reading block was misplaced insideispan.setter; moved back to__init__keypoints.pyweb_areasscalar assignment failed whennp.dotreturned a 1-element array instead of a scalar; fixed withnp.squeeze+float()Definition.span/ispansetters now always recreate the DataFrame on assignment, fixing a pandas length-mismatch error triggered by the Excel reader's double-assignment patternTests and documentation
Tests still pass after the refactor!
Acknowledgement
By contributing to this software project, I acknowledge that I have reviewed the software quality assurance guidelines and that my contributions are submitted under the Revised BSD License.