Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9b7dceb
Rewrite warnings as a class with a protected constructor. Should work…
andrey-katz-systemorph Aug 2, 2023
9311761
Merge branch 'develop' into 359_ExtendableWarningsAndErrors
andrey-katz-systemorph Aug 2, 2023
9ba0ae0
partial rearrangement of errors. Not done yet
andrey-katz-systemorph Aug 2, 2023
ee3219c
compiling error get
andrey-katz-systemorph Aug 2, 2023
9ec4e88
Merge remote-tracking branch 'origin/develop' into 359_ExtendableWarn…
andrey-katz-systemorph Aug 2, 2023
dcfb91d
remove obsolete pieces of code
andrey-katz-systemorph Aug 2, 2023
a4be22c
bug fixed, tests pass
andrey-katz-systemorph Aug 2, 2023
c1f15e1
name change: not sure it was necessary
andrey-katz-systemorph Aug 2, 2023
9a7d558
revert to old names
andrey-katz-systemorph Aug 2, 2023
b1b4112
warnings: new more compact API
andrey-katz-systemorph Aug 3, 2023
8f89e3d
moved the Get functions to be virtual methods of the error and warnin…
andrey-katz-systemorph Aug 3, 2023
fa9f5f2
application message updated
andrey-katz-systemorph Aug 3, 2023
077f3c1
Tests adaptation
andrey-katz-systemorph Aug 3, 2023
1177d6e
adapt two tests from the template
andrey-katz-systemorph Aug 3, 2023
27b9ef1
one more test adaptation
andrey-katz-systemorph Aug 4, 2023
599dca4
include GetMessage as an abstract method in the base class
andrey-katz-systemorph Aug 4, 2023
40f7d99
verbal explanation slightly modified.
andrey-katz-systemorph Aug 4, 2023
7735eb1
further adjustment to the explanation
andrey-katz-systemorph Aug 4, 2023
bfbe862
remove comment
andrey-katz-systemorph Aug 8, 2023
4e5ce8f
name change everywhere
andrey-katz-systemorph Aug 8, 2023
e220dd8
changed environment to dev
andrey-katz-systemorph Aug 8, 2023
680ee37
Update CalculationEngine.ipynb
andrey-katz-systemorph Aug 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ifrs17-template/Constants/CalculationEngine.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
"var projectName = \"ifrs17\";",
"\nvar environmentName = \"v1.3.1\";",
"\nvar notebookName = \"CalculationEngine\";",
"\nvar calculationEngine = $\"#!import \\\"../../{projectName}/{notebookName}\\\"\";"
"\nvar calculationEngine = $\"#!import \\\"../../{projectName}/{environmentName}/{notebookName}\\\"\";"
],
"metadata": {},
"execution_count": 0,
"outputs": []
}
]
}
}
2 changes: 1 addition & 1 deletion ifrs17-template/Test/MapTemplateAndImportTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@
"\nawait Workspace.ValidateDataNodeStatesAsync(persistentDataNodeDataByDataNode);",
"\nActivity.HasErrors().Should().Be(true);",
"\nvar log = Activity.Finish().Errors.First().ToString().Substring(40);",
"\n(log.Substring(0,log.Length-2) == Get(Error.ChangeDataNodeState, \"GIC1\")).Should().Be(true);"
"\n(log.Substring(0,log.Length-2) == Error.ChangeDataNodeState.GetMessage(\"GIC1\")).Should().Be(true);"
],
"metadata": {},
"execution_count": 0,
Expand Down
2 changes: 1 addition & 1 deletion ifrs17-template/Test/ScenarioParametersImportTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
{
"cell_type": "code",
"source": [
"((log.Warnings.FirstOrDefault()?.ToString().Remove(0,40).Remove(125,2)?? \"\") == Get(Warning.VariablesAlreadyImported)).Should().Be(true);"
"((log.Warnings.FirstOrDefault()?.ToString().Remove(0,40).Remove(125,2)?? \"\") == Warning.VariablesAlreadyImported.GetMessage()).Should().Be(true);"
],
"metadata": {},
"execution_count": 0,
Expand Down
2 changes: 1 addition & 1 deletion ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
{
"cell_type": "code",
"source": [
"((log.Warnings.FirstOrDefault()?.ToString().Remove(0,40).Remove(125,2)?? \"\") == Get(Warning.VariablesAlreadyImported)).Should().Be(true);"
"((log.Warnings.FirstOrDefault()?.ToString().Remove(0,40).Remove(125,2)?? \"\") == Warning.VariablesAlreadyImported.GetMessage()).Should().Be(true);"
],
"metadata": {},
"execution_count": 0,
Expand Down
365 changes: 218 additions & 147 deletions ifrs17/Constants/Validations.ipynb

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions ifrs17/Test/DataNodeParameterTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@
"\nDataNodeInvalid1,DTR1.1,1",
"\nDTR1.1,DataNodeInvalid2,1\";",
"\n",
"\nvar errorsBm = new List<string>(){Get(Error.InvalidDataNode, \"DataNodeInvalid0\"),",
"\n Get(Error.InvalidDataNode, \"DataNodeInvalid1\"),",
"\n Get(Error.InvalidDataNode, \"DataNodeInvalid2\")};"
"\nvar errorsBm = new List<string>(){Error.InvalidDataNode.GetMessage(\"DataNodeInvalid0\"),",
"\n Error.InvalidDataNode.GetMessage(\"DataNodeInvalid1\"),",
"\n Error.InvalidDataNode.GetMessage(\"DataNodeInvalid2\")};"
],
"metadata": {},
"execution_count": 0,
Expand Down Expand Up @@ -231,8 +231,8 @@
"\nDTR1.1,DT1.1,1",
"\nDT1.1,DTR1.1,1",
"\n\";",
"\nvar errorsBm = new List<string>(){Get(Error.DuplicateSingleDataNode, \"DT1.1\"),",
"\n Get(Error.DuplicateInterDataNode, \"DT1.1\",\"DTR1.1\"),};"
"\nvar errorsBm = new List<string>(){Error.DuplicateSingleDataNode.GetMessage(\"DT1.1\"),",
"\n Error.DuplicateInterDataNode.GetMessage(\"DT1.1\",\"DTR1.1\"),};"
],
"metadata": {},
"execution_count": 0,
Expand Down Expand Up @@ -273,7 +273,7 @@
"\nDataNode,LinkedDataNode,ReinsuranceCoverage",
"\nDT1.1,DT1.1,1",
"\n\";",
"\nvar errorsBm = new List<string>(){Get(Error.ReinsuranceCoverageDataNode, \"DT1.1\",\"DT1.1\")};"
"\nvar errorsBm = new List<string>(){Error.ReinsuranceCoverageDataNode.GetMessage(\"DT1.1\",\"DT1.1\")};"
],
"metadata": {},
"execution_count": 0,
Expand Down Expand Up @@ -319,7 +319,7 @@
"\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod",
"\nDT1.1,0.85,Monthly,InvalidEntry",
"\n\";",
"\nvar errorsBm = new List<string>(){Get(Error.InvalidInterpolationMethod, \"DT1.1\"),};"
"\nvar errorsBm = new List<string>(){Error.InvalidInterpolationMethod.GetMessage(\"DT1.1\"),};"
],
"metadata": {},
"execution_count": 0,
Expand Down Expand Up @@ -393,7 +393,7 @@
"\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod",
"\nDT1.1,0.85,Yearly,,",
"\n\";",
"\nvar errorsBm = new List<string>(){Get(Error.InvalidInterpolationMethod, \"DT1.1\"),};"
"\nvar errorsBm = new List<string>(){Error.InvalidInterpolationMethod.GetMessage(\"DT1.1\"),};"
],
"metadata": {},
"execution_count": 0,
Expand Down Expand Up @@ -439,7 +439,7 @@
"\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod",
"\nDT1.1,0.85,A,,",
"\n\";",
"\nvar errorsBm = new List<string>(){Get(Error.InvalidCashFlowPeriodicity, \"DT1.1\"),};"
"\nvar errorsBm = new List<string>(){Error.InvalidCashFlowPeriodicity.GetMessage(\"DT1.1\"),};"
],
"metadata": {},
"execution_count": 0,
Expand Down Expand Up @@ -477,7 +477,7 @@
"\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod",
"\nDT1.1,0.85,,Uniform,",
"\n\";",
"\nvar errorsBm = new List<string>(){Get(Error.InvalidCashFlowPeriodicity, \"DT1.1\"),};"
"\nvar errorsBm = new List<string>(){Error.InvalidCashFlowPeriodicity.GetMessage(\"DT1.1\"),};"
],
"metadata": {},
"execution_count": 0,
Expand Down Expand Up @@ -514,7 +514,7 @@
"\nDataNode,PremiumAllocation,CashFlowPeriodicity,InterpolationMethod",
"\nDT1.1,0.85,,,",
"\n\";",
"\nvar errorsBm = new List<string>(){Get(Error.InvalidCashFlowPeriodicity, \"DT1.1\"),};"
"\nvar errorsBm = new List<string>(){Error.InvalidCashFlowPeriodicity.GetMessage(\"DT1.1\"),};"
],
"metadata": {},
"execution_count": 0,
Expand Down Expand Up @@ -560,7 +560,7 @@
"\nDataNode,PremiumAllocation,EconomicBasisDriver",
"\nDT1.1,0.85,A",
"\n\";",
"\nvar errorsBm = new List<string>(){Get(Error.InvalidEconomicBasisDriver, \"DT1.1\"),};"
"\nvar errorsBm = new List<string>(){Error.InvalidEconomicBasisDriver.GetMessage(\"DT1.1\"),};"
],
"metadata": {},
"execution_count": 0,
Expand Down Expand Up @@ -687,7 +687,7 @@
"\nDataNode,PremiumAllocation,ReleasePattern0,ReleasePattern1",
"\nDT1.1,0.85,InvalidValue0,InvalidValue1",
"\n\";",
"\nvar errorsBm = new List<string>(){Get(Error.ParsingInvalidOrScientificValue, \"InvalidValue0\"),Get(Error.ParsingInvalidOrScientificValue, \"InvalidValue1\")};"
"\nvar errorsBm = new List<string>(){Error.ParsingInvalidOrScientificValue.GetMessage(\"InvalidValue0\"), Error.ParsingInvalidOrScientificValue.GetMessage(\"InvalidValue1\")};"
],
"metadata": {},
"execution_count": 0,
Expand Down
4 changes: 2 additions & 2 deletions ifrs17/Test/QueriesTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@
{
"cell_type": "code",
"source": [
"var expectedErrorMessage = Get(Error.YieldCurveNotFound, \"DT1.1\", \"EUR\",\"2016\",\"12\",\"Best Estimate\",\"A\");",
"var expectedErrorMessage = Error.YieldCurveNotFound.GetMessage(\"DT1.1\", \"EUR\",\"2016\",\"12\",\"Best Estimate\",\"A\");",
"\nvar errorMessage = activity.Errors.First().ToString();",
"\nerrorMessage.Contains(expectedErrorMessage).Should().Be(true);"
],
Expand Down Expand Up @@ -822,7 +822,7 @@
{
"cell_type": "code",
"source": [
"var expectedErrorMessage = Get(Error.YieldCurveNotFound, \"DT1.1\", \"EUR\",\"2016\",\"9\",\"Best Estimate\",\"A\");",
"var expectedErrorMessage = Error.YieldCurveNotFound.GetMessage(\"DT1.1\", \"EUR\",\"2016\",\"9\",\"Best Estimate\",\"A\");",
"\nvar errorMessage = activity.Errors.First().ToString();",
"\nerrorMessage.Contains(expectedErrorMessage).Should().Be(true);"
],
Expand Down
4 changes: 2 additions & 2 deletions ifrs17/Utils/ApplicationMessage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"\n ApplicationMessage.activity = activity;",
"\n }",
"\n ",
"\n public static Object Log (Error e, params string[] s) { log.LogError(Get(e,s)); return null; }",
"\n public static Object Log (Warning w, params string[] s) { log.LogWarning(Get(w,s)); return null; }",
"\n public static Object Log (Error e, params string[] s) { log.LogError(e.GetMessage(s)); return null; }",
"\n public static Object Log (Warning w, params string[] s) { log.LogWarning(w.GetMessage(s)); return null; }",
"\n ",
"\n public static Object Log (ActivityLog activityLog) {",
"\n foreach(var error in activityLog.Errors) log.LogError(error.ToString());",
Expand Down