Skip to content
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

Fresh install of pip install aerosandbox[full,test], and it fails one test #129

Open
carsonwmoon opened this issue Mar 28, 2024 · 1 comment

Comments

@carsonwmoon
Copy link

Bug Description / Observed Behavior

The following pytest error was returned after a fresh install of pip install aerosandbox[full,test] and asb.run_tests() in python.

================================================================================== FAILURES ==================================================================================
__________________________________________________________________________ test_repaneling_validity __________________________________________________________________________

def test_repaneling_validity():
    try:
        import shapely
    except ModuleNotFoundError:
        pytest.skip("Shapely not installed; skipping this test.")

    afs = get_airfoil_database()

    for af in afs:
        try:
            similarity = af.jaccard_similarity(
                af.repanel()
            )
        except shapely.errors.GEOSException:
            similarity = np.nan
       assert similarity > 1 - 3 / af.n_points(), f"Airfoil {af.name} failed repaneling validity check with similarity {similarity}!"

E AssertionError: Airfoil hm50 failed repaneling validity check with similarity nan!
E assert nan > (1 - (3 / 484))
E + where 484 = <bound method Polygon.n_points of Airfoil hm50 (484 points)>()
E + where <bound method Polygon.n_points of Airfoil hm50 (484 points)> = Airfoil hm50 (484 points).n_points

.conda\Lib\site-packages\aerosandbox\geometry\airfoil\test_airfoil\test_airfoil_repaneling.py:34: AssertionError

Steps to Reproduce

  • make a fresh folder and conda environment
  • pip install aerosandbox[full,test]
  • python
  • import aerosandbox as asb
  • asb.run_tests()

Expected Behavior

====================== 250 passed, 36 warnings in 17.89s =======================

System Information

  • Operating System: Windows 11
  • Python Version: 3.11.8
  • AeroSandbox Version: 4.2.3

Other Information

@peterdsharpe
Copy link
Owner

peterdsharpe commented Mar 28, 2024

Thank you for the report!

This is an issue I've been tracking lately, and it has to do with one of the recently-added airfoils to the built-in airfoil database, called "hm50". (This particular airfoil comes from the TRACfoil database.) Basically this airfoil has a near-zero trailing edge angle, which causes shapely to raise a geometric error upon repaneling (since it looks like a self-intersecting shape). This is a bit of an edge case, since most practical airfoils have a nonzero trailing edge angle.

Here's the airfoil, for a closer look at the zero-angle trailing edge:
image

If this is the only error you're seeing, feel free to safely ignore this (as it will not have an effect outside of this edge case). In the meantime, we're working on a solution to handle these airfoils more gracefully in testing.

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

No branches or pull requests

2 participants