Skip to content

Fix warnings#214

Merged
ufechner7 merged 50 commits intomainfrom
jetls
Apr 11, 2026
Merged

Fix warnings#214
ufechner7 merged 50 commits intomainfrom
jetls

Conversation

@ufechner7
Copy link
Copy Markdown
Member

@ufechner7 ufechner7 commented Apr 6, 2026

  • Fix all JETLS warnings.
  • Fix: In the omega != 0 path, va_distribution is filled using indices 1:wing.n_panels for each wing, which overwrites the same leading rows and leaves the remaining panels (and any additional wings) unset. This will produce incorrect per-panel inflow for multi-wing bodies and even for the second wing in the vector.
  • Fix: set_va! with omega on multi-wing body
  • Remove unused argument reference_point from solve_base!
  • Modify test/test_setup.sh to instantiate the environment
  • Use a workspace with the sub-projects examples, docs and test

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 85.33333% with 33 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/panel.jl 80.85% 9 Missing ⚠️
src/wing_geometry.jl 58.82% 7 Missing ⚠️
src/VortexStepMethod.jl 0.00% 5 Missing ⚠️
ext/VortexStepMethodMakieExt.jl 20.00% 4 Missing ⚠️
src/body_aerodynamics.jl 90.24% 4 Missing ⚠️
src/polars.jl 89.65% 3 Missing ⚠️
src/solver.jl 98.46% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to eliminate JETLS warnings across the codebase by tightening types, refactoring a few hot-path functions, and adjusting test setup to be more explicit/robust.

Changes:

  • Refactors core geometry/solver code to reduce lints (type annotations, no-op removals, updated iteration patterns).
  • Tightens aero-data validation and interpolation handling for POLAR_* models.
  • Updates tests and test environment configuration (test Project sources, includes, test selection).

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/test_data_utils.jl Makes test_data_path more robust by stringifying path components.
test/solver/test_solver.jl Includes shared test utilities directly for solver tests.
test/runtests.jl Refactors test selection logic and simplifies special-arg handling.
test/Project.toml Adds VortexStepMethod as a test dep and pins to local path via [sources].
test/plotting/test_plotting.jl Adjusts global initialization patterns to avoid definition warnings.
test/body_aerodynamics/test_body_aerodynamics.jl Ensures test utilities are available when running file standalone.
test/bench.jl Updates benchmark callsites to match new calculate_results signature.
src/yaml_geometry.jl Switches CSV parsing loop to eachindex with header-skip.
src/wing_geometry.jl Refactors section reinit, makes Wing parametric, and tightens NaN cleanup helpers.
src/VortexStepMethod.jl Cleans imports/exports, adds PACKAGE_ROOT, and adjusts example-path logic.
src/solver.jl Refactors NONLIN cache init and removes unused args from results computation call chain.
src/settings.jl Adds a concrete type annotation for remove_nan.
src/polars.jl Removes unused assignments and improves file IO / header parsing robustness.
src/panel.jl Adds stricter aero_data validation and safer interpolation usage in coefficient evaluation.
src/obj_geometry.jl Minor cleanup: argument naming, string construction, and matrix/vector conversions.
src/body_aerodynamics.jl Makes BodyAerodynamics parametric over wing type; refactors set_va! and stall-angle helpers.
bin/jetls Adds a helper script to run jetls checks.
.JETLSConfig.toml Adds diagnostic suppression patterns to reduce noise.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/body_aerodynamics.jl
Comment thread src/body_aerodynamics.jl
Comment thread src/solver.jl Outdated
Comment thread src/solver.jl Outdated
Comment thread src/VortexStepMethod.jl Outdated
Comment thread src/body_aerodynamics.jl
ufechner7 and others added 2 commits April 11, 2026 13:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread src/body_aerodynamics.jl
@OpenSourceAWE OpenSourceAWE deleted a comment from Copilot AI Apr 11, 2026
@OpenSourceAWE OpenSourceAWE deleted a comment from Copilot AI Apr 11, 2026
@ufechner7 ufechner7 requested a review from Copilot April 11, 2026 12:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

src/body_aerodynamics.jl:1094

  • set_va!(body_aero, va_distribution::AbstractMatrix) updates per-panel velocities but does not update body_aero.omega, so a previously nonzero omega can remain stale. Also _va is currently set to the simple mean of the distribution, which is inconsistent with _compute_reference_velocity_from_distribution (RMS/mean-direction) used elsewhere (e.g., omega!=0 path and wake). Consider resetting omega to zeros here and computing _va via _compute_reference_velocity_from_distribution(va_distribution, n_panels, panel_areas) for consistency.
function set_va!(body_aero::BodyAerodynamics, va_distribution::AbstractMatrix)
    size(va_distribution, 1) != length(body_aero.panels) &&
        throw(ArgumentError("Number of rows in va distribution should be equal to number of panels."))

    for (i, panel) in enumerate(body_aero.panels)
        panel.va .= va_distribution[i, :]
    end

    # Update wake elements
    frozen_wake!(body_aero, va_distribution)
    body_aero._va .= [mean(va_distribution[:,i]) for i in 1:3]
    body_aero.has_distributed_va = true
    return nothing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/solver.jl Outdated
Comment thread src/VortexStepMethod.jl
Comment thread .JETLSConfig.toml
@ufechner7 ufechner7 requested a review from 1-Bart-1 April 11, 2026 12:48
Comment thread examples/rectangular_wing.jl
Comment thread src/obj_geometry.jl
Comment thread src/solver.jl
@ufechner7 ufechner7 requested a review from 1-Bart-1 April 11, 2026 16:45
Copy link
Copy Markdown
Member

@1-Bart-1 1-Bart-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the duplicate code

@ufechner7 ufechner7 merged commit ec56d76 into main Apr 11, 2026
9 checks 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.

3 participants