Skip to content

Conversation

@Sierd
Copy link
Collaborator

@Sierd Sierd commented Nov 14, 2025

crash reported when newest python version is used. Numba not compatible yet.

crash reported when newest python version is used. Numba not compatible yet.
Copy link
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 restricts the Python version requirement to exclude Python 3.14 and later due to Numba compatibility issues that cause crashes when using the newest Python version.

  • Changes the requires-python field from >=3.9, <4 to >=3.9, <3.14
Comments suppressed due to low confidence (1)

pyproject.toml:51

  • The classifiers list should include 'Programming Language :: Python :: 3.11' since the CI workflow tests against Python 3.11 (line 23 of .github/workflows/run-tests.yml). This ensures accurate metadata about supported Python versions.
  "Programming Language :: Python :: 3.9",
  "Programming Language :: Python :: 3.10",

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

@Sierd Sierd merged commit 40c68b9 into main Nov 14, 2025
6 of 9 checks passed
@Sierd Sierd deleted the Sierd-patch-1 branch November 14, 2025 20:45
Sierd added a commit that referenced this pull request Jan 13, 2026
* 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>
Sierd added a commit that referenced this pull request Jan 13, 2026
* 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>
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.

2 participants