-
Notifications
You must be signed in to change notification settings - Fork 29
read and write inputfiles in gui updated. #282
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
base: main
Are you sure you want to change the base?
Conversation
…ed, export functionality, and utilities (#263) * Initial plan * Phase 1: Add constants, utility functions, and improve documentation Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 2: Extract helper methods and reduce code duplication Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 3: Add variable label/title constants and improve docstrings Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Final: Add comprehensive refactoring documentation and summary Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add export functionality: PNG and MP4 animations for all visualizations Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 4: Begin code organization - extract utils module and create gui package structure Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add comprehensive additional improvements proposal document Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes related to import and animattion functionality * updated structure for further refactoring * Refactor: Extract DomainVisualizer and rename gui_app_backup.py to application.py Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfix * bugfix on loading domain * Refactor: Extract WindVisualizer to modular architecture Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output2DVisualizer for 2D NetCDF visualization Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output1DVisualizer - Complete modular architecture achieved! Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes loading files * removed netcdf check * bugfixes after refractoring * bugfixes with domain overview * Speeding up complex drawing * hold on functionality added * Tab to run code added. * Update aeolis/gui/application.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/application.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/domain.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/domain.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/main.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/output_2d.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Rename visualizers folder to gui_tabs and update all imports Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bigfixes related to refactoring * reducing code lenght by omitting some redundancies * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Sierd <sierd.devries@tudelft.nl> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan * Phase 1: Add constants, utility functions, and improve documentation Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 2: Extract helper methods and reduce code duplication Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 3: Add variable label/title constants and improve docstrings Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Final: Add comprehensive refactoring documentation and summary Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add export functionality: PNG and MP4 animations for all visualizations Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 4: Begin code organization - extract utils module and create gui package structure Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add comprehensive additional improvements proposal document Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes related to import and animattion functionality * updated structure for further refactoring * Refactor: Extract DomainVisualizer and rename gui_app_backup.py to application.py Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfix * bugfix on loading domain * Refactor: Extract WindVisualizer to modular architecture Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output2DVisualizer for 2D NetCDF visualization Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output1DVisualizer - Complete modular architecture achieved! Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes loading files * removed netcdf check * bugfixes after refractoring * Carcans files added for Olivier * bugfixes with domain overview * Gui v0.2 added (#264) * add wind plotting functionality * Refactor GUI: Complete modular architecture with all GUI tabs extracted, export functionality, and utilities (#263) * Initial plan * Phase 1: Add constants, utility functions, and improve documentation Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 2: Extract helper methods and reduce code duplication Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 3: Add variable label/title constants and improve docstrings Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Final: Add comprehensive refactoring documentation and summary Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add export functionality: PNG and MP4 animations for all visualizations Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 4: Begin code organization - extract utils module and create gui package structure Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add comprehensive additional improvements proposal document Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes related to import and animattion functionality * updated structure for further refactoring * Refactor: Extract DomainVisualizer and rename gui_app_backup.py to application.py Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfix * bugfix on loading domain * Refactor: Extract WindVisualizer to modular architecture Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output2DVisualizer for 2D NetCDF visualization Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output1DVisualizer - Complete modular architecture achieved! Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes loading files * removed netcdf check * bugfixes after refractoring * bugfixes with domain overview * Speeding up complex drawing * hold on functionality added * Tab to run code added. * Update aeolis/gui/application.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/application.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/domain.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/domain.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/main.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/output_2d.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Rename visualizers folder to gui_tabs and update all imports Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bigfixes related to refactoring * reducing code lenght by omitting some redundancies * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Sierd <sierd.devries@tudelft.nl> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * testcommit * reverse commit * removed Carcans from Main * Refactor GUI: Complete modular architecture with all GUI tabs extract… (#268) * Refactor GUI: Complete modular architecture with all GUI tabs extracted, export functionality, and utilities (#263) * Initial plan * Phase 1: Add constants, utility functions, and improve documentation Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 2: Extract helper methods and reduce code duplication Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 3: Add variable label/title constants and improve docstrings Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Final: Add comprehensive refactoring documentation and summary Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add export functionality: PNG and MP4 animations for all visualizations Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 4: Begin code organization - extract utils module and create gui package structure Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add comprehensive additional improvements proposal document Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes related to import and animattion functionality * updated structure for further refactoring * Refactor: Extract DomainVisualizer and rename gui_app_backup.py to application.py Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfix * bugfix on loading domain * Refactor: Extract WindVisualizer to modular architecture Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output2DVisualizer for 2D NetCDF visualization Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output1DVisualizer - Complete modular architecture achieved! Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes loading files * removed netcdf check * bugfixes after refractoring * bugfixes with domain overview * Speeding up complex drawing * hold on functionality added * Tab to run code added. * Update aeolis/gui/application.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/application.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/domain.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/domain.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/main.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/output_2d.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Rename visualizers folder to gui_tabs and update all imports Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bigfixes related to refactoring * reducing code lenght by omitting some redundancies * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Sierd <sierd.devries@tudelft.nl> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Delete ADDITIONAL_IMPROVEMENTS.md * deleted md files --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Python version requirement to <3.14 (#270) crash reported when newest python version is used. Numba not compatible yet. * Fix ustarn calculation: initialization and FFT shear formula bugs (#265) * Initial plan * Fix ustars0 and ustarn0 initialization bug in wind.py Fixed bug where ustars0 and ustarn0 were incorrectly set to ustar magnitude instead of their respective directional components ustars and ustarn. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * input files for debugging * Fix missing division in dtauy FFT shear calculation The dtauy_t formula in the FFT shear method was missing the division by sc_kv(0., 2.*sqrt(2.)*sigma), causing incorrect y-direction shear stress perturbations. This resulted in non-zero ustarn values even when the bed had no y-direction variability. The formula now matches the structure of dtaux_t calculation. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Fix frequency array alignment in FFT shear calculation The kx and ky frequency arrays were misaligned with the FFT output. The code was creating frequency arrays with fftfreq(n+1)[1:] which skips the DC component, but the FFT includes all frequencies. This caused incorrect mapping between frequencies and FFT coefficients, leading to wrong shear perturbations. Fixed by using fftfreq(n) which properly matches the FFT output dimensions and includes the DC component at the correct index. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Handle division by zero at DC component in FFT shear The previous fix included the DC component (kx=0, ky=0) in the frequency arrays, which caused division by zero errors in the shear calculations. Fixed by: - Using safe division with np.where to replace zeros with 1.0 temporarily - Explicitly setting DC component of perturbations to 0 after calculation - Applying same fix to filter_highfrequencies function The DC component represents the mean value and doesn't contribute to perturbations, so setting it to zero is physically correct. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Use masked computation to avoid invalid values in FFT shear The previous fix still allowed invalid values when kx=0 (but ky≠0) because sigma depends on kx. When kx=0, sigma=0 which causes issues in Bessel function ratios. New approach: - Create a mask for valid computations: (k > 0) & (abs(kx) > 0) - Initialize perturbation arrays with zeros - Only compute perturbations for valid frequency combinations - All invalid combinations (kx=0 or k=0) automatically get zero perturbation This is physically correct: perturbations at kx=0 (pure y-direction frequencies) should be zero for the x-direction flow formulation. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Simplify FFT shear edge case handling Simplified the masked computation approach to a cleaner implementation: - Use np.where for safe division (replace zeros with 1.0 temporarily) - Compute formulas normally with safe arrays - Apply invalid_mask at the end to zero out problematic regions This achieves the same result with much simpler, more readable code. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Update shear.py reverted the suggested division in dtauy_t calculation * deleted wind tests * shear patch --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Sierd <sierd.devries@tudelft.nl> * new work on padding (#278) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: OlivierBurvingt <o.burvingt@brgm.fr>
* Initial plan * Phase 1: Add constants, utility functions, and improve documentation Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 2: Extract helper methods and reduce code duplication Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 3: Add variable label/title constants and improve docstrings Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Final: Add comprehensive refactoring documentation and summary Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add export functionality: PNG and MP4 animations for all visualizations Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 4: Begin code organization - extract utils module and create gui package structure Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add comprehensive additional improvements proposal document Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes related to import and animattion functionality * updated structure for further refactoring * Refactor: Extract DomainVisualizer and rename gui_app_backup.py to application.py Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfix * bugfix on loading domain * Refactor: Extract WindVisualizer to modular architecture Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output2DVisualizer for 2D NetCDF visualization Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output1DVisualizer - Complete modular architecture achieved! Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes loading files * removed netcdf check * bugfixes after refractoring * Carcans files added for Olivier * bugfixes with domain overview * Gui v0.2 added (#264) * add wind plotting functionality * Refactor GUI: Complete modular architecture with all GUI tabs extracted, export functionality, and utilities (#263) * Initial plan * Phase 1: Add constants, utility functions, and improve documentation Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 2: Extract helper methods and reduce code duplication Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 3: Add variable label/title constants and improve docstrings Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Final: Add comprehensive refactoring documentation and summary Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add export functionality: PNG and MP4 animations for all visualizations Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 4: Begin code organization - extract utils module and create gui package structure Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add comprehensive additional improvements proposal document Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes related to import and animattion functionality * updated structure for further refactoring * Refactor: Extract DomainVisualizer and rename gui_app_backup.py to application.py Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfix * bugfix on loading domain * Refactor: Extract WindVisualizer to modular architecture Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output2DVisualizer for 2D NetCDF visualization Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output1DVisualizer - Complete modular architecture achieved! Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes loading files * removed netcdf check * bugfixes after refractoring * bugfixes with domain overview * Speeding up complex drawing * hold on functionality added * Tab to run code added. * Update aeolis/gui/application.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/application.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/domain.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/domain.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/main.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/output_2d.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Rename visualizers folder to gui_tabs and update all imports Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bigfixes related to refactoring * reducing code lenght by omitting some redundancies * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Sierd <sierd.devries@tudelft.nl> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * testcommit * reverse commit * removed Carcans from Main * Refactor GUI: Complete modular architecture with all GUI tabs extract… (#268) * Refactor GUI: Complete modular architecture with all GUI tabs extracted, export functionality, and utilities (#263) * Initial plan * Phase 1: Add constants, utility functions, and improve documentation Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 2: Extract helper methods and reduce code duplication Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 3: Add variable label/title constants and improve docstrings Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Final: Add comprehensive refactoring documentation and summary Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add export functionality: PNG and MP4 animations for all visualizations Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Phase 4: Begin code organization - extract utils module and create gui package structure Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Add comprehensive additional improvements proposal document Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes related to import and animattion functionality * updated structure for further refactoring * Refactor: Extract DomainVisualizer and rename gui_app_backup.py to application.py Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfix * bugfix on loading domain * Refactor: Extract WindVisualizer to modular architecture Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output2DVisualizer for 2D NetCDF visualization Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Refactor: Extract Output1DVisualizer - Complete modular architecture achieved! Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bugfixes loading files * removed netcdf check * bugfixes after refractoring * bugfixes with domain overview * Speeding up complex drawing * hold on functionality added * Tab to run code added. * Update aeolis/gui/application.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/application.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/domain.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/domain.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/main.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aeolis/gui/visualizers/output_2d.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Rename visualizers folder to gui_tabs and update all imports Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * bigfixes related to refactoring * reducing code lenght by omitting some redundancies * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Sierd <sierd.devries@tudelft.nl> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Delete ADDITIONAL_IMPROVEMENTS.md * deleted md files --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Python version requirement to <3.14 (#270) crash reported when newest python version is used. Numba not compatible yet. * Fix ustarn calculation: initialization and FFT shear formula bugs (#265) * Initial plan * Fix ustars0 and ustarn0 initialization bug in wind.py Fixed bug where ustars0 and ustarn0 were incorrectly set to ustar magnitude instead of their respective directional components ustars and ustarn. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * input files for debugging * Fix missing division in dtauy FFT shear calculation The dtauy_t formula in the FFT shear method was missing the division by sc_kv(0., 2.*sqrt(2.)*sigma), causing incorrect y-direction shear stress perturbations. This resulted in non-zero ustarn values even when the bed had no y-direction variability. The formula now matches the structure of dtaux_t calculation. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Fix frequency array alignment in FFT shear calculation The kx and ky frequency arrays were misaligned with the FFT output. The code was creating frequency arrays with fftfreq(n+1)[1:] which skips the DC component, but the FFT includes all frequencies. This caused incorrect mapping between frequencies and FFT coefficients, leading to wrong shear perturbations. Fixed by using fftfreq(n) which properly matches the FFT output dimensions and includes the DC component at the correct index. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Handle division by zero at DC component in FFT shear The previous fix included the DC component (kx=0, ky=0) in the frequency arrays, which caused division by zero errors in the shear calculations. Fixed by: - Using safe division with np.where to replace zeros with 1.0 temporarily - Explicitly setting DC component of perturbations to 0 after calculation - Applying same fix to filter_highfrequencies function The DC component represents the mean value and doesn't contribute to perturbations, so setting it to zero is physically correct. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Use masked computation to avoid invalid values in FFT shear The previous fix still allowed invalid values when kx=0 (but ky≠0) because sigma depends on kx. When kx=0, sigma=0 which causes issues in Bessel function ratios. New approach: - Create a mask for valid computations: (k > 0) & (abs(kx) > 0) - Initialize perturbation arrays with zeros - Only compute perturbations for valid frequency combinations - All invalid combinations (kx=0 or k=0) automatically get zero perturbation This is physically correct: perturbations at kx=0 (pure y-direction frequencies) should be zero for the x-direction flow formulation. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Simplify FFT shear edge case handling Simplified the masked computation approach to a cleaner implementation: - Use np.where for safe division (replace zeros with 1.0 temporarily) - Compute formulas normally with safe arrays - Apply invalid_mask at the end to zero out problematic regions This achieves the same result with much simpler, more readable code. Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> * Update shear.py reverted the suggested division in dtauy_t calculation * deleted wind tests * shear patch --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Sierd <sierd.devries@tudelft.nl> * new work on padding (#278) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sierd <14054272+Sierd@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: OlivierBurvingt <o.burvingt@brgm.fr>
There was a problem hiding this 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 updates the functionality for reading and writing input files in the GUI, with a major refactoring of the configuration file writing logic to preserve structure and organization from the DEFAULT_CONFIG. The changes also reorganize the DEFAULT_CONFIG dictionary in constants.py with better sectioning and add support for handling empty strings and datetime patterns.
Changes:
- Refactored
write_configfileto parse constants.py and preserve section structure with comments - Reorganized DEFAULT_CONFIG into logical sections with descriptive headers
- Added empty string handling in utils and GUI for better input validation
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| aeolis/utils.py | Added empty string check to print_value function to treat empty strings like None |
| aeolis/inout.py | Complete rewrite of write_configfile to preserve section structure; added datetime pattern detection in parse_value |
| aeolis/hydro.py | Added empty check for external_vars before checking membership to prevent errors |
| aeolis/gui/application.py | Convert empty/whitespace-only strings to None when saving config |
| aeolis/constants.py | Major reorganization of DEFAULT_CONFIG with new section headers and logical grouping |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| value = p[key] | ||
|
|
||
| # Skip this key if its value matches the default | ||
| if key in DEFAULT_CONFIG and np.all(value == DEFAULT_CONFIG[key]) : |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary trailing space before the colon in the if statement. Remove the space between 'key])' and ':' for consistency with Python style guidelines.
| if key in DEFAULT_CONFIG and np.all(value == DEFAULT_CONFIG[key]) : | |
| if key in DEFAULT_CONFIG and np.all(value == DEFAULT_CONFIG[key]): |
| 'output_vars' : ['zb', 'zs', | ||
| 'Ct', 'Cu', | ||
| 'uw', 'udir', | ||
| 'uth', 'mass' |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comma after 'mass' on line 206. This list should have commas separating all elements. The missing comma will cause a syntax error when Python tries to parse this configuration dictionary.
| 'uth', 'mass' | |
| 'uth', 'mass', |
| 'alpha_lift' : 0.2, # [-] Vegetation-induced upward lift (0-1) of transport-layer centroid | ||
|
|
||
| # --- Grass vegetation model (new vegetation framework) --- # | ||
| 'method_vegetation' : 'duran', # ['duran' | 'grass'] Vegetation formulation |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate key 'method_vegetation' defined. This parameter is first defined on line 352 under the 'Vegetation (OLD)' section and then redefined on line 387 under the 'Grass vegetation model (new vegetation framework)' section. In Python dictionaries, duplicate keys cause the second value to overwrite the first, making line 352 ineffective. Consider removing the duplicate or using different key names if both are needed.
| 'method_vegetation' : 'duran', # ['duran' | 'grass'] Vegetation formulation | |
| 'method_vegetation_new' : 'duran', # ['duran' | 'grass'] Vegetation formulation |
| # Check if SWL or zs are not provided by some external model | ||
| # In that case, skip initialization | ||
| if ('zs' not in p['external_vars']) : | ||
| if not p['external_vars'] or('zs' not in p['external_vars']) : |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space between 'or' and the opening parenthesis. The condition should be written as 'or (' instead of 'or('. While Python will still parse this correctly, it violates PEP 8 style guidelines for spacing around operators.
| if not p['external_vars'] or('zs' not in p['external_vars']) : | |
| if not p['external_vars'] or ('zs' not in p['external_vars']) : |
| # In that case, skip initialization | ||
| if ('zs' not in p['external_vars']) : | ||
| if not p['external_vars'] or('zs' not in p['external_vars']) : | ||
|
|
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 71 contains only whitespace with inconsistent indentation. This appears to be an unnecessary blank line within the if statement block. Remove this line or ensure consistent indentation.
| 'Cl_gw' : 0.7, # [m] Groundwater overheight due to runup | ||
| 'in_gw' : 0, # [m] Initial groundwater level | ||
| 'GW_stat' : 1, # [m] Landward static groundwater boundary (if static boundary is defined) | ||
| 'max_moist' : 10., # NEWCH # [%] Moisture content (volumetric in percent) above which the threshold shear velocity is set to infinity (no transport, default value Delgado-Fernandez, 2010) |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate key 'max_moist' defined. Line 337 has a comment marker 'NEWCH' suggesting it may be leftover from development. In Python dictionaries, duplicate keys will result in the second value overwriting the first, making line 337 have no effect. Remove the duplicate on line 337.
| 'max_moist' : 10., # NEWCH # [%] Moisture content (volumetric in percent) above which the threshold shear velocity is set to infinity (no transport, default value Delgado-Fernandez, 2010) |
| 'm_veg' : [0.4], # [-] Shear non-uniformity correction factor | ||
| 'c1_okin' : [0.48], # [-] Downwind decay coefficient in Okin shear reduction | ||
|
|
||
| 'veg_sigma' : 0., # [-] Sigma in gaussian distrubtion of vegetation cover filter |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate key 'veg_sigma' defined. This parameter is first defined on line 361 under the 'Vegetation (OLD)' section and then redefined on line 426 under the 'Grass vegetation model (new vegetation framework)' section. In Python dictionaries, duplicate keys cause the second value to overwrite the first. Consider removing the duplicate or using different key names if both are needed.
| 'veg_sigma' : 0., # [-] Sigma in gaussian distrubtion of vegetation cover filter | |
| 'veg_sigma_grass' : 0., # [-] Sigma in gaussian distribution of vegetation cover filter (grass model) |
| 'germinate' : 0., # [1/year] Possibility of germination per year | ||
| 'lateral' : 0., # [1/year] Posibility of lateral expension per year | ||
| 'veg_gamma' : 1., # [-] Constant on influence of sediment burial | ||
| 'veg_sigma' : 0., # [-] Sigma in gaussian distrubtion of vegetation cover filter |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: 'distrubtion' should be 'distribution'. This typo appears in the comment describing the veg_sigma parameter.
| 'veg_sigma' : 0., # [-] Sigma in gaussian distrubtion of vegetation cover filter | |
| 'veg_sigma' : 0., # [-] Sigma in gaussian distribution of vegetation cover filter |
| if key in DEFAULT_CONFIG and np.all(value == DEFAULT_CONFIG[key]) : | ||
| continue |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using np.all for comparison may fail when value is None or a non-array type (e.g., string, bool, int). The code attempts to compare all values in the configuration, including None types, which will cause np.all to raise an error. Consider adding a type check or using a safer comparison method that handles scalars, None, and arrays appropriately.
| if key in DEFAULT_CONFIG and np.all(value == DEFAULT_CONFIG[key]): | ||
| continue |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using np.all for comparison may fail when value is None or a non-array type (e.g., string, bool, int). The code attempts to compare all values in the configuration, including None types, which will cause np.all to raise an error. Consider adding a type check or using a safer comparison method that handles scalars, None, and arrays appropriately.
No description provided.