Skip to content

Conversation

@carrino
Copy link
Member

@carrino carrino commented Jun 18, 2025

  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.

google-labs-jules bot and others added 9 commits June 18, 2025 05:37
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.
@carrino carrino merged commit db58d28 into develop Jun 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants