Closed schorsch2 closed 5 months ago
hello schorsch2, unfortunately, I cannot reproduce the error. Can you tell me which version of the plugin you are using and which version of openpyxl you are using? It seems like there is a problem with the export of excel-files.
Jannik
Plugin: 0.32 python3-openpyxl: 3.0.9-1 I have tried it again in an otherwise empty project. It worked once and then unfortunately not again.
yup, writing the tables to excel files seems to be the problem. Maybe updating openpyxl will help. Version 3.0.9 is from 2021; current version is 3.1.2; there have been several bug-fixes in this package.
I have now updated openpyxl to 3.1.2 - this still causes a crash.
(...)
I cannot reproduce the error.(...)
Now I can (on Windows). As far as I can see it happens only with empty tables.
I can also generate the example tables on a freshly installed computer. This does not work on my workstation either.
I´ll do some tests. So far I could not find the problem.
I have installed with pip install odfpy
and uninstalled openpyxl. Now the creation of the default tables runs smoothly.
Not working for us. I installed odfpy 1.4.1, uninstalled openyxl 3.1.2 and QGIS (3.28.10) is still crashing.
ok.
I am generally not happy with the dependence from packages like openpyxl / odfpy etc. As far as I can test it, the current approach works fine on Linux, but crashes (with different error reports) on Windows.
I tried to replace the code which is writing the xlsx / odf files with the native tool "export to spreadsheet" in qgis. However, it does not write column headers for empty tables so far. I'm currently trying to fill the tables with empty strings in order to prevent the crash... still need some time for testing.
If any of you has a another idea... please write your suggestions. The function in the currently published plugin version starts here: https://github.com/Jannik-Schilling/generate_swmm_inp/blob/0336fc2280ad83db6a26b85bb92898228ad93cf6/g_s_read_write_data.py#L345
A totally different approach would be replacing the xlsx / xls / odf tables with geopackage files. This would be much easier to write but users might prefer editing timeseries with a different software than QGIS.
This is a great idea to suggest gpkg but indeed many users might prefer Excel. What about csv files? FYI I used your plugin last year with QGIS 3.16 and the creation of default files was working. (But I cannot test it again as our organization is controlling our computers)
recent commits seem to work to in branch dev_0_33: 705350f6d06747ba9e2d9b2227b87e285bb399e0, a0218295c63a3f6b3a96e95c49f7b3b8f31224ac, ec573cce8d53ca4db3339e2aa523b0ac6d5e9bad, and 2f698a9ab5dcb5068f4cc54d660975eebcfa7a06
There is still a problem with the timeseries and hydrographs sections (date and time formats).
Yes, I have installed dev_0_33 and the data is generated without crashing. Thank you very much!
There are still some bugs. The next version will likely be published as an experimental version.
e11217a8446e0943c2e11df3d15d7c3cee9ae89e
version 0.33 is available now as 'experimental plugin' on the QGIS plugin server. Tested with Windows and Linux and had no crashes so far. If you're experiencing errors please open another issue.
@schorsch2 : I´d recommend to use the latest version, because the second tool (2_GenerateSwmmInpFile) had some troubles with date and time formats before.
It's working well. Thank you!
I am trying to generate the default data and have selected a CRS, empty data and a folder. This ends in an exception error. `## Report Details
Python Stack Trace
Stack Trace
QGIS Info QGIS Version: 3.34.1-Prizren QGIS code revision: 133927424d Compiled against Qt: 5.15.3 Running against Qt: 5.15.3 Compiled against GDAL: 3.8.1 Running against GDAL: 3.8.1
System Info CPU Type: x86_64 Kernel Type: winnt Kernel Version: 10.0.22621 `