cf6770b3c9c14f889ab045257f0.../README.md
2025-07-29 14:25:12 +00:00

67 lines
2.2 KiB
Markdown

# ILI comparison (compare all)
This function will run all possible ILI comparisons for a given pipeline using the continuous scorer implementation.
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
- `older_ili_id`: a `array` of string values representing a valid `uuid` for an ili report sequence
- `newer_ili_id`: a `array` of string values representing a valid `uuid` for an ili report sequence
- `weld_location_threshold`: a `float` value
- `feature_location_threshold`: a `float` value
- `upstream_girth_threshold`: a `float` value
- `orientation_threshold`: a `float` value
- `anomaly_size`: an `object` with the configuration for the depth and length of the anomalies
- `surface_location_criteria`: a `string` whose value should be one of
- `matching`
- `any`
## 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_continuous \
-d "Runs the ILI comparison algorithm for all combinations of ILI reports for the given pipeline using the continuous scorer" \
-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 older_ili_id=array \
-i newer_ili_id=array \
-i weld_location_threshold=float \
-i upstream_girth_threshold=float \
-i feature_location_threshold=float \
-i orientation_threshold=float \
-i anomaly_size=object \
-i surface_location_criteria=string
```
## 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_continuous/example_input.json)
```