df7a1b9655324e32bf04d771d4f.../README.md
2025-07-08 14:27:58 +00:00

1.4 KiB

Time weighted corrosion rate calculation

The objective of this calculation is to derive a final representative corrosion depth growth rate (mm/year) at each point along a pipeline using multiple In-Line Inspection (ILI) data sets, and to predict the likely depth of metal loss by a future target date (e.g. 24 October 2023)

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 strings which should each be a valid uuid representing a pipeline.
  • target_date: a string representing the date for which the corrosion growth rate should be predicted.

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.

cargo run functions create \
  -f functions/acr_time_weighted \
  -d "Run the time weighted corrosion rate calculation" \
  -i org_id=string \
  -i project_id=string \
  -i target_date=string \
  -i pipeline_id=array

Testing the function locally

You can run and test the function locally by running

cargo run

Then you can check it work with curl as follows

curl localhost:8080 -d $(jq '. | tojson' functions/acr_time_weighted/example_input.json)