Blockwise multiprocessing bug and intersection in CLI
Context
The purpose of this PR is to propose a set of initial fixes to the CLI following Valentine’s work and to fix the blockwise multiprocessing bug.
Code
Blockwise bug
Incorrect function call: fixed and unit tests added.
None for stats
It was decided that if the stats field was set to None in the config, then the statistics would not be computed.
It was also proposed to set unnecessary information to None during display. However, this double handling caused various conflicts, which have now been resolved.
Addition of intersection
The goal is to add the computation of the intersection between two DEMs so that they have the same size and projection: new function created — _prepare_datas_for_coreg.
@belletva can you check this please :)
In the doc https://xdem.readthedocs.io/en/stable/advanced_examples/plot_blockwise_coreg.html
Modify the line:
mp_config = MultiprocConfig(chunk_size=500, outfile="aligned_dem.tif")
into:
# Create a configuration without multiprocessing cluster (tasks will be processed sequentially)
mp_config = MultiprocConfig(chunk_size=500, outfile="aligned_dem.tif", cluster=None)
In the doc, sometimes we have from geoutils.raster import MultiprocConfig and sometimes from geoutils.raster.distributed_computing import MultiprocConfig , we need to be consistent.
Only small comments from me, then good to go! :wink: