forked from tmcclintock/FrisPy
-
Notifications
You must be signed in to change notification settings - Fork 7
areo coefficients and smoke tests #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
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
1. **Reorganized Service API Tests**:
The tests formerly in `tests/test_service.py` have been reorganized
into more focused files:
- `tests/test_aero_coefficients_endpoint.py`
- `tests/test_flight_path_endpoints.py`
- `tests/test_root_endpoint.py`
A `tests/conftest.py` was added for shared fixtures (e.g., Flask client).
2. **Fixed Failing Tests in `tests/test_disc.py`**:
I addressed failures in `tests/test_disc.py` that arose after
dependency updates. This involved:
- Aligning test initial conditions with the quaternion-based system.
- Updating assertions related to initial conditions and trajectory results.
- Correcting test logic for specific scenarios.
All tests in `tests/test_disc.py` now pass.
3. **Added Landing Point Smoke Tests**:
I introduced new smoke tests in `tests/test_flight_smoke.py`. These
tests execute several predefined, realistic throw scenarios through the
flight path API endpoints and assert that the calculated landing
positions are within acceptable tolerances of pre-established baselines.
This provides a higher-level check on the integrity of the physics
simulation.
All existing and new tests pass, ensuring the stability and correctness
of the application after these changes.
Modifies the `.github/workflows/python-app.yml` to trigger on push and pull_request events to the `develop` branch, instead of `master`. This aligns the CI process with the project's default development branch.
I've updated the type hints in `frispy/throw_data.py` to use `typing.List` instead of the `list[...]]` syntax for generic types. This change is necessary for compatibility with Python 3.8, which does not support the `list[...]]` syntax (introduced in Python 3.9). The issue was causing `TypeError: 'type' object is not subscriptable` during test collection in GitHub Actions, which uses Python 3.8. All tests pass with this change.
Replaces the use of `math.ulp(1.0)` in `frispy/equations_of_motion.py` with a small epsilon value (`1e-12`). The `math.ulp` function was introduced in Python 3.9 and is not available in Python 3.8, which is used by the GitHub Actions CI. This was causing an `AttributeError` and failing tests in the CI environment. Using `1e-12` as a threshold for checking if a floating-point value (norm of in-plane velocity) is non-negligible serves a similar purpose and ensures compatibility with Python 3.8. All tests pass with this change.
Specifically, I replaced another instance of `math.ulp(1)` in the `frispy/equations_of_motion.py` file (within the `compute_forces` method) with a small epsilon value (`1e-12`). This change builds upon the previous fix for `math.ulp` to prevent `AttributeError` in Python 3.8 environments, since `math.ulp` was introduced in Python 3.9. All tests are passing with this update. This should resolve any remaining `math.ulp` related errors you were seeing.
Updates the GitHub Actions workflow in `.github/workflows/python-app.yml` to use Python 3.9 instead of 3.8. This aligns the CI environment more closely with the production environment, which also uses Python 3.9+. Following this CI update, the previous modifications in `frispy/equations_of_motion.py` that replaced `math.ulp` calls with a small epsilon (1e-12) for Python 3.8 compatibility have been reverted. The code now uses `math.ulp(1.0)` and `math.ulp(1)` as originally intended, which is supported in Python 3.9+. All tests pass with these changes.
Removes now-obsolete informational comments (e.g., "# Changed from ...") from the GitHub Actions workflow file `.github/workflows/python-app.yml`. These comments were artifacts from previous automated changes and are not intended for the repository.
Updates type hints in `frispy/throw_data.py` to use the built-in generic syntax (e.g., `list[int]` instead of `typing.List[int]`). The `from typing import List` import and an associated informational comment have been removed. This change is made following the update of the CI environment to Python 3.9, which supports this modern type hinting syntax (PEP 585). All tests pass with this change.
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.
Reorganized Service API Tests: The tests formerly in
tests/test_service.pyhave been reorganized into more focused files:tests/test_aero_coefficients_endpoint.pytests/test_flight_path_endpoints.pytests/test_root_endpoint.pyAtests/conftest.pywas added for shared fixtures (e.g., Flask client).Fixed Failing Tests in
tests/test_disc.py: I addressed failures intests/test_disc.pythat arose after dependency updates. This involved:tests/test_disc.pynow pass.Added Landing Point Smoke Tests: I introduced new smoke tests in
tests/test_flight_smoke.py. These tests execute several predefined, realistic throw scenarios through the flight path API endpoints and assert that the calculated landing positions are within acceptable tolerances of pre-established baselines. This provides a higher-level check on the integrity of the physics simulation.All existing and new tests pass, ensuring the stability and correctness of the application after these changes.