FLO-2DSoftware / qgis-flo-2d-plugin

A plugin for pre-processing/post-processing FLO-2D models
5 stars 7 forks source link

Float Error #1383

Open FLO-2DKaren opened 5 days ago

FLO-2DKaren commented 5 days ago

TypeError: setValue(self, val: int): argument 1 has unexpected type 'float' Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\gui\dlg_inlets.py", line 540, in inlets_tblw_cell_clicked self.feature_sbox.setValue(float_or_zero(self.inlets_tblw.item(row, 12))) TypeError: setValue(self, val: int): argument 1 has unexpected type 'float'

https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/assets/20424460/de549bfb-2075-47dd-8415-b3619d0e06dc

FLO-2DKaren commented 5 days ago

Test Project Model_12-06-2024_v1.0.0.gpkg.zip

rpachaly commented 5 days ago

Hi Karen,

Do you want me to do a quick fix or should I address this on my storm drain editor modification?

I want to have it done by Friday.

FLO-2DKaren commented 5 days ago

Let's go for By Friday with the understanding that we may need to add it to the current version.

rpachaly commented 5 days ago

Ok! The modified editor is looking AMAZING.

FLO-2DJJ commented 5 days ago

Hi Karen,

Are you using the latest master plugin? The test project you linked doesn't seem to fail with the current master. Since the project is updated, did you update it when asked? Just checking those possibilities.

FLO-2DKaren commented 5 days ago

I am using the latest master. I did update the project when asked. I opened the inlet dialog and then selected row 1.

FLO-2DKaren commented 5 days ago

The error makes sense. The "Feature" parameter isn't a float, it's an integer.

image

FLO-2DJJ commented 5 days ago

The error makes sense. The "Feature" parameter isn't a float, it's an integer.

Yes, it makes sense. It only needs to change line 540 to:

self.feature_sbox.setValue(int_or_zero(self.inlets_tblw.item(row, 12)))

as it is in line 599.

rpachaly commented 5 days ago

I fixed it on the branch that I'm working on. Let's keep the issue so we remember to test it.