Closed
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66 +/- ##
===========================================
- Coverage 91.50% 81.43% -10.07%
===========================================
Files 32 34 +2
Lines 6450 7618 +1168
===========================================
+ Hits 5902 6204 +302
- Misses 548 1414 +866 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f699d13 to
f01d451
Compare
3 tasks
The function now lives in _logging.py as part of the centralized logging infrastructure. Also removed the now-unused logging import.
Added tests to verify the handler actually emits log messages and flushes the stream properly. This covers the core functionality that was previously untested. Coverage improved from 86.44% to 97% for _logging.py.
Removes all internal logging configuration from solver run() methods and eliminates the logging_level parameter, requiring users to configure logging explicitly via setup_logging. Exposes setup_logging as a public API, updates documentation and examples, cleans up _logging.py, and updates tests to match the new logging approach. Progress bars are now always shown in the unsteady solver by default.
Renamed setup_logging to set_up_logging throughout the codebase for consistency. Added show_progress and show_solver_progress parameters to unsteady solver, trim, and convergence functions to control TQDM progress bar display. Updated example scripts and tests to use the new logging setup and progress options. Changed many info-level log messages to debug-level for less console clutter during normal runs.
Refactors set_up_logging to validate input types for level, handler, and format_string, raising TypeError for invalid types. Updates _convert_logging_level_name_to_value to handle logging level names case-insensitively. Removes the use_tqdm_handler parameter, always using _TqdmLoggingHandler by default. Updates and expands unit tests to cover new validation logic and case-insensitive level name handling.
Updated comments for clarity and consistency in test_logging.py.
Introduces the CoupledOperatingPoint class to represent operating conditions for individual Airplanes in free flight aerodynamic simulations. Updates module docstrings to reflect the addition and provides methods for dynamic pressure, transformation matrices, and freestream velocity calculations.
Introduces the CoupledMovement class to encapsulate multiple AirplaneMovements and their associated CoupledOperatingPoints for coupled unsteady simulations. Updates documentation in movement.py, __init__.py, and operating_point.py to reflect the new structure and clarify initialization and usage of CoupledMovement in CoupledUnsteadyProblems.
Introduces CoupledSteadyProblem and CoupledUnsteadyProblem classes to support coupled unsteady aerodynamic simulations. Updates docstrings and type annotations for clarity and consistency.
…interface with MuJoCo for free flight simulations MuJoCoModel class includes methods for applying loads, stepping the simulation, extracting state, and resetting. Updates documentation and configuration files to include mujoco as a core dependency and configures mypy for the new module.
Refactored CoupledMovement, CoupledOperatingPoint, and CoupledSteadyProblem to operate on a single Airplane and CoupledOperatingPoint per problem instead of lists. Updated initialization, validation, and documentation to reflect this change, simplifying the interface and internal logic for coupled aerodynamic problems.
Introduces CoupledUnsteadyRingVortexLatticeMethodSolver for solving CoupledUnsteadyProblems with the unsteady ring vortex lattice method. Updates _functions.py and related logic to support the new solver, including load processing and panel attribute updates.
Introduces the animate_free_flight function to animate a CoupledUnsteadyRingVortexLatticeMethodSolver's Airplane, including support for wake vortex visualization and scalar coloring. Updates draw and related internal functions to handle the coupled solver, adds new helper functions for panel and wake surface generation in free flight, and refines type checks and error handling for streamline and wake visualization.
…ttice_method.py Swapped np.cross for _functions.numba_1d_explicit_cross in backLegForces_GP1 calculation to improve performance and maintain consistency with other optimized operations.
…ging scripts with new variable names and converged/trimmed parameters Also updates debugging log with latest progress
12 tasks
Add max_wake_rows, max_wake_chords, and max_wake_cycles parameters to Movement, with validation and conversion logic mirroring num_steps/num_chords/num_cycles. Propagate max_wake_rows through UnsteadyProblem to the solver, which caps pre-allocated wake arrays and truncates wake points and vortices each time step once the threshold is reached.
Prepare the documentation for defining the global position of a plane.
Resolves conflicts in operating_point.py, output.py, CLASSES_AND_IMMUTABILITY.md, and .idea/scopes/to_inspect.xml. Simplifies CoupledOperatingPoint by passing angles_E_to_BP1_izyx through to OperatingPoint's __init__ (which now validates and stores it) and removing the 4 redundant Earth transformation property overrides that are now inherited from the parent class with lazy caching.
7c8d10a to
d256240
Compare
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
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.
Description
This PR adds the ability to perform simulations that couple an airplane's motion to the aerodynamic forces due to its motion.
Motivation
Adding coupled simulations increases the use-cases of Ptera Software beyond pure aerodynamic investigations and makes it more attractive for general robotics simulations.
Relevant Issues
Closes #65 and improves upon solution to #50.
Changes
CoupledOperatingPointclass topterasoftware/operating_point.pyCoupledMovementclass topterasoftware/movements/movement.pyCoupledUnsteadyProblemclass topterasoftware/problems.pyCoupledSteadyProblemclass topterasoftware/problems.pypterasoftware/mujoco_model.py, which contains theMuJoCoModelclass.pterasoftware/coupled_unsteady_ring_vortex_lattice_method.py, which contains theCoupledUnsteadyRingVortexLatticeMethodSolverclass.pterasoftware/__init__.pyto import the new modules.UnsteadyRingVortexLatticeMethodSolver's_calculate_loadsmethod where it was using different functions for calculating the cross product for eachLineVortexleg.pterasoftware.output.animate.RingVortexpterasoftware.output.animateandpterasoftware.output.draw.output.print_resultsto display values in scientific notation for better readability across scales.rotationPointOffset_Gs_Lerparameter toWingMovement, allowing specification of a custom rotation point for wing angular motion.delta_time's"optimize"mode by tuning the local optimizer and introducing a fall back to dual annealing as a global optimizer.delta_time's"optimize"mode where static cases weren't improved.docs/. This uses the progressive disclosure strategy known to produce better results.MUJOCO_CONVENTIONS.mdfile with verified interpretations of MuJoCo's relevant inputs and outputs.animate_free_flightfunction inoutput.py, along with a few helper functions.Temporary Debug Scripts to Remove Before Merging
debugging_scriptsand all files withindocs/FREE_FLIGHT_DEVELOPMENT.mdgammabot_simulationsand all files withinNew Dependencies
Change Magnitude
Moderate: Medium-sized change that adds or modifies a feature without large-scale impact.
Checklist
mainand is up to date with the upstreammainbranch.--in-place --black). See the style guide for type hints and docstrings for more details.pterasoftwarepackage use type hints. See the style guide for type hints and docstrings for more details.testspackage.testspackage.codespell,black,mypy, andtests).