Skip to content
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

Crash when adding discharge boundary conditions #110

Open
SCLaan opened this issue Feb 22, 2024 · 1 comment
Open

Crash when adding discharge boundary conditions #110

SCLaan opened this issue Feb 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@SCLaan
Copy link
Collaborator

SCLaan commented Feb 22, 2024

Severity Level

High

Steps to reproduce

  1. Build a simple model (for a watershed) with:
    • an automatic zoom level (clicking Cancel)
    • automatically generated water level boundary points
  2. Go to Boundary Conditions and click on the tab Discharge (gives a first error)
  3. Click on Add Point (gives second (minor) error)
  4. Click somewhere on the model domain (gives third error and the GUI crashes)

Current behaviour

Error at step 2:

Traceback (most recent call last):
  File "C:\Users\laan_st\.conda\envs\ddb_floodadapt\Lib\site-packages\guitares\pyqt5\tabpanel.py", line 31, in tab_selected
    tabs[indx].module.select()
  File "c:\Users\laan_st\OneDrive - Stichting Deltares\Documents\GitHub\DelftDashboard\src\delftdashboard\models\sfincs_hmt\boundary_conditions_dis.py", line 12, in select
    app.map.layer["sfincs_hmt"].layer["discharge_points"].activate()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
KeyError: 'discharge_points'
can only concatenate str (not "NoneType") to str
javaScriptConsoleMessage:  2 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: http://localhost:3000/js/geojson_layer_line.js 0 http://localhost:3000/

Error at step 3:
can only concatenate str (not "NoneType") to str

Error at step 4:

127.0.0.1 - - [22/Feb/2024 14:21:54] "GET /overlays/sfincs_hmt.bed_levels.png HTTP/1.1" 200 -
127.0.0.1 - - [22/Feb/2024 14:21:54] "GET /overlays/sfincs_hmt.bed_levels.legend.373737.png HTTP/1.1" 200 -
Error loading ddb background topo ...
Traceback (most recent call last):
  File "C:\Users\laan_st\.conda\envs\ddb_floodadapt\Lib\site-packages\guitares\pyqt5\mapbox\mapbox.py", line 153, in pointClicked
    self.point_clicked_callback(x, y)
  File "c:\Users\laan_st\OneDrive - Stichting Deltares\Documents\GitHub\DelftDashboard\src\delftdashboard\models\sfincs_hmt\boundary_conditions_dis.py", line 61, in point_clicked
    app.map.layer["sfincs_hmt"].layer["discharge_points"].set_data(gdf, index)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
KeyError: 'discharge_points'

After this error the GUI crashes.

Desired behaviour

This should work correctly or give me a warning message explaining what my mistake is.

Additional context

I'm using the latest version of DelftDashboard (branch: FloodAdapt_ModelBuilders, commit: f91f5f2)

@roeldegoede
Copy link
Collaborator

Addings points already worked in the open PR which is now also merged 02fe3a9

I see that I already did something with units there. However, I also found out that is still a bit buggy (so needs some love).

image

@LuukBlom LuukBlom added the bug Something isn't working label Feb 23, 2024
roeldegoede added a commit that referenced this issue Feb 28, 2024
roeldegoede added a commit that referenced this issue Mar 8, 2024
Fixed:
- #109 units are added for water levels (m+Ref) and discharge (m3/s).
Not ideal (maybe we would like to configure this somewhere instead of
hardcoding?), but a good starting point.
- #117 guassian shaped timeseries can be added (and copied to all
points)
- improved a bit on stuff discussed in #110 

Also added:
- enabled downloading from NOAA waterlevels from API
- enabled loading geojsons and shapefiles (both for discharge and
waterlevels)
- added the guassian shaped option for discharges as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants