You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One program: python run.py in the repository root. The first question is the solver (1 = in-house panel method, 2 = XFOIL). The XFOIL check runs only if XFOIL is chosen.
The two optimizers move into naca_core/ (inhouse_optimizer.py, xfoil_optimizer.py). inhouse_potential_optimizer/ and xfoil_viscous_optimizer/ are removed; their READMEs are merged into the main one.
One Results/ folder in the root. Each run: Re<Re>_Alpha<alpha>_<objective>_<solver>_seed<N>/, e.g. Re3424658_Alpha4.0_Cl0.8_xfoil_seed42/. Validation: Results/validation/Re<Re>_Mach<M>/.
XFOIL executable in naca_core/bin/ (ignored by git). On Windows it is downloaded there automatically.
README updated (structure, usage, output).
Commits
Moves only (100% renames, history preserved), including the in-house run.py to the root.
Content: the single run.py, paths, deletions, README.
Verified: nothing lost
Reference outputs were recorded on Windows with the old code before the refactor (fixed seed 42), then the same inputs were run on the new code:
Case
Terminal
Output files
In-house
identical (176 lines)
identical (11 files)
XFOIL, objective 1
identical, see note
identical (11 files)
XFOIL, objective 2
identical, see note
identical (11 files)
Validation
identical (80 lines)
identical (3 files)
Accepted differences only: the solver question, the result-folder paths, the XFOIL path. SVG files are skipped (matplotlib writes the date inside), DXF files are compared by geometry.
Note on the two XFOIL cases: the only other lines that differ are not from our code. (1) In the reference run the old code downloaded xfoil.exe again, because the pull after #3 had removed the tracked one, as expected. (2) PowerShell wraps an ezdxf INFO message on stderr in a block that echoes the command line, and the command line changed from xfoil_viscous_optimizer\run.py to run.py.
Also checked: baseline 24/24 (also on a fresh clone of this branch); same results in a Linux sandbox; edge cases (bounding box 0.05 m, invalid solver choice, invalid input, XFOIL always failing, missing library) behave as before; XFOIL found in naca_core/bin/ and ignored by git.
After merging (on your PC)
Move xfoil.exe into naca_core/bin/, or just run with XFOIL once: on Windows it is downloaded there again. The old Results folders under the removed directories can be deleted.
Found on the way (not changed here)
naca_core/xfoil.py calls logging.basicConfig(level=INFO), so in XFOIL runs ezdxf INFO messages show up on stderr. Harmless; to fix in a separate PR.
The attached zip contains everything needed to check the refactor independently:
Content
What it is
before/
inputs, terminal outputs and result files of the old code (two run.py), recorded on Windows before the refactor
after/Results/
result files of the new single run.py, same inputs
compare_refactor.py
the comparison script
comparison_result.txt
its output
Four cases, all with seed 42: in-house, XFOIL objective 1, XFOIL objective 2, validation.
=== in-house
terminal: identical (176 lines)
files: identical (11 files; .svg skipped, .dxf compared by geometry)
=== XFOIL obj. 1
ignored in old output (not from our code): 1 XFOIL download, 1 PowerShell stderr block
ignored in new output (not from our code): 1 PowerShell stderr block
terminal: identical (190 lines)
files: identical (11 files; .svg skipped, .dxf compared by geometry)
=== XFOIL obj. 2
ignored in old output (not from our code): 1 PowerShell stderr block
ignored in new output (not from our code): 1 PowerShell stderr block
terminal: identical (238 lines)
files: identical (11 files; .svg skipped, .dxf compared by geometry)
=== validation
terminal: identical (80 lines)
files: identical (3 files; .svg skipped, .dxf compared by geometry)
RESULT: ALL IDENTICAL
What the script accepts as different: the new solver question, the result-folder paths, the XFOIL path. What it removes and reports, because it does not come from our code: the one-off download of xfoil.exe in the old run, and the block PowerShell wraps around a stderr line (it echoes the command line, which changed). SVG files are skipped because matplotlib writes the date inside them; DXF files are compared by geometry. Everything else is compared byte by byte.
To rerun the check: unzip, then from inside the folder run python compare_refactor.py before after
(needs ezdxf, already in requirements.txt). You can also open any pair of files from before/ and after/ side by side.
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
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.
What
python run.pyin the repository root. The first question is the solver (1 = in-house panel method, 2 = XFOIL). The XFOIL check runs only if XFOIL is chosen.naca_core/(inhouse_optimizer.py,xfoil_optimizer.py).inhouse_potential_optimizer/andxfoil_viscous_optimizer/are removed; their READMEs are merged into the main one.Results/folder in the root. Each run:Re<Re>_Alpha<alpha>_<objective>_<solver>_seed<N>/, e.g.Re3424658_Alpha4.0_Cl0.8_xfoil_seed42/. Validation:Results/validation/Re<Re>_Mach<M>/.naca_core/bin/(ignored by git). On Windows it is downloaded there automatically.Commits
run.pyto the root.run.py, paths, deletions, README.Verified: nothing lost
Reference outputs were recorded on Windows with the old code before the refactor (fixed seed 42), then the same inputs were run on the new code:
Accepted differences only: the solver question, the result-folder paths, the XFOIL path. SVG files are skipped (matplotlib writes the date inside), DXF files are compared by geometry.
Note on the two XFOIL cases: the only other lines that differ are not from our code. (1) In the reference run the old code downloaded
xfoil.exeagain, because the pull after #3 had removed the tracked one, as expected. (2) PowerShell wraps anezdxfINFO message on stderr in a block that echoes the command line, and the command line changed fromxfoil_viscous_optimizer\run.pytorun.py.Also checked: baseline 24/24 (also on a fresh clone of this branch); same results in a Linux sandbox; edge cases (bounding box 0.05 m, invalid solver choice, invalid input, XFOIL always failing, missing library) behave as before; XFOIL found in
naca_core/bin/and ignored by git.After merging (on your PC)
Move
xfoil.exeintonaca_core/bin/, or just run with XFOIL once: on Windows it is downloaded there again. The oldResultsfolders under the removed directories can be deleted.Found on the way (not changed here)
naca_core/xfoil.pycallslogging.basicConfig(level=INFO), so in XFOIL runsezdxfINFO messages show up on stderr. Harmless; to fix in a separate PR.Depends on
#20 (base branch:
chore/merge-into-main).