Skip to main content

Trial Inputs

When a user first looks at your calculation, they may not know what some reasonable inputs for your calculation are. To aid with this you can supply trial inputs which will auto fill the inputs fields. When the inputs are provided correctly the calculation page will have a "Trial Inputs" dropdown like the image below.

trial_inputs

Trial inputs work with both .NET and Python calculations. The way that the trial inputs are provided are the same for both languages.

How to provide inputs

tip

Trial Inputs only work for calculations with a persistent calc id, for more on persistent calc id's see here

To provide ArupCompute with trial inputs you must include a .json file inside your library zip when you upload your library.

Your trial inputs should be stored in one .json file called TRIAL_INPUTS.json and that file should be stored in a root level folder called AC_DATA. Therefore your project structure should look something like

Your.Project.dll
Your.Project.dependency.dll
└───AC_DATA
TRIAL_INPUTS.json

TRIAL_INPUTS.json must be structured in the following way:

[
{
"PersistentCalcId": "92ac1ca8-3abd-11ee-be56-0242ac120002",
"Cases": [
{
"Title": "test 1",
"Description": "The first test",
"Inputs": {
"a": 1,
"b": 2
}
},
{
"Title": "test 2",
"Description": "The second test",
"Inputs": {
"a": 3,
"b": 4
}
}
]
},
{
"PersistentCalcId": "0198e51d-1302-46c7-bc20-75a21fc49d9a",
"Cases": [
{
"Title": "test 1",
"Description": "The first test",
"Inputs": {
"a": "1",
"b": "2"
}
},
{
"Title": "test 2",
"Description": "The second test",
"Inputs": {
"a": "3",
"b": "4"
}
}
]
},
]

The inputs that you provide in the "Inputs" field must have the same symbol as the inputs in your calculation (specified via Input meta-data).

If you do not give a value for all inputs to your calculation then the inputs that did not have values will be highlighted in an email that is sent after your calculation is uploaded.

trial_inputs_error

You can add as many trial cases as you want.