5b3fb8f654b54227b8aace1afcd.../README.md
2025-06-24 21:54:51 +00:00

67 lines
2.0 KiB
Markdown

# ILI comparison (compare all)
This function will run all possible ILI comparisons for a given function.
See [ILI comparison](../ili_comparison/README.md) for more details of the comparison algorithm.
## Input
### Arguments
- `org_id`: as string which should be a valid `uuid` for the organization
- `project_id`: the id of the data project where the pipeline data is found
- `pipeline_id`: a `array` of string values representing a valid `uuid` for a pipeline
- `weld_location_threshold`: a `float` value
- `feature_location_threshold`: a `float` value
- `upstream_girth_threshold`: a `float` value
- `orientation_threshold`: a `float` value
- `minimum_depth_growth_threshold`: a `float` value
- `minimum_length_growth_threshold`: a `float` value
- `surface_location_criteria`: an array of `string` each value should be one of
- `matching`
- `any`
- `target_minimum_match_rate`: a `float` value
## Creating the function on the platform
To create this function on the platform using the `cli` set up the port forwarding as shown in README.
Then run the following command to create the function.
```bash
cargo run functions create \
-f functions/ili_compare_all \
-d "Runs the ILI comparison algorithm for all combinations of ILI reports for the given pipeline" \
-o org_id=string \
-o project_id=string \
-o pipeline_ids=array \
-o matched_ids=array \
-o unmatched_ids=array \
-o summary_ids=array \
-i org_id=string \
-i project_id=string \
-i pipeline_id=array \
-i weld_location_threshold=float \
-i upstream_girth_threshold=float \
-i feature_location_threshold=float \
-i orientation_threshold=float \
-i minimum_depth_growth_threshold=float \
-i minimum_length_growth_threshold=float \
-i surface_location_criteria=string \
-i target_minimum_match_rate=float
```
## Testing the function locally
You can run and test the function locally by running
```bash
cargo run
```
Then you can check it work with `curl` as follows
```bash
curl localhost:8080 -d $(jq '. | tojson' functions/ili_compare_all/example_input.json)
```