snakesonabrain / groundhog

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

Xlsxwriter is not compatible with save() anymore #37

Open alda30 opened 11 months ago

alda30 commented 11 months ago

Xlsxwriter is not compatible with save() anymore

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

snakesonabrain commented 11 months ago

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

alda30 commented 11 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 11 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 9 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 9 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.