From f0240a869abd5e354406beafdbda07491ef4140a Mon Sep 17 00:00:00 2001 From: msorvoja Date: Wed, 18 Dec 2024 14:57:52 +0200 Subject: [PATCH] Add Agterberg-Cheng conditional independence test CLI function --- eis_toolkit/cli.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/eis_toolkit/cli.py b/eis_toolkit/cli.py index 47e9d1d7..95346c7a 100644 --- a/eis_toolkit/cli.py +++ b/eis_toolkit/cli.py @@ -3210,6 +3210,36 @@ def weights_of_evidence_calculate_responses_cli( ) +@app.command() +def agterberg_cheng_CI_test_cli( + input_posterior_probabilities: INPUT_FILE_OPTION, + input_posterior_probabilities_std: INPUT_FILE_OPTION, + nr_of_deposits: Annotated[int, typer.Option()], +): + """Perform the conditional independence test presented by Agterberg-Cheng (2002).""" + from eis_toolkit.prediction.weights_of_evidence import agterberg_cheng_CI_test + + typer.echo("Progress: 10%") + + with rasterio.open(input_posterior_probabilities) as src: + posterior_probabilities = src.read(1) + + with rasterio.open(input_posterior_probabilities_std) as src: + posterior_probabilities_std = src.read(1) + + typer.echo("Progress: 25%") + + _, _, _, _, summary = agterberg_cheng_CI_test( + posterior_probabilities=posterior_probabilities, + posterior_probabilities_std=posterior_probabilities_std, + nr_of_deposits=nr_of_deposits, + ) + + typer.echo("Progress: 100%") + typer.echo("Conditional independence test completed.") + typer.echo(summary) + + # --- TRANSFORMATIONS ---