Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
32809ad
Adapting the tests (AocStructureTest, ImportStorageTest, ReportStorag…
tkukuljan Dec 20, 2022
e6a15db
Cleanup.
tkukuljan Dec 20, 2022
a47ea06
Enhancements - reducing import string sizes.
tkukuljan Dec 20, 2022
8aadb7a
Optimizing data.
tkukuljan Dec 21, 2022
cbe9039
Merge branch 'develop' into moving_tests_to_engine
tkukuljan Dec 21, 2022
8eca198
Bug fix, and updating the data to the newest changes in the develop.
tkukuljan Dec 21, 2022
b4e8827
Merge branch 'develop' into moving_tests_to_engine
tkukuljan Jan 11, 2023
0218394
Merge remote-tracking branch 'origin/develop' into moving_tests_to_en…
tkukuljan Jan 11, 2023
f6e09ac
Merge branch 'develop' into moving_tests_to_engine
tkukuljan Jan 18, 2023
87307d6
Davide's feedback.
tkukuljan Jan 18, 2023
f33e832
More Davide's feedback.
tkukuljan Jan 18, 2023
a61cde9
Merge branch 'develop' into moving_tests_to_engine
tkukuljan Jan 23, 2023
8f4f3c1
Importing entire ProjectionConfiguration instead.
tkukuljan Jan 23, 2023
4f920c4
Merge branch 'develop' into moving_tests_to_engine
tkukuljan Jan 23, 2023
a7c8bb2
Proper import of the CE
tkukuljan Jan 23, 2023
a4c1c07
Solving an issue with yield curve changes.
tkukuljan Jan 23, 2023
0b788c9
better way of solving the issue with the yield curve change.
tkukuljan Jan 23, 2023
c847454
Removing commits, as the tests now run in memory.
tkukuljan Jan 23, 2023
d8b9e47
Merge branch 'develop' into moving_tests_to_engine
tkukuljan Jan 24, 2023
e0e6f19
Fixing a bugg in ReportStorageTest and making the tests run in the te…
tkukuljan Jan 25, 2023
1b27803
Fixing the amount types
tkukuljan Jan 25, 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
152 changes: 80 additions & 72 deletions ifrs17-template/Test/AocStructureTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{
"cell_type": "code",
"source": [
"#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\""
"#!import \"TestData\""
],
"metadata": {},
"execution_count": 0,
Expand All @@ -47,18 +47,50 @@
{
"cell_type": "code",
"source": [
"Workspace.Initialize(x => x.FromSource(DataSource)",
"\n .DisableInitialization<RawVariable>()",
"\n .DisableInitialization<IfrsVariable>());"
"await DataSource.SetAsync();",
"\nDataSource.Reset(x => x.ResetCurrentPartitions());"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"cell_type": "code",
"source": [
"# Test"
"await Import.FromString(novelties).WithType<Novelty>().WithTarget(DataSource).ExecuteAsync();",
"\nawait Import.FromString(canonicalAocTypes).WithType<AocType>().WithTarget(DataSource).ExecuteAsync();",
"\nawait Import.FromString(canonicalAocConfig).WithFormat(ImportFormats.AocConfiguration).WithTarget(DataSource).ExecuteAsync();"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"await DataSource.UpdateAsync<Portfolio>(dt1.RepeatOnce());",
"\nawait DataSource.UpdateAsync<Portfolio>(dtr1.RepeatOnce());",
"\nawait DataSource.UpdateAsync<GroupOfInsuranceContract>(new [] {dt11});",
"\nawait DataSource.UpdateAsync<GroupOfReinsuranceContract>(new [] {dtr11});"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"await DataSource.UpdateAsync(new [ ] {dt11State,dtr11State});",
"\nawait DataSource.UpdateAsync(new [ ] {dt11Inter});"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"await Import.FromString(estimateType).WithType<EstimateType>().WithTarget(DataSource).ExecuteAsync();"
],
"metadata": {},
"execution_count": 0,
Expand All @@ -67,8 +99,7 @@
{
"cell_type": "code",
"source": [
"var reportingNode = \"CH\";",
"\nvar scenario = (string)null;"
"await DataSource.UpdateAsync(new [ ] {yieldCurvePrevious});"
],
"metadata": {},
"execution_count": 0,
Expand All @@ -77,15 +108,26 @@
{
"cell_type": "code",
"source": [
"//Define partition",
"\nvar args = new ImportArgs(reportingNode, 2021, 3, Periodicity.Quarterly, scenario, ImportFormats.Actual);",
"\nvar partition = new PartitionByReportingNodeAndPeriod { Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync<PartitionByReportingNode>(args)),",
"\n ReportingNode = reportingNode, ",
"\n Scenario = scenario, ",
"\n Year = args.Year,",
"\n Month = args.Month };",
"\nawait DataSource.UpdateAsync(new[]{partition});",
"\nawait DataSource.CommitAsync();"
"Workspace.Initialize(x => x.FromSource(DataSource).DisableInitialization<RawVariable>().DisableInitialization<IfrsVariable>());"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"await DataSource.UpdateAsync(new[]{partition, previousPeriodPartition});",
"\nawait DataSource.UpdateAsync(new[]{partitionReportingNode});"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"# Test"
],
"metadata": {},
"execution_count": 0,
Expand Down Expand Up @@ -259,24 +301,15 @@
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"var groupOfContract = \"DT1.1\";"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"var inputRawVariables = new RawVariable[]{",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"BOP\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"MC\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"BOP\", Novelty = \"N\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"EV\", Novelty = \"N\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"CL\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfInsuranceContracts, AocType = \"BOP\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfInsuranceContracts, AocType = \"MC\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfInsuranceContracts, AocType = \"BOP\", Novelty = \"N\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfInsuranceContracts, AocType = \"EV\", Novelty = \"N\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfInsuranceContracts, AocType = \"CL\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n};"
],
"metadata": {},
Expand Down Expand Up @@ -354,7 +387,9 @@
"\n new AocStep(\"EA\",\"C\"), new AocStep(\"AM\",\"C\"), new AocStep(\"CL\",\"C\"),",
"\n }},",
"\n //{new AocStep(\"CF\",\"C\"), Enumerable.Empty<AocStep>()},",
"\n };"
"\n };",
"\nvar activity = await CheckAocStepStructureAsync(inputRawVariables, parentBm, referenceBm, fullAocBm);",
"\nactivity"
],
"metadata": {},
"execution_count": 0,
Expand All @@ -363,7 +398,7 @@
{
"cell_type": "code",
"source": [
"await CheckAocStepStructureAsync(inputRawVariables, parentBm, referenceBm, fullAocBm)"
"activity.Status.Should().Be(ActivityLogStatus.Succeeded);"
],
"metadata": {},
"execution_count": 0,
Expand All @@ -378,24 +413,15 @@
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"groupOfContract = \"DTR1.1\";"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"inputRawVariables = new RawVariable[]{",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"BOP\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"MC\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"BOP\", Novelty = \"N\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"EV\", Novelty = \"N\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"CL\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfReinsuranceContracts, AocType = \"BOP\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfReinsuranceContracts, AocType = \"MC\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfReinsuranceContracts, AocType = \"BOP\", Novelty = \"N\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfReinsuranceContracts, AocType = \"EV\", Novelty = \"N\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfReinsuranceContracts, AocType = \"CL\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n};"
],
"metadata": {},
Expand Down Expand Up @@ -529,22 +555,13 @@
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"var groupOfContract = \"DT1.1\";"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"inputRawVariables = new RawVariable[]{",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"BOP\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"MC\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"CL\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfInsuranceContracts, AocType = \"BOP\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfInsuranceContracts, AocType = \"MC\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfInsuranceContracts, AocType = \"CL\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},",
"\n};"
],
"metadata": {},
Expand Down Expand Up @@ -641,23 +658,14 @@
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"var groupOfContract = \"DT1.1\";"
],
"metadata": {},
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"source": [
"var inputIfrsVariables = new IfrsVariable[]{",
"\n new IfrsVariable{Partition = partition.Id, Value = 1.0, DataNode = groupOfContract, AocType = \"BOP\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"AA\"},",
"\n new IfrsVariable{Partition = partition.Id, Value = 1.0, DataNode = groupOfContract, AocType = \"CF\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"AA\"},",
"\n new IfrsVariable{Partition = partition.Id, Value = 1.0, DataNode = groupOfContract, AocType = \"CF\", Novelty = \"C\", AccidentYear = null, AmountType = \"ACA\", EstimateType = \"A\"},",
"\n new IfrsVariable{Partition = partition.Id, Value = 1.0, DataNode = groupOfContract, AocType = \"WO\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"OA\"},",
"\n new IfrsVariable{Partition = partition.Id, Value = 1.0, DataNode = groupOfInsuranceContracts, AocType = \"BOP\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"AA\"},",
"\n new IfrsVariable{Partition = partition.Id, Value = 1.0, DataNode = groupOfInsuranceContracts, AocType = \"CF\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"AA\"},",
"\n new IfrsVariable{Partition = partition.Id, Value = 1.0, DataNode = groupOfInsuranceContracts, AocType = \"CF\", Novelty = \"C\", AccidentYear = null, AmountType = \"ACA\", EstimateType = \"A\"},",
"\n new IfrsVariable{Partition = partition.Id, Value = 1.0, DataNode = groupOfInsuranceContracts, AocType = \"WO\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"OA\"},",
"\n};"
],
"metadata": {},
Expand Down
Loading