-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[POC] cli 4 : adopt every coregistration method #556
Comments
see remarks in #554 on pipeline code organization and a factory to add every coregistration method and limit code duplication. |
I think what needs to be discussed is how we write the config file to support pipelines. In the API, a pipeline is a sum (with "+" symbol) of coreg methods, each of which have some optional arguments. For example: A simple option could be to accept a string listing exactly this, but I don't think that's the idea behind the CLI? In that case, we need to find a different way to describe the pipeline. Luckily, as pointed out by @rhugonnet, since PR #530, all input parameters of the coreg methods have the same names. One option could be: [inputs]
reference_elev = "path/to_example.tif"
to_be_aligned_elev = "path/to_example.tif"
[outputs]
path = "path/to/save/folder"
[coreg]
method1 = "NuthKaab"
method1_args = {"subsample": 100000}
method2 = "Deramp"
method2_args = {"poly_order": 1} The number of allowed coreg methods could be set to any between 0 and 3? |
Yes, if we can write a dictionary of arguments like you did above, this is sufficient to list all at once (no need to split them by type). The arguments would be exactly the same as exposed through the Additionally, some arguments might be completely unusable through the CLI, like |
Hello to both of you, I was planning to open a special ticket for the pipelines and parameters settings, but I can try to handle it here instead; I'll just add two extra day of development. I note the suggestion to use a dictionary, though we'll need to see if it complicates things on the development side when it comes to validation. I propose opening a ticket for the problematic arguments. |
@adehecq Is there a method similar to ** dem_coregistration** for replacement coreg.NuthKaab(subsample=100000) + coreg.Deramp(poly_order=1) ? |
Context
The goal of this ticket is to implement all affine coregistration methods specified in the configuration file.
The available methods are:
Code Changes
In the
run
function, we need to allow the use of different coregistration methods:Modify
class pydantic_Coregistration(BaseModel)
to accept all coregistration methods.Modify the
run
function as follows:Allowing pipelines
The user can combine several coregistration methods, so we need to allow them to add up to 3 methods.
[coreg]
method1 = "NuthKaab"
method2 = "Deramp"
Allowing parameters
Coregistration methods can be configured, and we propose storing the parameters in a dictionary, which will then be validated using Pydantic (following the provided example for inspiration).
[coreg]
method1 = "NuthKaab"
method1_args = {"subsample": 100000}
method2 = "Deramp"
method2_args = {"poly_order": 1}
exemple code :
Tests
In the
tests/test_cli
file, create tests for all coregistration functions and check their outputs. You can use the tests available at https://github.com/GlacioHack/xdem/tree/main/tests/test_coreg for inspiration.Documentation
Update the CLI documentation to reflect the new coregistration methods. This should include:
Estimation
5d
The text was updated successfully, but these errors were encountered: