97 lines
5.0 KiB
Markdown
97 lines
5.0 KiB
Markdown
# Runs the ILI clustering algorithm
|
|
|
|
Clustering criteria for pipeline defects refer to the guidelines or criteria that are used to
|
|
determine whether a group of defects in a pipeline should be considered a "cluster." These
|
|
criteria are typically based on a combination of factors, including the size, location, and
|
|
severity of the defects, as well as the spacing between them.
|
|
There are several different clustering criteria that can be used for pipeline defects,
|
|
depending on the specific context and application. Some common clustering criteria include:
|
|
|
|
- *Percentage of wall loss*: This criterion considers the percentage of the pipeline wall that has
|
|
been lost due to corrosion or other defects. A group of defects that collectively represent a
|
|
certain percentage of wall loss (e.g., 10%) may be considered a cluster.
|
|
- *Spacing between defects*: This criterion considers the distance between individual defects in a
|
|
pipeline. If the spacing between defects falls below a certain threshold (e.g., 1 meter), they
|
|
may be considered a cluster.
|
|
- *Geographic location*: This criterion considers the geographic location of defects within a
|
|
pipeline. If defects are clustered within a certain area of the pipeline (e.g., a bend or a
|
|
weld), they may be considered a cluster.
|
|
- *Severity of defects*: This criterion considers the severity or consequence of individual
|
|
defects. If a group of defects collectively represent a significant risk of failure or leakage,
|
|
they may be considered a cluster.
|
|
|
|
Pipeline operators typically use clustering criteria as part of their inspection and
|
|
maintenance programs to identify and prioritize areas of the pipeline that require attention.
|
|
By identifying and addressing clusters of defects, operators can help prevent failures and
|
|
ensure the safe and reliable operation of their pipelines.
|
|
|
|
Examining the clustering of pipeline defects is a crucial aspect of pipeline integrity
|
|
management. This involves evaluating the spacing between defects in a pipeline to determine the
|
|
likelihood of larger defects clustering together. Specific conditions must be met for this
|
|
distance to be considered acceptable. If these conditions are met, the possibility of defect
|
|
clustering cannot be overlooked.
|
|
|
|
## 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`: an `array` of `stings` which should be valid UUIDs for pipelines
|
|
- `size_settings`: a string representing the size setting for clustering, possible values
|
|
- `original`
|
|
- `tolerance`
|
|
- `interaction`: a string representing the interaction setting for clustering, possible values
|
|
- `enabled`
|
|
- `disabled`
|
|
- `surface_location`: a string representing the surface location setting for clustering, possible values
|
|
- `matching`
|
|
- `any`
|
|
- `rule`: a string representing the clustering rule to use, possible values
|
|
- `rule1`
|
|
- `rule2`
|
|
- `rule3`
|
|
- `rule4`
|
|
- `rule5`
|
|
- `rule6`
|
|
- `rule7`
|
|
- `rule8`
|
|
- `rule9`
|
|
- `rule10`
|
|
- `rule11`
|
|
|
|
## 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_clustering \
|
|
-d "Runs the ILI clustering algorithm" \
|
|
-i org_id=string \
|
|
-i project_id=string \
|
|
-i pipeline_id=array \
|
|
-i ili_id=array \
|
|
-i size_settings=string \
|
|
-i interaction=string \
|
|
-i surface_location=string \
|
|
-i rule=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 -X POST localhost:8080 -v \
|
|
-d "\"{\\\"formData\\\": {\\\"anomalyInteractionSetting\\\": \\\"disabled\\\", \\\"anomalySizeSetting\\\": \\\"original\\\", \\\"clusteringRule\\\": \\\"rule1\\\", \\\"ili_datasetIds\\\": \\\"\\\", \\\"ili_organizationId\\\": \\\"2cbfe270-d195-48ad-aed1-24145924635c\\\", \\\"ili_resourceClientIds\\\": [\\\"ILI2015-02-report\\\"], \\\"ili_resourceIds\\\": [\\\"d0dd7c6b-6c54-4149-b46c-5e5b033fe6dd\\\"], \\\"ili_resourceTypeId\\\": 6, \\\"ili_workspaceId\\\": \\\"680b61b0aedd6f9e639d8699\\\", \\\"pipelineId_datasetIds\\\": \\\"680b91f3802a656bbd2cefe8\\\", \\\"pipelineId_organizationId\\\": \\\"2cbfe270-d195-48ad-aed1-24145924635c\\\", \\\"pipelineId_resourceClientIds\\\": [\\\"pipeline:1\\\"], \\\"pipelineId_resourceIds\\\": [\\\"01966d47-1d4c-7751-a1f1-0617caa3a00d\\\"], \\\"pipelineId_resourceTypeId\\\": 1, \\\"pipelineId_workspaceId\\\": \\\"680b61b0aedd6f9e639d8699\\\", \\\"surfaceLocationSensitivity\\\": \\\"matching\\\"}, \\\"ili_id\\\": [\\\"d0dd7c6b-6c54-4149-b46c-5e5b033fe6dd\\\"], \\\"input\\\": null, \\\"interaction\\\": \\\"disabled\\\", \\\"org_id\\\": \\\"2cbfe270-d195-48ad-aed1-24145924635c\\\", \\\"pipeline_id\\\": [\\\"01966d47-1d4c-7751-a1f1-0617caa3a00d\\\"], \\\"project_id\\\": \\\"680b61b0aedd6f9e639d8699\\\", \\\"rule\\\": \\\"rule1\\\", \\\"size_settings\\\": \\\"original\\\", \\\"surface_location\\\": \\\"matching\\\"}\""
|
|
```
|