Harden numeric input type handling across geometry/problem setup and add mixed-type coverage tests - #100
Draft
rebeccamccabe with Copilot wants to merge 1 commit into
Draft
Harden numeric input type handling across geometry/problem setup and add mixed-type coverage tests#100rebeccamccabe with Copilot wants to merge 1 commit into
rebeccamccabe with Copilot wants to merge 1 commit into
Conversation
Copilot created this pull request from a session on behalf of
rebeccamccabe
July 28, 2026 03:24
View session
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.
Intermittent failures were traced to inconsistent handling of numeric input types (Python floats/lists vs NumPy scalar/ndarray) in core setup paths. This change standardizes those inputs and adds focused tests to ensure equivalent behavior across scalar, vector, and mixed-type call patterns.
Input normalization in core constructors/setters
SteppedBody.__init__now normalizesa,d, andslant_anglevia NumPy (np.asarray+np.atleast_1d) before length checks.MEEMProblem.set_frequenciesnow accepts float, scalar ndarray, list, or ndarray and stores frequencies as a 1D NumPy array.BasicRegionGeometry.from_vectorsnow normalizesa,d, and optionalslant_angleto NumPy arrays and validates shape/length consistency early.Type-compatibility regression coverage (minimal repetition)
package/test/test_input_type_compatibility.pywith parametrized tests covering:SteppedBody,ConcentricBodyGroup,BasicRegionGeometry,MEEMProblem,MEEMEnginemulti_equationsmethods for:Failure modes addressed
SteppedBodyconstruction no longer fails onlen(float).from_vectorsno longer fails on list inputs with mapped indexing.set_frequenciesno longer rejects/incorrectly processes non-ndarray scalar/list inputs.