snakesonabrain / groundhog

Groundhog, a general-purpose geotechnical library
GNU General Public License v3.0
92 stars 23 forks source link

Xlsxwriter is not compatible with save() anymore #37

Open alda30 opened 9 months ago

alda30 commented 9 months ago

Xlsxwriter is not compatible with save() anymore

save() should be replaced by close() in the source code

snakesonabrain commented 9 months ago

Hi @alda30, could you indicate where this appears in the code?

alda30 commented 9 months ago

I was trying to run the tutorials and in the first one (cpt) I got this error. The error occurs when the command "cpt.to_excel(output_path="Excel export.xlsx")" is used. The full log of the error is given below:

    cpt.to_excel(output_path="Excel export.xlsx")
  File "/home/XXXX/.local/lib/python3.8/site-packages/groundhog/siteinvestigation/insitutests/pcpt_processing.py", line 1876, in to_excel
    writer.save()
AttributeError: 'XlsxWriter' object has no attribute 'save'
snakesonabrain commented 9 months ago

Which version of the xlsxwriter package do you have? The groundhog requirements file has this one:

xlsxwriter==1.3.9

groundhog has a unit test for the Excel export which runs successfully with this version of the package.

KevoBernardo commented 7 months ago

I had this issue in other projects with latests versions of xlsxwriter (currently 3.+). The function changed to "_save()". I think is something easy to fix, so it can be compatible with latest versions

@snakesonabrain I can make a PR to solve this issue if you want. Just let me know

snakesonabrain commented 7 months ago

Thanks for flagging this. If you make a pull request, please make sure that all tests in the pipeline are successful. Currently, groundhog still has support for Python 3.7 and we need to make sure there is compatibility.