diff --git a/Import/ImportScopeCalculation.ipynb b/Import/ImportScopeCalculation.ipynb index 2823aead..9370c157 100644 --- a/Import/ImportScopeCalculation.ipynb +++ b/Import/ImportScopeCalculation.ipynb @@ -896,15 +896,15 @@ "id": "NX2BdeLNxk2VWROO8E5pBg", "cell_type": "code", "source": [ - "public interface PvBase : IWithGetValueFromValues", + "public interface PresentValue : IWithGetValueFromValues", "\n{ ", "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) =>", - "\n builder.ForScope(s => s.WithApplicability(x => x.GetStorage().ImportFormat != ImportFormats.Cashflow", + "\n builder.ForScope(s => s.WithApplicability(x => x.GetStorage().ImportFormat != ImportFormats.Cashflow", "\n || x.GetStorage().IsSecondaryScope(x.Identity.Id.DataNode))", - "\n .WithApplicability(x => (x.Identity.Id.AocType == AocTypes.BOP && x.Identity.Id.Novelty != Novelties.C) || x.Identity.Id.AocType == AocTypes.EOP)", + "\n .WithApplicability(x => (x.Identity.Id.AocType == AocTypes.BOP && x.Identity.Id.Novelty != Novelties.C) || x.Identity.Id.AocType == AocTypes.EOP)", "\n .WithApplicability(x => x.Identity.Id.AocType == AocTypes.CF)", - "\n .WithApplicability(x => x.Identity.Id.IsReinsurance && x.Identity.AmountType == AmountTypes.CDR && x.Identity.Id.AocType == AocTypes.IA)", - "\n .WithApplicability(x => x.Identity.Id.AocType == AocTypes.IA)", + "\n .WithApplicability(x => x.Identity.Id.IsReinsurance && x.Identity.AmountType == AmountTypes.CDR && x.Identity.Id.AocType == AocTypes.IA)", + "\n .WithApplicability(x => x.Identity.Id.AocType == AocTypes.IA)", "\n .WithApplicability(x => new string[]{AocTypes.BOP, AocTypes.EA, AocTypes.AM, AocTypes.RCU}.Contains(x.Identity.Id.AocType) ) //add here combination CRU for At !CDR?", "\n );", "\n ", @@ -917,40 +917,40 @@ "\n public double Value => GetValueFromValues(Values);", "\n}", "\n", - "\npublic interface ComputePvBaseWithIfrsVariable : PvBase", + "\npublic interface ComputePresentValueWithIfrsVariable : PresentValue", "\n{", - "\n double PvBase.Value => GetStorage().GetValue(Identity.Id, Identity.AmountType, Identity.CalculationType, EconomicBasis, Identity.AccidentYear); //unify CalculationType and EstimateTypeGet", - "\n double[] PvBase.Values => Enumerable.Empty().ToArray();", + "\n double PresentValue.Value => GetStorage().GetValue(Identity.Id, Identity.AmountType, Identity.CalculationType, EconomicBasis, Identity.AccidentYear); //unify CalculationType and EstimateTypeGet", + "\n double[] PresentValue.Values => Enumerable.Empty().ToArray();", "\n}", "\n", - "\npublic interface PvBaseFromDiscountedCashflow : PvBase", + "\npublic interface PresentValueFromDiscountedCashflow : PresentValue", "\n{", "\n [NotVisible]", - "\n double[] PvBase.Values => GetScope(Identity).Values;", + "\n double[] PresentValue.Values => GetScope(Identity).Values;", "\n}", "\n", - "\npublic interface CashflowAocStep : PvBase", + "\npublic interface CashflowAocStep : PresentValue", "\n{", "\n [NotVisible]", - "\n double[] PvBase.Values => -1d * GetScope(Identity).Values;", + "\n double[] PresentValue.Values => -1d * GetScope(Identity).Values;", "\n}", "\n", - "\npublic interface PvBaseWithInterestAccretion : PvBase, IWithInterestAccretion", + "\npublic interface PresentValueWithInterestAccretion : PresentValue, IWithInterestAccretion", "\n{", "\n [NotVisible]", - "\n double[] PvBase.Values => GetInterestAccretion();", + "\n double[] PresentValue.Values => GetInterestAccretion();", "\n}", "\n", - "\npublic interface PvBaseWithInterestAccretionForCreditRisk : PvBase, IWithInterestAccretionForCreditRisk", + "\npublic interface PresentValueWithInterestAccretionForCreditRisk : PresentValue, IWithInterestAccretionForCreditRisk", "\n{", "\n [NotVisible]", - "\n double[] PvBase.Values => GetInterestAccretion();", + "\n double[] PresentValue.Values => GetInterestAccretion();", "\n}", "\n", - "\npublic interface EmptyValuesAocStep : PvBase", + "\npublic interface EmptyValuesAocStep : PresentValue", "\n{", "\n [NotVisible]", - "\n double[] PvBase.Values => Enumerable.Empty().ToArray();", + "\n double[] PresentValue.Values => Enumerable.Empty().ToArray();", "\n}" ], "metadata": {}, @@ -1014,9 +1014,9 @@ "\n private int?[] accidentYears => GetStorage().GetAccidentYears(Identity.DataNode).ToArray(); ", "\n ", "\n [NotVisible]", - "\n PvBase[] PresentValues => GetScope(Identity.DataNode).BeAmountTypes", + "\n PresentValue[] PresentValues => GetScope(Identity.DataNode).BeAmountTypes", "\n .SelectMany(at => accidentYears", - "\n .Select(ay => GetScope((Identity, at, CalculationType, ay), o => o.WithContext(EconomicBasis))))", + "\n .Select(ay => GetScope((Identity, at, CalculationType, ay), o => o.WithContext(EconomicBasis))))", "\n .ToArray();", "\n double Value => PresentValues.Aggregate().Value;", "\n}", @@ -1032,9 +1032,9 @@ "\n private int?[] accidentYears => GetStorage().GetAccidentYears(Identity.DataNode).ToArray();", "\n ", "\n [NotVisible]", - "\n PvBase[] PresentValues => GetScope(Identity.DataNode).BeAmountTypes", + "\n PresentValue[] PresentValues => GetScope(Identity.DataNode).BeAmountTypes", "\n .SelectMany(at => accidentYears", - "\n .Select(ay => GetScope((Identity, at, CalculationType, ay), o => o.WithContext(EconomicBasis))))", + "\n .Select(ay => GetScope((Identity, at, CalculationType, ay), o => o.WithContext(EconomicBasis))))", "\n .ToArray();", "\n ", "\n double Value => PresentValues.Aggregate().Value;", @@ -1079,7 +1079,7 @@ "\n ", "\n private int?[] accidentYears => GetStorage().GetAccidentYears(Identity.DataNode).ToArray(); ", "\n ", - "\n PvBase[] PresentValues => accidentYears.Select(ay => GetScope((Identity, (string)null, CalculationType, ay), o => o.WithContext(EconomicBasis))).ToArray();", + "\n PresentValue[] PresentValues => accidentYears.Select(ay => GetScope((Identity, (string)null, CalculationType, ay), o => o.WithContext(EconomicBasis))).ToArray();", "\n ", "\n double Value => PresentValues.Aggregate().Value;", "\n}", @@ -1093,7 +1093,7 @@ "\n ", "\n private int?[] accidentYears => GetStorage().GetAccidentYears(Identity.DataNode).ToArray(); ", "\n ", - "\n PvBase[] PresentValues => accidentYears.Select(ay => GetScope((Identity, (string)null, CalculationType, ay), o => o.WithContext(EconomicBasis))).ToArray(); ", + "\n PresentValue[] PresentValues => accidentYears.Select(ay => GetScope((Identity, (string)null, CalculationType, ay), o => o.WithContext(EconomicBasis))).ToArray(); ", "\n ", "\n double Value => PresentValues.Aggregate().Value;", "\n}" @@ -1580,12 +1580,12 @@ "\n string EstimateType => EstimateTypes.BEPA;", "\n string EconomicBasis => EconomicBases.L;", "\n ", - "\n PvBase[] ByAmountType => GetStorage().GetPremiums().Select(pr => GetStorage().GetPremiumAllocationFactor(Identity) * GetScope((Identity, pr, EstimateTypes.BE, (int?)null), o => o.WithContext(EconomicBasis))).ToArray(); ", + "\n PresentValue[] ByAmountType => GetStorage().GetPremiums().Select(pr => GetStorage().GetPremiumAllocationFactor(Identity) * GetScope((Identity, pr, EstimateTypes.BE, (int?)null), o => o.WithContext(EconomicBasis))).ToArray(); ", "\n}", "\n", "\npublic interface DefaultValueBeExperienceAdjustmentForPremium : BeExperienceAdjustmentForPremium", "\n{", - "\n PvBase[] BeExperienceAdjustmentForPremium.ByAmountType => Enumerable.Empty().ToArray();", + "\n PresentValue[] BeExperienceAdjustmentForPremium.ByAmountType => Enumerable.Empty().ToArray();", "\n}" ], "metadata": {}, @@ -1702,7 +1702,7 @@ "\n ", "\n double Value => GetScope(Identity.DataNode).BeAmountTypes", "\n .Except(GetStorage().GetNonAttributableAmountType())", - "\n .Sum(at => GetScope((Identity, at, CalculationTypes.BE, (int?)null), o => o.WithContext(EconomicBasis)).Value) +", + "\n .Sum(at => GetScope((Identity, at, CalculationTypes.BE, (int?)null), o => o.WithContext(EconomicBasis)).Value) +", "\n GetScope(Identity).Value;", "\n ", "\n double AggregatedValue => GetScope((Identity, InputSource.Cashflow)).Values", @@ -1755,12 +1755,12 @@ "\n ", "\n private double attributableExpenseAndCommissions => GetStorage().GetAttributableExpenseAndCommissionAmountType().Sum(d =>", "\n GetStorage().GetNovelties(referenceAocType, InputSource.Cashflow)", - "\n .Sum(n => GetScope((Identity with {AocType = referenceAocType, Novelty = n}, d, CalculationTypes.BE, (int?)null), o => o.WithContext(EconomicBasis)).Value) -", + "\n .Sum(n => GetScope((Identity with {AocType = referenceAocType, Novelty = n}, d, CalculationTypes.BE, (int?)null), o => o.WithContext(EconomicBasis)).Value) -", "\n GetScope((Identity with {AocType = referenceAocType, Novelty = Novelties.C}, d, EstimateTypes.A, (int?)null)).Value);", "\n", "\n private double investmentClaims => GetStorage().GetInvestmentClaims().Sum(ic =>", "\n GetStorage().GetNovelties(referenceAocType, InputSource.Cashflow)", - "\n .Sum(n => GetScope((Identity with {AocType = referenceAocType, Novelty = n}, ic, CalculationTypes.BE, (int?)null), o => o.WithContext(EconomicBasis)).Value) -", + "\n .Sum(n => GetScope((Identity with {AocType = referenceAocType, Novelty = n}, ic, CalculationTypes.BE, (int?)null), o => o.WithContext(EconomicBasis)).Value) -", "\n GetScope((Identity with {AocType = referenceAocType, Novelty = Novelties.C}, ic, EstimateTypes.A, (int?)null)).Value - ", "\n GetScope((Identity with {AocType = referenceAocType, Novelty = Novelties.C}, ic, EstimateTypes.AA, (int?)null)).Value -", "\n GetScope((Identity with {AocType = referenceAocType, Novelty = Novelties.C}, ic, EstimateTypes.OA, (int?)null)).Value);", diff --git a/Test/SpecificationsImportCashflows.ipynb b/Test/SpecificationsImportCashflows.ipynb index ad03bfe5..27b2e084 100644 --- a/Test/SpecificationsImportCashflows.ipynb +++ b/Test/SpecificationsImportCashflows.ipynb @@ -1296,8 +1296,8 @@ "id": "-_jk2YKNT0u7l9uCTrc18w", "cell_type": "code", "source": [ - "var computedPvBaseBoP_PR = Test.GetScope((idBoP, \"PR\", \"BE\", (int?)null));", - "\ncomputedPvBaseBoP_PR" + "var computedPresentValueBoP_PR = Test.GetScope((idBoP, \"PR\", \"BE\", (int?)null));", + "\ncomputedPresentValueBoP_PR" ], "metadata": {}, "execution_count": 1, @@ -1326,7 +1326,7 @@ "id": "he2CNq7s20a2kIAEI1Ew5A", "cell_type": "code", "source": [ - "var expectedPvBaseBoP_PR = discountedBoP_PR.Values;" + "var expectedPresentValueBoP_PR = discountedBoP_PR.Values;" ], "metadata": {}, "execution_count": 1, @@ -1344,7 +1344,7 @@ "id": "E_a4AaUiYU-qVqiFMH4Ffg", "cell_type": "code", "source": [ - "computedPvBaseBoP_PR.Values.CheckEquality( expectedPvBaseBoP_PR )" + "computedPresentValueBoP_PR.Values.CheckEquality( expectedPresentValueBoP_PR )" ], "metadata": {}, "execution_count": 1, @@ -1354,7 +1354,7 @@ "id": "USXwqdZpmEOlDJdxqDBZaA", "cell_type": "code", "source": [ - "computedPvBaseBoP_PR.Values.CheckEquality( expectedPvBaseBoP_PR ).Should().Be(true);" + "computedPresentValueBoP_PR.Values.CheckEquality( expectedPresentValueBoP_PR ).Should().Be(true);" ], "metadata": {}, "execution_count": 1, @@ -1392,8 +1392,8 @@ "id": "nvbs4pu8Sk-fnfw1MqBJEQ", "cell_type": "code", "source": [ - "var computedPvBaseMC_PR = Test.GetScope((idMC, \"PR\", \"BE\", (int?)null));", - "\ncomputedPvBaseMC_PR" + "var computedPresentValueMC_PR = Test.GetScope((idMC, \"PR\", \"BE\", (int?)null));", + "\ncomputedPresentValueMC_PR" ], "metadata": {}, "execution_count": 1, @@ -1432,7 +1432,7 @@ "id": "pqOSCzCTJEyNauxM07RTvg", "cell_type": "code", "source": [ - "var expectedPvBaseMC_PR = discountedMC_PR.Values - discountedBoP_PR.Values;" + "var expectedPresentValueMC_PR = discountedMC_PR.Values - discountedBoP_PR.Values;" ], "metadata": {}, "execution_count": 1, @@ -1450,7 +1450,7 @@ "id": "WOMu6tnVOEWiRZqaziMRcg", "cell_type": "code", "source": [ - "computedPvBaseMC_PR.Values.CheckEquality( expectedPvBaseMC_PR )" + "computedPresentValueMC_PR.Values.CheckEquality( expectedPresentValueMC_PR )" ], "metadata": {}, "execution_count": 1, @@ -1460,7 +1460,7 @@ "id": "TvZ78p6vLkCL-xejOqvUcw", "cell_type": "code", "source": [ - "computedPvBaseMC_PR.Value == expectedPvBaseMC_PR[0]" + "computedPresentValueMC_PR.Value == expectedPresentValueMC_PR[0]" ], "metadata": {}, "execution_count": 1, @@ -1470,7 +1470,7 @@ "id": "w9D4tVGk5UmDB-tTCeS5Rw", "cell_type": "code", "source": [ - "computedPvBaseMC_PR.Values.CheckEquality( expectedPvBaseMC_PR ).Should().Be(true);" + "computedPresentValueMC_PR.Values.CheckEquality( expectedPresentValueMC_PR ).Should().Be(true);" ], "metadata": {}, "execution_count": 1, @@ -1480,7 +1480,7 @@ "id": "nnvwi_zKy0ebrac1nrqanQ", "cell_type": "code", "source": [ - "computedPvBaseMC_PR.Value.Should().Be( expectedPvBaseMC_PR[0] );" + "computedPresentValueMC_PR.Value.Should().Be( expectedPresentValueMC_PR[0] );" ], "metadata": {}, "execution_count": 1, @@ -1517,8 +1517,8 @@ "id": "5sLKCaklikuTAXBf9hAoGQ", "cell_type": "code", "source": [ - "var computedPvBaseCF_PR = Test.GetScope((idCF, \"PR\", \"BE\", (int?)null));", - "\ncomputedPvBaseCF_PR" + "var computedPresentValueCF_PR = Test.GetScope((idCF, \"PR\", \"BE\", (int?)null));", + "\ncomputedPresentValueCF_PR" ], "metadata": {}, "execution_count": 1, @@ -1558,7 +1558,7 @@ "id": "YSGvWpZAgk676PWkouVFvg", "cell_type": "code", "source": [ - "var expectedPvBaseCF_PR = -1.0 * cfNominalReference_PR.Values;" + "var expectedPresentValueCF_PR = -1.0 * cfNominalReference_PR.Values;" ], "metadata": {}, "execution_count": 1, @@ -1576,7 +1576,7 @@ "id": "mlrKZMMExkOXb_z-QA-nzQ", "cell_type": "code", "source": [ - "computedPvBaseCF_PR.Values.CheckEquality( expectedPvBaseCF_PR )" + "computedPresentValueCF_PR.Values.CheckEquality( expectedPresentValueCF_PR )" ], "metadata": {}, "execution_count": 1, @@ -1586,7 +1586,7 @@ "id": "_iXoBI2Ra06t95Lv-UKmdQ", "cell_type": "code", "source": [ - "computedPvBaseCF_PR.Values[0] + computedPvBaseCF_PR.Values[1] + computedPvBaseCF_PR.Values[2] == computedPvBaseCF_PR.Value" + "computedPresentValueCF_PR.Values[0] + computedPresentValueCF_PR.Values[1] + computedPresentValueCF_PR.Values[2] == computedPresentValueCF_PR.Value" ], "metadata": {}, "execution_count": 1, @@ -1596,7 +1596,7 @@ "id": "QWPx_7NUmEyE5Xu_kEeyjg", "cell_type": "code", "source": [ - "computedPvBaseCF_PR.Values.CheckEquality( expectedPvBaseCF_PR ).Should().Be(true);" + "computedPresentValueCF_PR.Values.CheckEquality( expectedPresentValueCF_PR ).Should().Be(true);" ], "metadata": {}, "execution_count": 1, @@ -1606,7 +1606,7 @@ "id": "MSbSF0-9w0-iu_c3cNINjA", "cell_type": "code", "source": [ - "computedPvBaseCF_PR.Value.Should().Be( computedPvBaseCF_PR.Values[0] + computedPvBaseCF_PR.Values[1] + computedPvBaseCF_PR.Values[2] );" + "computedPresentValueCF_PR.Value.Should().Be( computedPresentValueCF_PR.Values[0] + computedPresentValueCF_PR.Values[1] + computedPresentValueCF_PR.Values[2] );" ], "metadata": {}, "execution_count": 1, @@ -1675,8 +1675,8 @@ "id": "ZiyHW9AJqEqeFgbYLv9FQA", "cell_type": "code", "source": [ - "var computedPvBaseIA_PR = Test.GetScope((idIA, \"PR\", \"BE\", (int?)null));", - "\ncomputedPvBaseIA_PR" + "var computedPresentValueIA_PR = Test.GetScope((idIA, \"PR\", \"BE\", (int?)null));", + "\ncomputedPresentValueIA_PR" ], "metadata": {}, "execution_count": 1, @@ -1738,7 +1738,7 @@ "id": "b-s6yRRvEUeLF_z6-rD7lw", "cell_type": "code", "source": [ - "var expectedPvBaseIA_PR = discountedIaReference_PR.Values.Select((val, index) => ( val - nominalIaReference_PR.Values[index]) * ( iaComputedMonthlyRates.Interest.GetValidElement(index/12) -1));" + "var expectedPresentValueIA_PR = discountedIaReference_PR.Values.Select((val, index) => ( val - nominalIaReference_PR.Values[index]) * ( iaComputedMonthlyRates.Interest.GetValidElement(index/12) -1));" ], "metadata": {}, "execution_count": 1, @@ -1756,7 +1756,7 @@ "id": "2R1QDTLoAkSYgN3VL0pXxg", "cell_type": "code", "source": [ - "computedPvBaseIA_PR.Values.CheckEquality( expectedPvBaseIA_PR )" + "computedPresentValueIA_PR.Values.CheckEquality( expectedPresentValueIA_PR )" ], "metadata": {}, "execution_count": 1, @@ -1766,7 +1766,7 @@ "id": "ioWKmAEOBk6ly7qdPm8UcQ", "cell_type": "code", "source": [ - "computedPvBaseIA_PR.Values[0] + computedPvBaseIA_PR.Values[1] + computedPvBaseIA_PR.Values[2] == computedPvBaseIA_PR.Value" + "computedPresentValueIA_PR.Values[0] + computedPresentValueIA_PR.Values[1] + computedPresentValueIA_PR.Values[2] == computedPresentValueIA_PR.Value" ], "metadata": {}, "execution_count": 1, @@ -1776,7 +1776,7 @@ "id": "lLcVd6QU_E-CV-zx6UKKyw", "cell_type": "code", "source": [ - "computedPvBaseIA_PR.Values.CheckEquality( expectedPvBaseIA_PR ).Should().Be(true);" + "computedPresentValueIA_PR.Values.CheckEquality( expectedPresentValueIA_PR ).Should().Be(true);" ], "metadata": {}, "execution_count": 1, @@ -1786,7 +1786,7 @@ "id": "nksstSVXV0KMKV3s1Qzbjw", "cell_type": "code", "source": [ - "computedPvBaseIA_PR.Value.Should().Be( computedPvBaseIA_PR.Values[0] + computedPvBaseIA_PR.Values[1] + computedPvBaseIA_PR.Values[2] );" + "computedPresentValueIA_PR.Value.Should().Be( computedPresentValueIA_PR.Values[0] + computedPresentValueIA_PR.Values[1] + computedPresentValueIA_PR.Values[2] );" ], "metadata": {}, "execution_count": 1, @@ -1812,8 +1812,8 @@ "id": "1sPIRjZ290ekFi_RcQIo0g", "cell_type": "code", "source": [ - "var computedPvBaseIA_NIC = Test.GetScope((idIA, \"NIC\", \"BE\", (int?)null));", - "\ncomputedPvBaseIA_NIC" + "var computedPresentValueIA_NIC = Test.GetScope((idIA, \"NIC\", \"BE\", (int?)null));", + "\ncomputedPresentValueIA_NIC" ], "metadata": {}, "execution_count": 1, @@ -1853,7 +1853,7 @@ "id": "CeJcWORR1USjRX0vRrD9uw", "cell_type": "code", "source": [ - "var expectedPvBaseIA_NIC = discountedIaReference_NIC.Values.Select((val, index) => val * ( iaComputedMonthlyRates.Interest.GetValidElement(index/12) -1));" + "var expectedPresentValueIA_NIC = discountedIaReference_NIC.Values.Select((val, index) => val * ( iaComputedMonthlyRates.Interest.GetValidElement(index/12) -1));" ], "metadata": {}, "execution_count": 1, @@ -1871,7 +1871,7 @@ "id": "hiB4BkoAvUWvG3yaH-lUgg", "cell_type": "code", "source": [ - "computedPvBaseIA_NIC.Values.CheckEquality( expectedPvBaseIA_NIC )" + "computedPresentValueIA_NIC.Values.CheckEquality( expectedPresentValueIA_NIC )" ], "metadata": {}, "execution_count": 1, @@ -1881,7 +1881,7 @@ "id": "FAOKIDlrpEiY95BXbRJ9Lg", "cell_type": "code", "source": [ - "computedPvBaseIA_NIC.Values[0] + computedPvBaseIA_NIC.Values[1] + computedPvBaseIA_NIC.Values[2] == computedPvBaseIA_NIC.Value" + "computedPresentValueIA_NIC.Values[0] + computedPresentValueIA_NIC.Values[1] + computedPresentValueIA_NIC.Values[2] == computedPresentValueIA_NIC.Value" ], "metadata": {}, "execution_count": 1, @@ -1891,7 +1891,7 @@ "id": "3XieKhmULE2hpsAGvEz6Jw", "cell_type": "code", "source": [ - "computedPvBaseIA_NIC.Values.CheckEquality( expectedPvBaseIA_NIC ).Should().Be(true);" + "computedPresentValueIA_NIC.Values.CheckEquality( expectedPresentValueIA_NIC ).Should().Be(true);" ], "metadata": {}, "execution_count": 1, @@ -1901,7 +1901,7 @@ "id": "7eg7INUm50qXDWFveCVSJA", "cell_type": "code", "source": [ - "computedPvBaseIA_NIC.Value.Should().Be( computedPvBaseIA_NIC.Values[0] + computedPvBaseIA_NIC.Values[1] + computedPvBaseIA_NIC.Values[2] );" + "computedPresentValueIA_NIC.Value.Should().Be( computedPresentValueIA_NIC.Values[0] + computedPresentValueIA_NIC.Values[1] + computedPresentValueIA_NIC.Values[2] );" ], "metadata": {}, "execution_count": 1, @@ -1938,8 +1938,8 @@ "id": "ZtcMBnMzIkCuhjXxj25VQA", "cell_type": "code", "source": [ - "var computedPvBaseYCU_PR = Test.GetScope((idYcu, \"PR\", \"BE\", (int?)null));", - "\ncomputedPvBaseYCU_PR" + "var computedPresentValueYCU_PR = Test.GetScope((idYcu, \"PR\", \"BE\", (int?)null));", + "\ncomputedPresentValueYCU_PR" ], "metadata": {}, "execution_count": 1, @@ -2053,7 +2053,7 @@ "id": "-nB_BwXaFUSg1RGG9OtRWQ", "cell_type": "code", "source": [ - "var expectedPvBaseYCU_PR = ycReferenceDiscountedEop - discountedYcParent.Values;" + "var expectedPresentValueYCU_PR = ycReferenceDiscountedEop - discountedYcParent.Values;" ], "metadata": {}, "execution_count": 1, @@ -2063,7 +2063,7 @@ "id": "oqAvk5VK906PkRkAT2OaRg", "cell_type": "code", "source": [ - "computedPvBaseYCU_PR.Values.CheckEquality( expectedPvBaseYCU_PR )" + "computedPresentValueYCU_PR.Values.CheckEquality( expectedPresentValueYCU_PR )" ], "metadata": {}, "execution_count": 1, @@ -2073,7 +2073,7 @@ "id": "tUv9lq_VLEqCkXFKJJuQig", "cell_type": "code", "source": [ - "computedPvBaseYCU_PR.Value == expectedPvBaseYCU_PR[3]" + "computedPresentValueYCU_PR.Value == expectedPresentValueYCU_PR[3]" ], "metadata": {}, "execution_count": 1, @@ -2083,7 +2083,7 @@ "id": "m4ee2o2DZ0aKf2FH92STsw", "cell_type": "code", "source": [ - "computedPvBaseYCU_PR.Values.CheckEquality( expectedPvBaseYCU_PR ).Should().Be(true);" + "computedPresentValueYCU_PR.Values.CheckEquality( expectedPresentValueYCU_PR ).Should().Be(true);" ], "metadata": {}, "execution_count": 1, @@ -2093,7 +2093,7 @@ "id": "kA0wrkGJaUG-mcZFz8IYPw", "cell_type": "code", "source": [ - "computedPvBaseYCU_PR.Value.Should().Be( expectedPvBaseYCU_PR[3] );" + "computedPresentValueYCU_PR.Value.Should().Be( expectedPresentValueYCU_PR[3] );" ], "metadata": {}, "execution_count": 1, @@ -2138,8 +2138,8 @@ "id": "77exgwl5wUefPwQGSvv_nA", "cell_type": "code", "source": [ - "var computedPvBaseCRU = Test.GetScope((idCru, \"CDR\", \"BE\", (int?)null));", - "\ncomputedPvBaseCRU" + "var computedPresentValueCRU = Test.GetScope((idCru, \"CDR\", \"BE\", (int?)null));", + "\ncomputedPresentValueCRU" ], "metadata": {}, "execution_count": 1, @@ -2280,7 +2280,7 @@ "id": "f8a9p87_WUCugmBsw0E4sA", "cell_type": "code", "source": [ - "var expectedPvBaseCRU = cruExpectedDiscountedCDR - discountedCruParent.Values;" + "var expectedPresentValueCRU = cruExpectedDiscountedCDR - discountedCruParent.Values;" ], "metadata": {}, "execution_count": 1, @@ -2290,7 +2290,7 @@ "id": "7odSeJ5RTUmTR32M-5tlAA", "cell_type": "code", "source": [ - "computedPvBaseCRU.Values.CheckEquality( expectedPvBaseCRU )" + "computedPresentValueCRU.Values.CheckEquality( expectedPresentValueCRU )" ], "metadata": {}, "execution_count": 1, @@ -2300,7 +2300,7 @@ "id": "ojtYz8I9xkaTA1AcV3U1Cw", "cell_type": "code", "source": [ - "computedPvBaseCRU.Value == expectedPvBaseCRU[3]" + "computedPresentValueCRU.Value == expectedPresentValueCRU[3]" ], "metadata": {}, "execution_count": 1, @@ -2310,7 +2310,7 @@ "id": "WH8Cl5EMp0ewbK4iQ7-W3A", "cell_type": "code", "source": [ - "computedPvBaseCRU.Values.CheckEquality( expectedPvBaseCRU ).Should().Be(true);" + "computedPresentValueCRU.Values.CheckEquality( expectedPresentValueCRU ).Should().Be(true);" ], "metadata": {}, "execution_count": 1, @@ -2320,7 +2320,7 @@ "id": "-4irtBVO70uLS-mVjr-3jQ", "cell_type": "code", "source": [ - "computedPvBaseCRU.Value.Should().Be( expectedPvBaseCRU[3] );" + "computedPresentValueCRU.Value.Should().Be( expectedPresentValueCRU[3] );" ], "metadata": {}, "execution_count": 1, @@ -2357,8 +2357,8 @@ "id": "RxytwcSRIEOh4gnpLjM-6A", "cell_type": "code", "source": [ - "var computedPvBaseCL_PR = Test.GetScope((idCL, \"PR\", \"BE\", (int?)null));", - "\ncomputedPvBaseCL_PR" + "var computedPresentValueCL_PR = Test.GetScope((idCL, \"PR\", \"BE\", (int?)null));", + "\ncomputedPresentValueCL_PR" ], "metadata": {}, "execution_count": 1, @@ -2387,7 +2387,7 @@ "id": "o7Xu2o42K0SylUpXrn5bIw", "cell_type": "code", "source": [ - "var expectedPvBaseCL_PR = Test.GetScope((idCL, \"PR\", \"BE\", (int?)null)).Values -", + "var expectedPresentValueCL_PR = Test.GetScope((idCL, \"PR\", \"BE\", (int?)null)).Values -", "\n clParents.Select(aocStep => Test.GetScope((idCL with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}, \"PR\", \"BE\", (int?)null)).Values).Aggregate();" ], "metadata": {}, @@ -2406,7 +2406,7 @@ "id": "mJ3zeyh3YUSL7myhsdowKg", "cell_type": "code", "source": [ - "computedPvBaseCL_PR.Values.CheckEquality( expectedPvBaseCL_PR )" + "computedPresentValueCL_PR.Values.CheckEquality( expectedPresentValueCL_PR )" ], "metadata": {}, "execution_count": 1, @@ -2416,7 +2416,7 @@ "id": "t8dZLcMcYEiQaGohNjbhbw", "cell_type": "code", "source": [ - "computedPvBaseCL_PR.Value == expectedPvBaseCL_PR[3]" + "computedPresentValueCL_PR.Value == expectedPresentValueCL_PR[3]" ], "metadata": {}, "execution_count": 1, @@ -2426,7 +2426,7 @@ "id": "CG2NuOh-OUWD0O9KjUlTKg", "cell_type": "code", "source": [ - "computedPvBaseCL_PR.Values.CheckEquality( expectedPvBaseCL_PR ).Should().Be(true);" + "computedPresentValueCL_PR.Values.CheckEquality( expectedPresentValueCL_PR ).Should().Be(true);" ], "metadata": {}, "execution_count": 1, @@ -2436,7 +2436,7 @@ "id": "FNsLWW7W6UmZwW_agz-FbQ", "cell_type": "code", "source": [ - "computedPvBaseCL_PR.Value.Should().Be( expectedPvBaseCL_PR[3] );" + "computedPresentValueCL_PR.Value.Should().Be( expectedPresentValueCL_PR[3] );" ], "metadata": {}, "execution_count": 1, @@ -2473,8 +2473,8 @@ "id": "s86AHJ-4Pk6Va461mh5gBQ", "cell_type": "code", "source": [ - "var computedPvBaseEOP_NIC = Test.GetScope((idEOP, \"NIC\", \"BE\", (int?)null));", - "\ncomputedPvBaseEOP_NIC" + "var computedPresentValueEOP_NIC = Test.GetScope((idEOP, \"NIC\", \"BE\", (int?)null));", + "\ncomputedPresentValueEOP_NIC" ], "metadata": {}, "execution_count": 1, @@ -2514,7 +2514,7 @@ "id": "TgfGcomxyEu_Bi31dr0a8Q", "cell_type": "code", "source": [ - "var expectedPvBaseEOP_NIC = discountedCL_NIC.Values;" + "var expectedPresentValueEOP_NIC = discountedCL_NIC.Values;" ], "metadata": {}, "execution_count": 1, @@ -2532,7 +2532,7 @@ "id": "uHz3FD5pz0KtlPWvehPSTw", "cell_type": "code", "source": [ - "computedPvBaseEOP_NIC.Values.CheckEquality( expectedPvBaseEOP_NIC )" + "computedPresentValueEOP_NIC.Values.CheckEquality( expectedPresentValueEOP_NIC )" ], "metadata": {}, "execution_count": 1, @@ -2542,7 +2542,7 @@ "id": "NgccZKROIUGyHphm6Pt3mA", "cell_type": "code", "source": [ - "computedPvBaseEOP_NIC.Value == expectedPvBaseEOP_NIC[3]" + "computedPresentValueEOP_NIC.Value == expectedPresentValueEOP_NIC[3]" ], "metadata": {}, "execution_count": 1, @@ -2552,7 +2552,7 @@ "id": "9jo2Z3ljfkyeYFEYk8YevQ", "cell_type": "code", "source": [ - "computedPvBaseEOP_NIC.Values.CheckEquality( expectedPvBaseEOP_NIC ).Should().Be(true);" + "computedPresentValueEOP_NIC.Values.CheckEquality( expectedPresentValueEOP_NIC ).Should().Be(true);" ], "metadata": {}, "execution_count": 1, @@ -2562,7 +2562,7 @@ "id": "wQEKDnBmiEiCcxaQ5z8n_Q", "cell_type": "code", "source": [ - "computedPvBaseEOP_NIC.Value.Should().Be( expectedPvBaseEOP_NIC[3] );" + "computedPresentValueEOP_NIC.Value.Should().Be( expectedPresentValueEOP_NIC[3] );" ], "metadata": {}, "execution_count": 1, @@ -2607,8 +2607,8 @@ "id": "Hbvbc_-ghkCPuBcY4CaNSw", "cell_type": "code", "source": [ - "var computedPvBaseAM_PR = Test.GetScope((idAM, \"PR\", \"BE\", (int?)null));", - "\ncomputedPvBaseAM_PR" + "var computedPresentValueAM_PR = Test.GetScope((idAM, \"PR\", \"BE\", (int?)null));", + "\ncomputedPresentValueAM_PR" ], "metadata": {}, "execution_count": 1, @@ -2618,8 +2618,8 @@ "id": "vtA_SwM1FkWUvn7cz_gsEg", "cell_type": "code", "source": [ - "var computedPvBaseAM_PR = Test.GetScope((idAM, \"NIC\", \"BE\", (int?)null));", - "\ncomputedPvBaseAM_PR" + "var computedPresentValueAM_PR = Test.GetScope((idAM, \"NIC\", \"BE\", (int?)null));", + "\ncomputedPresentValueAM_PR" ], "metadata": {}, "execution_count": 1, diff --git a/Test/SpecificationsSetup.ipynb b/Test/SpecificationsSetup.ipynb index 8fdfb7ae..96e7025a 100644 --- a/Test/SpecificationsSetup.ipynb +++ b/Test/SpecificationsSetup.ipynb @@ -84,7 +84,7 @@ "\n", "\nstatic void ForEach(this IEnumerable self, Action action) => self.ToList().ForEach(action);", "\n", - "\npublic static IfrsVariable FromPvToIfrsVariable(this PvBase scope)", + "\npublic static IfrsVariable FromPvToIfrsVariable(this PresentValue scope)", "\n => new IfrsVariable{ EconomicBasis = scope.EconomicBasis, ", "\n EstimateType = scope.Identity.CalculationType, ", "\n DataNode = scope.Identity.Id.DataNode, ", diff --git a/Test/SpecificationsTechnicalMargin.ipynb b/Test/SpecificationsTechnicalMargin.ipynb index 7368b76c..5e35ce33 100644 --- a/Test/SpecificationsTechnicalMargin.ipynb +++ b/Test/SpecificationsTechnicalMargin.ipynb @@ -1223,7 +1223,7 @@ "cell_type": "code", "source": [ "var premiums = premiumAllocationFactor * Test.GetStorage().GetPremiums()", - "\n .Sum(p => referenceAoC.Sum(aoc => Test.GetScope((Test.GetIdentity(dataNode, aoc.AocType, aoc.Novelty), p, CalculationTypes.BE, (int?)null), o => o.WithContext(economicBasis)).Value)", + "\n .Sum(p => referenceAoC.Sum(aoc => Test.GetScope((Test.GetIdentity(dataNode, aoc.AocType, aoc.Novelty), p, CalculationTypes.BE, (int?)null), o => o.WithContext(economicBasis)).Value)", "\n -referenceAoC.Sum(aoc => Test.GetScope((Test.GetIdentity(dataNode, aoc.AocType, aoc.Novelty), p, EstimateTypes.A, (int?)null)).Value)", "\n -referenceAoC.Sum(aoc => Test.GetScope((Test.GetIdentity(dataNode, aoc.AocType, aoc.Novelty), p, EstimateTypes.AA, (int?)null)).Value)", "\n -referenceAoC.Sum(aoc => Test.GetScope((Test.GetIdentity(dataNode, aoc.AocType, aoc.Novelty), p, EstimateTypes.OA, (int?)null)).Value)", @@ -1264,7 +1264,7 @@ "cell_type": "code", "source": [ "var attributableExpenseAndCommissions = new string[] {AmountTypes.ACA, AmountTypes.AEA}", - "\n .Sum(d => referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), d, CalculationTypes.BE, (int?)null), o => o.WithContext(economicBasis)).Value)", + "\n .Sum(d => referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), d, CalculationTypes.BE, (int?)null), o => o.WithContext(economicBasis)).Value)", "\n -referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), d, EstimateTypes.A, (int?)null)).Value));" ], "metadata": {}, @@ -1302,7 +1302,7 @@ "cell_type": "code", "source": [ "var investmentClaims = Test.GetStorage().GetInvestmentClaims()", - "\n .Sum(ic => referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), ic, CalculationTypes.BE, (int?)null), o => o.WithContext(economicBasis)).Value)", + "\n .Sum(ic => referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), ic, CalculationTypes.BE, (int?)null), o => o.WithContext(economicBasis)).Value)", "\n -referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), ic, EstimateTypes.A, (int?)null)).Value)", "\n -referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), ic, EstimateTypes.AA, (int?)null)).Value)", "\n -referenceAoC.Sum(s => Test.GetScope((Test.GetIdentity(dataNode, s.AocType, s.Novelty), ic, EstimateTypes.OA, (int?)null)).Value)",