Tests : Created unit tests for _functions.py#169
Open
20086080 wants to merge 1 commit intocamUrban:mainfrom
Open
Tests : Created unit tests for _functions.py#16920086080 wants to merge 1 commit intocamUrban:mainfrom
20086080 wants to merge 1 commit intocamUrban:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #169 +/- ##
=======================================
Coverage 91.69% 91.69%
=======================================
Files 35 35
Lines 6828 6828
=======================================
Hits 6261 6261
Misses 567 567 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Description
Add targeted unit tests for four utility functions in _functions.py that were previously flagged with # TEST comments.
These tests improve confidence in the mathematical utility layer of PteraSoftware by validating interpolation, centroid calculation, cosine spacing, and vector cross-product behavior using deterministic analytical cases.
Motivation
The flagged utility functions perform low-level numerical and geometric operations that are reused throughout the codebase. Although relatively compact, they contain mathematical logic where regressions or subtle numerical errors could propagate into higher-level aerodynamic calculations.
Adding focused unit tests improves maintainability and makes future refactoring safer by validating expected numerical behavior in isolation.
Relevant Issues
Closes Issue #146
Changes
New Tests
Added dedicated unit tests in test_functions.py for the following utility functions in _functions.py:
Test Coverage
TestCosspace
TestNumbaCentroidOfQuadrilateral
TestNumba1dExplicitCross
TestInterpBetweenPoints
Testing Methodology
Tests are deterministic and numerically validated using analytical expectations and invariant-based checks.
The testing approach focuses on:
Note - Tight tolerances (atol=1e-14) were used where appropriate to ensure numerical precision.
Validation
Dependency Updates
None
Change Magnitude
Minor: Adds focused unit tests for existing utility functions without modifying runtime behavior.
Checklist (check each item when completed or not applicable)
mainand is up to date with the upstreammainbranch.--in-place --black). See the style guide for type hints and docstrings for more details.pterasoftwarepackage use type hints. See the style guide for type hints and docstrings for more details.testspackage.testspackage.black,codespell, andisortGitHub actions.mypyGitHub action.testsGitHub actions.