metocean / wavespectra

MIT License
1 stars 1 forks source link

Implemented code for an already existing "compress" option in method .to_ww3() #47

Closed phellipecouto closed 1 year ago

phellipecouto commented 1 year ago

The main reason for this pull_request is to merge changes done in file wavespectra/output/ww3.py, where the code for the already existing 'compress' option was implemented i.e. option existed but nothing in this regard was being done. The method however was always returning a compressed file when saving a initially loaded WW3 file format into WW3 file format again, that is because all the encodings from the original WW3 (i.e. compressed!) netcdf loaded was being carried over into the the output file generated by the method. This was causing some issues down the track in the SCHISM Wrapper workflow, mainly because decompressing the "huge" WW3 spectra file was slowing down pre-process significantly. The default for option 'compress' remains the same so no backward incompatibilities are expected to other code bases that uses this method.

jorgeperezg commented 1 year ago

I've added some minor changes, mostly to keep backwards compatibility just in case but also some small style changes.

Looks good to me now.