Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 4, 2025

Adds a new tab to visualize 1D transects (cross-sections) of model output along user-selectable positions. Renames existing "Plot Output" tab to "Plot Output 2D" for clarity. Both tabs now feature a unified interface with dynamic variable dropdowns and consistent behavior.

Changes

UI Components

  • 1D Tab: NetCDF file browser with dynamic variable dropdown, transect direction selector (cross-shore/along-shore), interactive sliders for position and time
  • 2D Tab: Updated to match 1D interface with variable dropdown, single "Load & Plot" button, and overlay vegetation checkbox
  • Dynamic Variables: Both tabs automatically populate dropdowns with available variables from NetCDF file, filtering out coordinates and metadata
  • Matplotlib visualization with automatic coordinate handling (2D/1D arrays, grid indices)

Implementation (aeolis/gui.py)

  • Renamed create_plot_output_tab()create_plot_output_2d_tab()
  • Added 1D tab with 8 methods for creation, file I/O, and plot updates
  • Added 2D tab methods: plot_nc_2d(), update_2d_plot(), on_variable_changed_2d()
  • Simplified update_time_step() to use unified plotting approach
  • Real-time plot refresh on variable/position/time changes in both tabs

Bug Fixes

  • Fixed transect direction scrolling error (IndexError when x and y dimensions differ)
  • Slider range now reconfigures automatically when changing direction
  • Variable dropdowns only show valid 2D/3D data variables (excludes x, y, s, n, time, bounds, etc.)

Code Quality

  • Fixed platform-specific path separators (os.pardir + os.sep instead of ..\\..\\)
  • Added dimension validation (requires 3D for time-varying, 2D for static variables)
  • Empty dictionary checks before access

Example Usage:

# Cross-shore transect: fix y-index=75, vary along x (s dimension)
transect_data = var_data[time_idx, 75, :]

# Along-shore transect: fix x-index=150, vary along y (n dimension)  
transect_data = var_data[time_idx, :, 150]

~545 lines added/modified in aeolis/gui.py. No breaking changes. Both tabs now provide consistent user experience with dynamic variable discovery.

Original prompt

add a "Plot Output 1D" tab that handles plotting zb and all the other parameters in the current "plot output" tab in a transect that can be selected by the user. Change the name of the current "Plot output" tab in "Plot Output 2D".


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 4, 2025
Copilot AI changed the title [WIP] Add Plot Output 1D tab and rename existing tab Add Plot Output 1D tab for transect visualization Nov 4, 2025
Copilot AI requested a review from Sierd November 4, 2025 12:03
@Sierd
Copy link
Collaborator

Sierd commented Nov 4, 2025

@copilot Only show the available variables in the dropdown menu of the 'Plot Output 1D' tab. Adapt the 'Plot Output 2D' tab to use the dropdown menu for selected variables in the same fashion as the 'Plot Output 1D' tab. Update the plotting area accoordingly by replacing all buttons with a 'load and plot'. The code gives an error when when scrolling through the transect direction. I think this is because x and y have different lenghts (the error points out line 830 in gui.py that gives an error)

Copy link
Contributor Author

Copilot AI commented Nov 4, 2025

@copilot Only show the available variables in the dropdown menu of the 'Plot Output 1D' tab. Adapt the 'Plot Output 2D' tab to use the dropdown menu for selected variables in the same fashion as the '...

Fixed all issues in commit 74edae0:

1. Fixed transect direction scrolling error (line 830)

  • Slider range now reconfigures when changing direction
  • Prevents IndexError when x and y dimensions differ
  • Automatically adjusts slider value if out of bounds

2. Dynamic variable dropdowns

  • Both tabs now show only available variables from NetCDF file
  • Excludes coordinate/metadata variables (x, y, s, n, time, etc.)
  • Automatically populated when loading file

3. Unified 2D tab interface

  • Added variable dropdown matching 1D tab style
  • Replaced 4 buttons with single "Load & Plot" button
  • Added "Overlay vegetation" checkbox
  • Variable changes update plot immediately

See mockup showing updated interface for both tabs.

