This commit addresses the problem of distributing smash with gdal. gdal doesn't provide binary wheels directly, so you need to install the gdal library on your system before you can install gdal bindings in Python. One way of working with gdal simply in Python is conda, but in order to facilitate the distribution of smash on different OS (linux, maxos and windows), it is simpler to use rasterio to read raster (rasterio provides a binary wheel directly which include gdal). This change is not neutral and leads to performance losses in terms of raster calculation time (rain, etp, descriptors, etc). Generally speaking, reading the input data is a relatively quick process compared with a calibration. However, if the calculation time for reading becomes too great a concern, it can be parallelized.
2 other minor changes have been made:
Date regular expression match only on the file name and not the entire path. This can cause problems, for example, if the path is something like this (/home/2020930920/data/prcp/rain_202001010000.tif)
Update tests to avoid reading rasters N times and instead copy arrays
NOTE: A future commit will be made to integrate meson to manage the smash build system. A number of changes will be made to the way smash is installed.
This commit addresses the problem of distributing smash with gdal. gdal doesn't provide binary wheels directly, so you need to install the gdal library on your system before you can install gdal bindings in Python. One way of working with gdal simply in Python is conda, but in order to facilitate the distribution of smash on different OS (linux, maxos and windows), it is simpler to use rasterio to read raster (rasterio provides a binary wheel directly which include gdal). This change is not neutral and leads to performance losses in terms of raster calculation time (rain, etp, descriptors, etc). Generally speaking, reading the input data is a relatively quick process compared with a calibration. However, if the calculation time for reading becomes too great a concern, it can be parallelized.
2 other minor changes have been made:
/home/2020930920/data/prcp/rain_202001010000.tif
)N
times and instead copy arraysNOTE: A future commit will be made to integrate meson to manage the smash build system. A number of changes will be made to the way smash is installed.