xdem icon indicating copy to clipboard operation
xdem copied to clipboard

Blockwise multiprocessing bug and intersection in CLI

Open adebardo opened this issue 3 months ago • 3 comments

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. image

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.

adebardo avatar Oct 13 '25 08:10 adebardo

@belletva can you check this please :)

adebardo avatar Nov 03 '25 08:11 adebardo

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)

belletva avatar Nov 04 '25 09:11 belletva

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.

belletva avatar Nov 04 '25 10:11 belletva

Only small comments from me, then good to go! :wink:

rhugonnet avatar Nov 28 '25 22:11 rhugonnet