tweak: Numerate integration errors.

This commit is contained in:
NunoSempere 2022-09-05 12:49:47 +02:00
parent a45e38d75d
commit 2b414191ac

View File

@ -95,9 +95,9 @@ module Internals = {
| Ok(IEvNumber(x)) => Ok(x) | Ok(IEvNumber(x)) => Ok(x)
| Error(_) => | Error(_) =>
Error( Error(
"Integration error in Danger.integrate. It's possible that your function doesn't return a number, try definining auxiliaryFunction(x) = mean(yourFunction(x)) and integrate auxiliaryFunction instead", "Integration error 1 in Danger.integrate. It's possible that your function doesn't return a number, try definining auxiliaryFunction(x) = mean(yourFunction(x)) and integrate auxiliaryFunction instead",
) )
| _ => Error("Integration error in Danger.integrate") | _ => Error("Integration error 2 in Danger.integrate")
} }
result result
} }
@ -161,7 +161,7 @@ module Internals = {
} }
resultWithOuterPoints resultWithOuterPoints
} }
| false => Error("Integration error in Danger.integrate") | false => Error("Integration error 3 in Danger.integrate")
} }
result result
} }
@ -277,7 +277,7 @@ let library = [
~run=(inputs, _, env, reducer) => { ~run=(inputs, _, env, reducer) => {
let result = switch inputs { let result = switch inputs {
| [_, _, _, IEvNumber(0.0)] => | [_, _, _, IEvNumber(0.0)] =>
Error("Integration error in Danger.integrate: Increment can't be 0.") Error("Integration error 4 in Danger.integrate: Increment can't be 0.")
| [IEvLambda(aLambda), IEvNumber(min), IEvNumber(max), IEvNumber(numIntegrationPoints)] => | [IEvLambda(aLambda), IEvNumber(min), IEvNumber(max), IEvNumber(numIntegrationPoints)] =>
Internals.integrateFunctionBetweenWithNumIntegrationPoints( Internals.integrateFunctionBetweenWithNumIntegrationPoints(
aLambda, aLambda,
@ -287,11 +287,11 @@ let library = [
env, env,
reducer, reducer,
)->E.R2.errMap(_ => )->E.R2.errMap(_ =>
"Integration error in Danger.integrate. Something went wrong along the way" "Integration error 5 in Danger.integrate. Something went wrong along the way"
) )
| _ => | _ =>
Error( Error(
"Integration error in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))", "Integration error 6 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",
) )
} }
result result
@ -328,11 +328,11 @@ let library = [
env, env,
reducer, reducer,
)->E.R2.errMap(_ => )->E.R2.errMap(_ =>
"Integration error in Danger.integrate. Something went wrong along the way" "Integration error 7 in Danger.integrate. Something went wrong along the way"
) )
| _ => | _ =>
Error( Error(
"Integration error in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))", "Integration error 8 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",
) )
} }
result result