From b5233d8f79acd128908ee8e2395e98c1db9d14ff Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Fri, 13 Jan 2023 16:36:22 +0100 Subject: [PATCH 1/4] GetAttributableExpenseAndCommissionAmountType --- ifrs17/Import/ImportStorage.ipynb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index bc20e709..2478b27d 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -382,8 +382,9 @@ "\n ", "\n // Other", "\n public IEnumerable GetNonAttributableAmountType() => new string[]{AmountTypes.NE};", - "\n public IEnumerable GetAttributableExpenseAndCommissionAmountType() => new string[] {AmountTypes.ACA, AmountTypes.AEA}; //U+ specific", - "\n public IEnumerable GetInvestmentClaims() => hierarchyCache.Get(AmountTypes.ICO).Descendants(includeSelf : true).Select(x => x.SystemName);", + "\n public IEnumerable GetAttributableExpenseAndCommissionAmountType() => hierarchyCache.Get(AmountTypes.ACA).Descendants(includeSelf : true).Select(x => x.SystemName) + .Concat(hierarchyCache.Get(AmountTypes.AEA).Descendants(includeSelf : true).Select(x => x.SystemName));", + "\n public IEnumerable GetInvestmentClaims() => hierarchyCache.Get(AmountTypes.ICO).Descendants(includeSelf : true).Select(x => x.SystemName);", "\n public IEnumerable GetPremiums() => hierarchyCache.Get(AmountTypes.PR).Descendants(includeSelf : true).Select(x => x.SystemName);", "\n public IEnumerable GetClaims() => hierarchyCache.Get(AmountTypes.CL).Descendants().Select(x => x.SystemName);", "\n}" From 22f21f6b54d4ce74a951fa5f77ce4d37a9dcce43 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Fri, 13 Jan 2023 17:31:26 +0100 Subject: [PATCH 2/4] fixing metadata --- ifrs17/Import/ImportStorage.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index 2478b27d..f6fca951 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -382,9 +382,9 @@ "\n ", "\n // Other", "\n public IEnumerable GetNonAttributableAmountType() => new string[]{AmountTypes.NE};", - "\n public IEnumerable GetAttributableExpenseAndCommissionAmountType() => hierarchyCache.Get(AmountTypes.ACA).Descendants(includeSelf : true).Select(x => x.SystemName) - .Concat(hierarchyCache.Get(AmountTypes.AEA).Descendants(includeSelf : true).Select(x => x.SystemName));", - "\n public IEnumerable GetInvestmentClaims() => hierarchyCache.Get(AmountTypes.ICO).Descendants(includeSelf : true).Select(x => x.SystemName);", + "\n public IEnumerable GetAttributableExpenseAndCommissionAmountType() => hierarchyCache.Get(AmountTypes.ACA).Descendants(includeSelf : true).Select(x => x.SystemName)", + "\n .Concat(hierarchyCache.Get(AmountTypes.AEA).Descendants(includeSelf : true).Select(x => x.SystemName));", + "\n public IEnumerable GetInvestmentClaims() => hierarchyCache.Get(AmountTypes.ICO).Descendants(includeSelf : true).Select(x => x.SystemName);", "\n public IEnumerable GetPremiums() => hierarchyCache.Get(AmountTypes.PR).Descendants(includeSelf : true).Select(x => x.SystemName);", "\n public IEnumerable GetClaims() => hierarchyCache.Get(AmountTypes.CL).Descendants().Select(x => x.SystemName);", "\n}" From 3763680f9aafd99b6cfcddaa9106e0dbec76db88 Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Sat, 14 Jan 2023 16:11:08 +0100 Subject: [PATCH 3/4] clean up parsed variable from disposable workspace before committing to workspaceToCompute --- ifrs17/Import/Importers.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 61ff5ebc..12ebab17 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -525,6 +525,7 @@ "\n ivs.Where(iv => Math.Abs(iv.Value) < Precision).Intersect(bestEstimateIvs, EqualityComparer.Instance).Select(iv => iv with {Value = 0.0}).ToArray());", "\n }", "\n", + "\n await workspace.DeleteAsync(await workspace.Query().ToArrayAsync()); //Clean parsed IfrsVariable", "\n await workspace.UpdateAsync(ivs.Where(x => storage.DefaultPartition != storage.TargetPartition || Math.Abs(x.Value) >= Precision));", "\n await workspace.CommitToAsync(workspaceToCompute, storage.TargetPartition, snapshot : true, ", "\n filter : x => storage.EstimateTypesByImportFormat[args.ImportFormat].Contains(x.EstimateType) ", From e694e6f1a6e42491aca632c26d03c562bda33c5a Mon Sep 17 00:00:00 2001 From: Davide Colleoni Date: Mon, 16 Jan 2023 11:27:45 +0100 Subject: [PATCH 4/4] improve efficiency reset instead of delete --- ifrs17/Import/Importers.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 12ebab17..f4737847 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -525,7 +525,7 @@ "\n ivs.Where(iv => Math.Abs(iv.Value) < Precision).Intersect(bestEstimateIvs, EqualityComparer.Instance).Select(iv => iv with {Value = 0.0}).ToArray());", "\n }", "\n", - "\n await workspace.DeleteAsync(await workspace.Query().ToArrayAsync()); //Clean parsed IfrsVariable", + "\n workspace.Reset(x => x.ResetType());", "\n await workspace.UpdateAsync(ivs.Where(x => storage.DefaultPartition != storage.TargetPartition || Math.Abs(x.Value) >= Precision));", "\n await workspace.CommitToAsync(workspaceToCompute, storage.TargetPartition, snapshot : true, ", "\n filter : x => storage.EstimateTypesByImportFormat[args.ImportFormat].Contains(x.EstimateType) ",