Copilot AI changed the title Add Plot Output 1D tab for transect visualization Add Plot Output 1D tab for transect visualization with unified interface Nov 4, 2025
@Sierd Sierd marked this pull request as ready for review November 4, 2025 17:32
@Sierd Sierd merged commit 0cfcd85 into GUI_development Nov 4, 2025
@Sierd Sierd deleted the copilot/add-plot-output-1d-tab branch November 4, 2025 17:32
@Sierd Sierd restored the copilot/add-plot-output-1d-tab branch November 4, 2025 17:40
Sierd added a commit that referenced this pull request Nov 6, 2025
* Initialisation of the GUI

Including some overdue maintenance related to python 2-->3 in the write_configfile script.

* Updated GUI structure using Class

* updated gui

* update gui branche with latest main (#255)

* fixed dependencies for python 3.13 (#236)

* test with timing function

* Add devcontainer for use in codespaces (#240)

* devcontainer added

* Update Dockerfile

* Update Dockerfile

* Update devcontainer.json

* Update Dockerfile

* fixed dependencies for python 3.13 (#236) (#239)

* Update Dockerfile

* remove abundant stuff

* Add devcontainer for use in codespaces (#240) (#242)

* devcontainer added

* Update Dockerfile

* Update Dockerfile

* Update devcontainer.json

* Update Dockerfile

* fixed dependencies for python 3.13 (#236) (#239)

* Update Dockerfile

* remove abundant stuff

* Update Dockerfile (#243)

This patch updates the dockerfile for the codespace to be compatible with developer mode.
You need to manual install python in dev model after the docker is created.

* Cleanup main (#245)

* delete abundant files

* deleted:    aeolis/examples/vanWesten2024/blowout/figure_grid_initialization.png
deleted:    aeolis/examples/vanWesten2024/blowout/figure_params_initialization.png
deleted:    aeolis/examples/vanWesten2024/blowout/figure_timeseries_initialization.png

* Update pyproject.toml

* Update README.md

* Update CITATION.cff

* Update release info (#246)

* Update pyproject.toml

* Update CITATION.cff

* Update README.md

* Update Python version and dependencies in installation guide

* Implement error message for missing ne_file

Added error handling for missing 'ne_file' when using Avalanching.

* Print message for aeolis installation in Dockerfile

Add message indicating manual installation of aeolis

* Update vegetation parameters in constants.py (#250)

* Update vegetation parameters in constants.py

Removes unused V_Lat parameter
solves #120 
Changes default for veg_min_elevation to -10 to avoid unwanted use of this functionality.

* Update aeolis/constants.py

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>

* input and output tab added
improved domain plotting functionality

* added functionality

* Fix GUI crash when canceling file selection on startup (#256)

* Initial plan

* Fix GUI to handle cancel on startup gracefully

Co-authored-by: Sierd <[email protected]>

* Address code review feedback: move import to top and remove hardcoded path

Co-authored-by: Sierd <[email protected]>

* Remove placeholder path, set configfile to 'No file selected' when canceled

Co-authored-by: Sierd <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Sierd <[email protected]>

* Add Plot Output 1D tab for transect visualization with unified interface (#257)

* Initial plan

* Add Plot Output 1D tab with transect plotting functionality

Co-authored-by: Sierd <[email protected]>

* Add variable change callback for 1D plot updates

Co-authored-by: Sierd <[email protected]>

* Fix code review issues: cross-platform paths and dimension validation

Co-authored-by: Sierd <[email protected]>

* Improve dimension validation and dictionary access robustness

Co-authored-by: Sierd <[email protected]>

* Fix transect direction bug and unify 2D/1D tab interface with dynamic variable dropdowns

Co-authored-by: Sierd <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Sierd <[email protected]>

* bugfixes (#259)

* Initial plan

* Add Plot Output 1D tab with transect plotting functionality

Co-authored-by: Sierd <[email protected]>

* Add variable change callback for 1D plot updates

Co-authored-by: Sierd <[email protected]>

* Fix code review issues: cross-platform paths and dimension validation

Co-authored-by: Sierd <[email protected]>

* Improve dimension validation and dictionary access robustness

Co-authored-by: Sierd <[email protected]>

* Fix transect direction bug and unify 2D/1D tab interface with dynamic variable dropdowns

Co-authored-by: Sierd <[email protected]>

* bugfixes

* added functionality, colorbars, many small fixes.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Sierd <[email protected]>

* domain overview added to 1D plot mode.

* Delete aeolis/GUI.ipynb

* Remove incompatible parameter checks for ne_file

Removed error handling for missing ne_file when using Avalanching.

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Sierd <[email protected]>
@Sierd Sierd mentioned this pull request Nov 6, 2025
Sierd added a commit that referenced this pull request Nov 6, 2025
* Initialisation of the GUI

Including some overdue maintenance related to python 2-->3 in the write_configfile script.

* Updated GUI structure using Class

* updated gui

* update gui branche with latest main (#255)

* fixed dependencies for python 3.13 (#236)

* test with timing function

* Add devcontainer for use in codespaces (#240)

* devcontainer added

* Update Dockerfile

* Update Dockerfile

* Update devcontainer.json

* Update Dockerfile

* fixed dependencies for python 3.13 (#236) (#239)

* Update Dockerfile

* remove abundant stuff

* Add devcontainer for use in codespaces (#240) (#242)

* devcontainer added

* Update Dockerfile

* Update Dockerfile

* Update devcontainer.json

* Update Dockerfile

* fixed dependencies for python 3.13 (#236) (#239)

* Update Dockerfile

* remove abundant stuff

* Update Dockerfile (#243)

This patch updates the dockerfile for the codespace to be compatible with developer mode.
You need to manual install python in dev model after the docker is created.

* Cleanup main (#245)

* delete abundant files

* deleted:    aeolis/examples/vanWesten2024/blowout/figure_grid_initialization.png
deleted:    aeolis/examples/vanWesten2024/blowout/figure_params_initialization.png
deleted:    aeolis/examples/vanWesten2024/blowout/figure_timeseries_initialization.png

* Update pyproject.toml

* Update README.md

* Update CITATION.cff

* Update release info (#246)

* Update pyproject.toml

* Update CITATION.cff

* Update README.md

* Update Python version and dependencies in installation guide

* Implement error message for missing ne_file

Added error handling for missing 'ne_file' when using Avalanching.

* Print message for aeolis installation in Dockerfile

Add message indicating manual installation of aeolis

* Update vegetation parameters in constants.py (#250)

* Update vegetation parameters in constants.py

Removes unused V_Lat parameter
solves #120 
Changes default for veg_min_elevation to -10 to avoid unwanted use of this functionality.

* Update aeolis/constants.py



---------



---------



* input and output tab added
improved domain plotting functionality

* added functionality

* Fix GUI crash when canceling file selection on startup (#256)

* Initial plan

* Fix GUI to handle cancel on startup gracefully



* Address code review feedback: move import to top and remove hardcoded path



* Remove placeholder path, set configfile to 'No file selected' when canceled



---------




* Add Plot Output 1D tab for transect visualization with unified interface (#257)

* Initial plan

* Add Plot Output 1D tab with transect plotting functionality



* Add variable change callback for 1D plot updates



* Fix code review issues: cross-platform paths and dimension validation



* Improve dimension validation and dictionary access robustness



* Fix transect direction bug and unify 2D/1D tab interface with dynamic variable dropdowns



---------




* bugfixes (#259)

* Initial plan

* Add Plot Output 1D tab with transect plotting functionality



* Add variable change callback for 1D plot updates



* Fix code review issues: cross-platform paths and dimension validation



* Improve dimension validation and dictionary access robustness



* Fix transect direction bug and unify 2D/1D tab interface with dynamic variable dropdowns



* bugfixes

* added functionality, colorbars, many small fixes.

---------




* domain overview added to 1D plot mode.

* Delete aeolis/GUI.ipynb

* Remove incompatible parameter checks for ne_file

Removed error handling for missing ne_file when using Avalanching.

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Sierd <[email protected]>
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