509c88b82bc14a54b5f2e3e9e05.../README.md
2025-08-19 14:57:54 +00:00

67 lines
2.1 KiB
Markdown

# ILI comparison
This function will run the ILI comparison algorithm based on 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_comparison_continuous \
-d "Compare two ILI reports 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_comparison_continuous/example_input.json)
```