From 680f452174543e750578ceb7a3a830c3728cb0fe Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Mon, 21 Nov 2022 08:12:43 +0100 Subject: [PATCH 1/6] Adding new workspaces where needed. --- ifrs17/Import/Importers.ipynb | 317 ++++++++++------------------------ 1 file changed, 89 insertions(+), 228 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index a1c956c0..4a49a6f8 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -24,19 +24,13 @@ "", "\n

Importer Methods

", "\n" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", "source": [ "#!import \"ImportScopeCalculation\"" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", @@ -45,10 +39,7 @@ "\n", "\nThe Parsing storage collects data required for the import of a file. ", "\nSuch storage is then passed to parsing format definitions to map the content of the file into variables." - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -220,10 +211,7 @@ "\n ApplicationMessage.Log(Error.InvalidAmountTypeEstimateType, estimateType, amountType);", "\n }", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", @@ -231,19 +219,13 @@ "# Basics", "\n", "\nBasic methods to delete variable and update variables to the data source are defined." - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "## Clean the Database" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -253,10 +235,7 @@ "\n var loadData = await DataSource.Query().Where(filter?? (Expression>)(x => true)).ToListAsync();", "\n await DataSource.DeleteAsync(loadData);", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -267,19 +246,13 @@ "\n .Where(filter?? (Func)(x => true)).ToList();", "\n await DataSource.DeleteAsync(loadData);", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "## Update the Database" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -290,19 +263,13 @@ "\n await DataSource.UpdateAsync( await workspace.Query().ToArrayAsync() );", "\n await DataSource.CommitAsync();", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "## Data Node Factory" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -332,28 +299,19 @@ "\n", "\n await DataSource.CommitAsync();", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "# Importers" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "## Analysis of Change Configuration" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", @@ -374,10 +332,7 @@ "\n| WO < Order < CL | WO with Novelty C (only for Import Source = Actual) |", "\n", "\nThe new Aoc Configurations are created with the same order of the Aoc Types. " - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -454,10 +409,7 @@ "\n await workspace.CommitToTargetAsync(options.TargetDataSource);", "\n return Activity.Finish().Merge(logConfig); ", "\n});" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", @@ -465,10 +417,7 @@ "## Parse Main Tab and return Args", "\n", "\nThe main table of our custom import formats contains the information which are required to identify the data partition. These information are temporarily stored in [Args](../DataModel/DataStructure#args) and used in the next methods. " - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -527,10 +476,7 @@ "\n await DataSource.CommitAsync();", "\n return args;", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", @@ -538,19 +484,13 @@ "## Parse and Upload: Data Nodes", "\n", "\n[Portfolios](../DataModel/DataStructure#portfolios) and [Group of Contracts](../DataModel/DataStructure#group-of-contracts) are imported in the same file. " - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "### Portfolio and Group of contract" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -653,10 +593,7 @@ "\n ", "\n return Activity.Finish().Merge(importLogPortfolios).Merge(importLogGroupOfContracts);", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -671,19 +608,13 @@ "\n await CommitToDatabase(workspace, partition);", "\n return log;", "\n});" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "### Data Node State" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -704,29 +635,26 @@ "\n }", "\n }", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", "source": [ - "public async Task UploadDataNodeStateToWorkspaceAsync(IDataSet dataSet)", + "public async Task UploadDataNodeStateToWorkspaceAsync(IDataSet dataSet, IWorkspace workspace)", "\n{", - "\n Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n Workspace.Initialize(x => x.FromSource(DataSource)", + "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", + "\n workspace.Initialize(x => x.FromSource(DataSource)", "\n .DisableInitialization()", "\n .DisableInitialization()", "\n .DisableInitialization());", "\n ", - "\n await Workspace.DeleteAsync(await Workspace.Query().ToArrayAsync() );", + "\n await workspace.DeleteAsync(await workspace.Query().ToArrayAsync() );", "\n ", "\n Activity.Start();", "\n var args = await GetArgsFromMainAsync(dataSet);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", - "\n var storage = new ParsingStorage(args, DataSource, Workspace);", + "\n var storage = new ParsingStorage(args, DataSource, workspace);", "\n await storage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", @@ -738,56 +666,48 @@ "\n Month = args.Month,", "\n Partition = storage.TargetPartitionByReportingNode.Id", "\n }", - "\n ).WithTarget(Workspace).ExecuteAsync();", + "\n ).WithTarget(workspace).ExecuteAsync();", "\n", "\n await ValidateDataNodeStatesAsync(storage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.DataNodeState, async (options, dataSet) => {", - "\n var log = await UploadDataNodeStateToWorkspaceAsync(dataSet);", - "\n await CommitToDatabase(Workspace, (Guid)Workspace.Partition.GetCurrent(nameof(PartitionByReportingNode)), snapshot: false); ", + "\n var workspace = Workspace.CreateNew();", + "\n var log = await UploadDataNodeStateToWorkspaceAsync(dataSet, workspace);", + "\n await CommitToDatabase(workspace, (Guid)workspace.Partition.GetCurrent(nameof(PartitionByReportingNode)), snapshot: false); ", "\n return log;", "\n});" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "### DataNode Parameters" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", "source": [ - "public async Task UploadDataNodeParameterToWorkspaceAsync(IDataSet dataSet, Guid targetPartitionByReportingNodeId)", + "public async Task UploadDataNodeParameterToWorkspaceAsync(IDataSet dataSet, Guid targetPartitionByReportingNodeId, IWorkspace workspace)", "\n{", - "\n Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n Workspace.Initialize(x => x.FromSource(DataSource)", + "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", + "\n workspace.Initialize(x => x.FromSource(DataSource)", "\n .DisableInitialization()", "\n .DisableInitialization()", "\n .DisableInitialization());", "\n ", - "\n await Workspace.DeleteAsync(await Workspace.Query().ToArrayAsync() );", + "\n await workspace.DeleteAsync(await workspace.Query().ToArrayAsync() );", "\n ", "\n Activity.Start();", "\n var args = await GetArgsFromMainAsync(dataSet) with {ImportFormat = ImportFormats.DataNodeParameter};", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", - "\n var storage = new ParsingStorage(args, DataSource, Workspace);", + "\n var storage = new ParsingStorage(args, DataSource, workspace);", "\n await storage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", @@ -850,33 +770,28 @@ "\n ReinsuranceCoverage = reinsCov,", "\n };", "\n })", - "\n .WithTarget(Workspace)", + "\n .WithTarget(workspace)", "\n .ExecuteAsync();", "\n ", "\n targetPartitionByReportingNodeId = storage.TargetPartitionByReportingNode.Id;", "\n return Activity.Finish().Merge(importLog);", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.DataNodeParameter, async (options, dataSet) => {", "\n Guid partitionId = new Guid();", - "\n var log = await UploadDataNodeParameterToWorkspaceAsync(dataSet, partitionId);", + "\n var workspace = Workspace.CreateNew();", + "\n var log = await UploadDataNodeParameterToWorkspaceAsync(dataSet, partitionId, workspace);", "\n ", - "\n await CommitToDatabase(Workspace, partitionId, snapshot: false);", - "\n await CommitToDatabase(Workspace, partitionId, snapshot: false); ", + "\n await CommitToDatabase(workspace, partitionId, snapshot: false);", + "\n await CommitToDatabase(workspace, partitionId, snapshot: false); ", "\n ", "\n return log;", "\n});" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", @@ -889,19 +804,13 @@ "\n", "\nSome computed variables depend on both cash flow and actual input, requiring recalculation at each new import. ", "\n
In order to improve performance and maximize computational efficiency, we only (re)compute the set of variables that are expected to change given the underlying business logic. " - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "### Validation for Active Data Node States" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -912,19 +821,13 @@ "\n if(!dataNodes.ContainsKey(item.First().DataNode))", "\n ApplicationMessage.Log(Error.InactiveDataNodeState, item.First().DataNode);", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "### Cashflow as Raw Variable and Ifrs Variable" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -991,10 +894,7 @@ "\n await ValidateForDataNodeStateActiveAsync(workspace, parsingStorage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -1031,32 +931,26 @@ "\n", "\n return Activity.Finish().Merge(parsingLog); ", "\n});" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "### Actuals as Ifrs Variable" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", "source": [ - "public async Task ParseActualsToWorkspaceAsync(IDataSet dataSet, ImportArgs args)", + "public async Task ParseActualsToWorkspaceAsync(IDataSet dataSet, ImportArgs args, IWorkspace workspace)", "\n{", - "\n Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n Workspace.Initialize(x => x.FromSource(DataSource)", + "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", + "\n workspace.Initialize(x => x.FromSource(DataSource)", "\n .DisableInitialization()", "\n .DisableInitialization());", "\n ", "\n Activity.Start();", - "\n var parsingStorage = new ParsingStorage(args, DataSource, Workspace);", + "\n var parsingStorage = new ParsingStorage(args, DataSource, workspace);", "\n await parsingStorage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", @@ -1100,15 +994,12 @@ "\n };", "\n return item;", "\n }, ImportFormats.Actual", - "\n ).WithTarget(Workspace).ExecuteAsync();", + "\n ).WithTarget(workspace).ExecuteAsync();", "\n ", - "\n await ValidateForDataNodeStateActiveAsync(Workspace, parsingStorage.DataNodeDataBySystemName);", + "\n await ValidateForDataNodeStateActiveAsync(workspace, parsingStorage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -1119,10 +1010,11 @@ "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Actual, args);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", - "\n var parsingLog = await ParseActualsToWorkspaceAsync(dataSet, args);", + "\n var workspace = Workspace.CreateNew();", + "\n var parsingLog = await ParseActualsToWorkspaceAsync(dataSet, args, workspace);", "\n if(parsingLog.Errors.Any()) return Activity.Finish().Merge(parsingLog);", "\n", - "\n var storage = new ImportStorage(args, DataSource, Workspace);", + "\n var storage = new ImportStorage(args, DataSource, workspace);", "\n await storage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish().Merge(parsingLog);", "\n", @@ -1131,8 +1023,8 @@ "\n var ivs = universe.GetScopes(identities).SelectMany(x => x.CalculatedIfrsVariables);", "\n if(Activity.HasErrors()) return Activity.Finish().Merge(parsingLog);", "\n", - "\n await Workspace.UpdateAsync(ivs);", - "\n await CommitToDatabase(Workspace, ", + "\n await workspace.UpdateAsync(ivs);", + "\n await CommitToDatabase(workspace, ", "\n storage.TargetPartition, ", "\n snapshot : true, ", "\n filter : x => storage.EstimateTypesByImportFormat[ImportFormats.Actual].Contains(x.EstimateType) && ", @@ -1140,10 +1032,7 @@ "\n", "\n return Activity.Finish().Merge(parsingLog);", "\n});" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", @@ -1154,33 +1043,27 @@ "\n
It can be used in two very different scenarios: ", "\n- Simple Value : to import final figures as computed by an independent tool. In this case our IFRS 17 calculation is not applied and variable are stored in the Database for being consumed in reports with our powerful reporting tooling. ", "\n- Opening value : in the **fair value approach** this importer allows the import of in force opening values (Aoc step BOP and novelty I) for EstimateTypes C, L, LR, AA, OA, DA." - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "## Simple Value to Workspace" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", "source": [ - "public async Task ParseSimpleValueToWorkspaceAsync(IDataSet dataSet, ImportArgs args, Guid targetPartitionByReportingNodeAndPeriodId)", + "public async Task ParseSimpleValueToWorkspaceAsync(IDataSet dataSet, ImportArgs args, Guid targetPartitionByReportingNodeAndPeriodId, IWorkspace workspace)", "\n{", - "\n Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n Workspace.Initialize(x => x.FromSource(DataSource)", + "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", + "\n workspace.Initialize(x => x.FromSource(DataSource)", "\n .DisableInitialization()", "\n .DisableInitialization());", "\n ", "\n Activity.Start();", "\n var importFormat = args.ImportFormat;", - "\n var parsingStorage = new ParsingStorage(args, DataSource, Workspace);", + "\n var parsingStorage = new ParsingStorage(args, DataSource, workspace);", "\n await parsingStorage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish(); ", "\n", @@ -1212,10 +1095,10 @@ "\n };", "\n return iv;", "\n }, importFormat // This should indicate the table name, not the input format", - "\n ).WithTarget(Workspace).ExecuteAsync();", + "\n ).WithTarget(workspace).ExecuteAsync();", "\n ", "\n // Checking if there are inconsistencies in the TechnicalMarginEstimateTypes --> double entries in the steps where we expect to have unique values", - "\n var invalidVariables = await Workspace.Query()", + "\n var invalidVariables = await workspace.Query()", "\n .Where(iv => parsingStorage.TechnicalMarginEstimateTypes.Contains(iv.EstimateType))", "\n .Where(iv => iv.AocType == AocTypes.BOP || iv.AocType == AocTypes.EOP || iv.AocType == AocTypes.AM || iv.AocType == AocTypes.EA)", "\n .GroupBy(iv => new {iv.DataNode, iv.AocType, iv.Novelty})", @@ -1226,23 +1109,17 @@ "\n foreach (var iv in invalidVariables)", "\n ApplicationMessage.Log(Error.MultipleTechnicalMarginOpening, $\"{iv.DataNode},{iv.AocType},{iv.Novelty}\");", "\n ", - "\n await ValidateForDataNodeStateActiveAsync(Workspace, parsingStorage.DataNodeDataBySystemName);", + "\n await ValidateForDataNodeStateActiveAsync(workspace, parsingStorage.DataNodeDataBySystemName);", "\n targetPartitionByReportingNodeAndPeriodId = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id;", "\n return Activity.Finish().Merge(importLog);", "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "## Simple Value as IfrsVariable" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -1254,31 +1131,26 @@ "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", "\n Guid partitionId = new Guid();", - "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId);", + "\n var workspace = Workspace.CreateNew();", + "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId, workspace);", "\n if(parsingLog.Errors.Any()) return Activity.Finish().Merge(parsingLog);", "\n ", - "\n Workspace.Query().Select(v => new {v.DataNode, v.AccidentYear}).Distinct();", + "\n workspace.Query().Select(v => new {v.DataNode, v.AccidentYear}).Distinct();", "\n ", - "\n await CommitToDatabase(Workspace, ", + "\n await CommitToDatabase(workspace, ", "\n partitionId, ", "\n snapshot : true,", - "\n filter : x => Workspace.Query().Select(v => v.DataNode).Distinct().Contains(x.DataNode));", + "\n filter : x => workspace.Query().Select(v => v.DataNode).Distinct().Contains(x.DataNode));", "\n ", "\n return Activity.Finish().Merge(parsingLog);", "\n});" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "markdown", "source": [ "## Openings as IfrsVariable" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] }, { "cell_type": "code", @@ -1290,7 +1162,8 @@ "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", "\n Guid partitionId = new Guid();", - "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId);", + "\n var workspace = Workspace.CreateNew();", + "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId, workspace);", "\n if(parsingLog.Errors.Any()) return Activity.Finish().Merge(parsingLog);", "\n ", "\n var storage = new ImportStorage(args, DataSource, Workspace);", @@ -1311,19 +1184,7 @@ "\n", "\n return Activity.Finish().Merge(parsingLog);", "\n});" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] + ] } ] } \ No newline at end of file From 66b89ff6dac507e903601b9f29aa423237e5342a Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Wed, 23 Nov 2022 10:09:36 +0100 Subject: [PATCH 2/6] Changing last Workspaces to workspaces. --- ifrs17/Import/Importers.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 4a49a6f8..680224cf 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1166,7 +1166,7 @@ "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId, workspace);", "\n if(parsingLog.Errors.Any()) return Activity.Finish().Merge(parsingLog);", "\n ", - "\n var storage = new ImportStorage(args, DataSource, Workspace);", + "\n var storage = new ImportStorage(args, DataSource, workspace);", "\n await storage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish().Merge(parsingLog);", "\n ", @@ -1175,8 +1175,8 @@ "\n var ivs = universe.GetScopes(identities).SelectMany(x => x.CalculatedIfrsVariables);", "\n if(Activity.HasErrors()) return Activity.Finish().Merge(parsingLog);", "\n", - "\n await Workspace.UpdateAsync(ivs);", - "\n await CommitToDatabase(Workspace, ", + "\n await workspace.UpdateAsync(ivs);", + "\n await CommitToDatabase(workspace, ", "\n storage.TargetPartition, ", "\n snapshot : true,", "\n filter : x => storage.EstimateTypesByImportFormat[ImportFormats.Opening].Contains(x.EstimateType) && ", From 1736a6c2b0fa7a6c6af7fe18a1b8e199470f2502 Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Wed, 23 Nov 2022 10:29:24 +0100 Subject: [PATCH 3/6] restore metadata --- ifrs17/Import/Importers.ipynb | 225 +++++++++++++++++++++++++++------- 1 file changed, 180 insertions(+), 45 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 680224cf..845269d5 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -24,13 +24,19 @@ "", "\n

Importer Methods

", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", "source": [ "#!import \"ImportScopeCalculation\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", @@ -39,7 +45,10 @@ "\n", "\nThe Parsing storage collects data required for the import of a file. ", "\nSuch storage is then passed to parsing format definitions to map the content of the file into variables." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -211,7 +220,10 @@ "\n ApplicationMessage.Log(Error.InvalidAmountTypeEstimateType, estimateType, amountType);", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", @@ -219,13 +231,19 @@ "# Basics", "\n", "\nBasic methods to delete variable and update variables to the data source are defined." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "## Clean the Database" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -235,7 +253,10 @@ "\n var loadData = await DataSource.Query().Where(filter?? (Expression>)(x => true)).ToListAsync();", "\n await DataSource.DeleteAsync(loadData);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -246,13 +267,19 @@ "\n .Where(filter?? (Func)(x => true)).ToList();", "\n await DataSource.DeleteAsync(loadData);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "## Update the Database" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -263,13 +290,19 @@ "\n await DataSource.UpdateAsync( await workspace.Query().ToArrayAsync() );", "\n await DataSource.CommitAsync();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "## Data Node Factory" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -299,19 +332,28 @@ "\n", "\n await DataSource.CommitAsync();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "# Importers" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "## Analysis of Change Configuration" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", @@ -332,7 +374,10 @@ "\n| WO < Order < CL | WO with Novelty C (only for Import Source = Actual) |", "\n", "\nThe new Aoc Configurations are created with the same order of the Aoc Types. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -409,7 +454,10 @@ "\n await workspace.CommitToTargetAsync(options.TargetDataSource);", "\n return Activity.Finish().Merge(logConfig); ", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", @@ -417,7 +465,10 @@ "## Parse Main Tab and return Args", "\n", "\nThe main table of our custom import formats contains the information which are required to identify the data partition. These information are temporarily stored in [Args](../DataModel/DataStructure#args) and used in the next methods. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -476,7 +527,10 @@ "\n await DataSource.CommitAsync();", "\n return args;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", @@ -484,13 +538,19 @@ "## Parse and Upload: Data Nodes", "\n", "\n[Portfolios](../DataModel/DataStructure#portfolios) and [Group of Contracts](../DataModel/DataStructure#group-of-contracts) are imported in the same file. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "### Portfolio and Group of contract" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -593,7 +653,10 @@ "\n ", "\n return Activity.Finish().Merge(importLogPortfolios).Merge(importLogGroupOfContracts);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -608,13 +671,19 @@ "\n await CommitToDatabase(workspace, partition);", "\n return log;", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "### Data Node State" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -635,7 +704,10 @@ "\n }", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -671,7 +743,10 @@ "\n await ValidateDataNodeStatesAsync(storage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -682,13 +757,19 @@ "\n await CommitToDatabase(workspace, (Guid)workspace.Partition.GetCurrent(nameof(PartitionByReportingNode)), snapshot: false); ", "\n return log;", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "### DataNode Parameters" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -776,7 +857,10 @@ "\n targetPartitionByReportingNodeId = storage.TargetPartitionByReportingNode.Id;", "\n return Activity.Finish().Merge(importLog);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -791,7 +875,10 @@ "\n ", "\n return log;", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", @@ -804,13 +891,19 @@ "\n", "\nSome computed variables depend on both cash flow and actual input, requiring recalculation at each new import. ", "\n
In order to improve performance and maximize computational efficiency, we only (re)compute the set of variables that are expected to change given the underlying business logic. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "### Validation for Active Data Node States" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -821,13 +914,19 @@ "\n if(!dataNodes.ContainsKey(item.First().DataNode))", "\n ApplicationMessage.Log(Error.InactiveDataNodeState, item.First().DataNode);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "### Cashflow as Raw Variable and Ifrs Variable" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -894,7 +993,10 @@ "\n await ValidateForDataNodeStateActiveAsync(workspace, parsingStorage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -931,13 +1033,19 @@ "\n", "\n return Activity.Finish().Merge(parsingLog); ", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "### Actuals as Ifrs Variable" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -999,7 +1107,10 @@ "\n await ValidateForDataNodeStateActiveAsync(workspace, parsingStorage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -1032,7 +1143,10 @@ "\n", "\n return Activity.Finish().Merge(parsingLog);", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", @@ -1043,13 +1157,19 @@ "\n
It can be used in two very different scenarios: ", "\n- Simple Value : to import final figures as computed by an independent tool. In this case our IFRS 17 calculation is not applied and variable are stored in the Database for being consumed in reports with our powerful reporting tooling. ", "\n- Opening value : in the **fair value approach** this importer allows the import of in force opening values (Aoc step BOP and novelty I) for EstimateTypes C, L, LR, AA, OA, DA." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "## Simple Value to Workspace" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -1113,13 +1233,19 @@ "\n targetPartitionByReportingNodeAndPeriodId = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id;", "\n return Activity.Finish().Merge(importLog);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "## Simple Value as IfrsVariable" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -1144,13 +1270,19 @@ "\n ", "\n return Activity.Finish().Merge(parsingLog);", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "markdown", "source": [ "## Openings as IfrsVariable" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { "cell_type": "code", @@ -1184,7 +1316,10 @@ "\n", "\n return Activity.Finish().Merge(parsingLog);", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file From 7833b6b11f612b59c33e0f3353e8a505217b96a2 Mon Sep 17 00:00:00 2001 From: Andrea Muolo Date: Thu, 24 Nov 2022 21:53:34 +0100 Subject: [PATCH 4/6] fix data node state validation + cleanups --- ifrs17/Import/Importers.ipynb | 178 ++++++++++++++++------------------ 1 file changed, 86 insertions(+), 92 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 369377d6..5a9419e2 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -295,6 +295,79 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Parse Main Tab and return Args", + "\n", + "\nThe main table of our custom import formats contains the information which are required to identify the data partition. These information are temporarily stored in [Args](../DataModel/DataStructure#args) and used in the next methods. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public async Task GetArgsFromMainAsync(IDataSet dataSet)", + "\n{", + "\n var mainTab = dataSet.Tables[Main];", + "\n if(mainTab == null) ApplicationMessage.Log(Error.NoMainTab);", + "\n if(mainTab.Rows.Count() == 0) ApplicationMessage.Log(Error.IncompleteMainTab);", + "\n if(mainTab.Columns.FirstOrDefault(x => x.ColumnName == nameof(ReportingNode)) == null) ApplicationMessage.Log(Error.ReportingNodeInMainNotFound);", + "\n if(ApplicationMessage.HasErrors()) return null;", + "\n ", + "\n var main = mainTab.Rows.First();", + "\n var reportingNode = (string)main[nameof(ReportingNode)];", + "\n var scenario = mainTab.Columns.Where(x => x.ColumnName == nameof(Scenario)).Count()>0? (string)main[nameof(Scenario)] : default(string);", + "\n", + "\n ImportArgs args;", + "\n switch(typeof(IPartition).Name) {", + "\n case nameof(PartitionByReportingNode) : {", + "\n args = new ImportArgs( reportingNode,", + "\n default(int),", + "\n default(int),", + "\n default(Periodicity),", + "\n scenario,", + "\n default(string));", + "\n await DataSource.UpdateAsync( new[] { new PartitionByReportingNode { ", + "\n Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(args)),", + "\n ReportingNode = reportingNode, ", + "\n Scenario = scenario } } );", + "\n break;", + "\n }", + "\n case nameof(PartitionByReportingNodeAndPeriod) : {", + "\n if(mainTab.Columns.Where(x => x.ColumnName == nameof(PartitionByReportingNodeAndPeriod.Year)).Count()!=1) ApplicationMessage.Log(Error.YearInMainNotFound);", + "\n if(mainTab.Columns.Where(x => x.ColumnName == nameof(PartitionByReportingNodeAndPeriod.Month)).Count()!=1) ApplicationMessage.Log(Error.MonthInMainNotFound);", + "\n if(ApplicationMessage.HasErrors()) return null;", + "\n args = new ImportArgs( reportingNode, ", + "\n (int)Convert.ChangeType(main[nameof(PartitionByReportingNodeAndPeriod.Year)], typeof(int)),", + "\n (int)Convert.ChangeType(main[nameof(PartitionByReportingNodeAndPeriod.Month)], typeof(int)),", + "\n default(Periodicity),", + "\n scenario,", + "\n default(string) );", + "\n await DataSource.UpdateAsync( new[]{ new PartitionByReportingNodeAndPeriod { ", + "\n Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(args)),", + "\n Year = args.Year,", + "\n Month = args.Month,", + "\n ReportingNode = reportingNode, ", + "\n Scenario = scenario } } );", + "\n break;", + "\n }", + "\n default : {", + "\n ApplicationMessage.Log(Error.PartitionTypeNotFound, typeof(IPartition).Name); ", + "\n return null;", + "\n }", + "\n }", + "\n ", + "\n await DataSource.CommitAsync();", + "\n return args;", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ @@ -358,11 +431,11 @@ { "cell_type": "markdown", "source": [ - "The [Analysis of Change configuration](../DataModel/DataStructure#aoc-step-configuration) is parsed from the input file and complemented with defaults to allow for an easy insertion of new AoC steps. ", + "The [Analysis of Change configuration](../DataModel/DataStructure#aoc-step-configuration) is parsed from the input file and complemented with defaults to allow for an easy insertion of new Aoc steps. ", "\n", "\nAfter having checked that the [AocTypes](../DataModel/DataStructure#aoc-variable-type) loaded in the target DataSource are including all the compulsory ones, default configurations are generated on the basis of the AocTypes ordering. ", "\n", - "\nThe following categories have been identified based on the *Order* of the novel AoC Step:", + "\nThe following categories have been identified based on the *Order* of the novel Aoc step:", "\n", "\n**Category** $$\\hspace{2.8cm}$$ **Default added with same configuration of**", "\n| | |", @@ -373,7 +446,7 @@ "\n| CRU < Order < WO | EV with Novelty I and N |", "\n| WO < Order < CL | WO with Novelty C (only for Import Source = Actual) |", "\n", - "\nThe new AoC Configurations are created with the same order of the AoC Types. " + "\nThe new Aoc Configurations are created with the same order of the Aoc Types. " ], "metadata": {}, "execution_count": 0, @@ -459,79 +532,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "markdown", - "source": [ - "## Parse Main Tab and return Args", - "\n", - "\nThe main table of our custom import formats contains the information which are required to identify the data partition. These information are temporarily stored in [Args](../DataModel/DataStructure#args) and used in the next methods. " - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "public async Task GetArgsFromMainAsync(IDataSet dataSet)", - "\n{", - "\n var mainTab = dataSet.Tables[Main];", - "\n if(mainTab == null) ApplicationMessage.Log(Error.NoMainTab);", - "\n if(mainTab.Rows.Count() == 0) ApplicationMessage.Log(Error.IncompleteMainTab);", - "\n if(mainTab.Columns.FirstOrDefault(x => x.ColumnName == nameof(ReportingNode)) == null) ApplicationMessage.Log(Error.ReportingNodeInMainNotFound);", - "\n if(ApplicationMessage.HasErrors()) return null;", - "\n ", - "\n var main = mainTab.Rows.First();", - "\n var reportingNode = (string)main[nameof(ReportingNode)];", - "\n var scenario = mainTab.Columns.Where(x => x.ColumnName == nameof(Scenario)).Count()>0? (string)main[nameof(Scenario)] : default(string);", - "\n", - "\n ImportArgs args;", - "\n switch(typeof(IPartition).Name) {", - "\n case nameof(PartitionByReportingNode) : {", - "\n args = new ImportArgs( reportingNode,", - "\n default(int),", - "\n default(int),", - "\n default(Periodicity),", - "\n scenario,", - "\n default(string));", - "\n await DataSource.UpdateAsync( new[] { new PartitionByReportingNode { ", - "\n Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(args)),", - "\n ReportingNode = reportingNode, ", - "\n Scenario = scenario } } );", - "\n break;", - "\n }", - "\n case nameof(PartitionByReportingNodeAndPeriod) : {", - "\n if(mainTab.Columns.Where(x => x.ColumnName == nameof(PartitionByReportingNodeAndPeriod.Year)).Count()!=1) ApplicationMessage.Log(Error.YearInMainNotFound);", - "\n if(mainTab.Columns.Where(x => x.ColumnName == nameof(PartitionByReportingNodeAndPeriod.Month)).Count()!=1) ApplicationMessage.Log(Error.MonthInMainNotFound);", - "\n if(ApplicationMessage.HasErrors()) return null;", - "\n args = new ImportArgs( reportingNode, ", - "\n (int)Convert.ChangeType(main[nameof(PartitionByReportingNodeAndPeriod.Year)], typeof(int)),", - "\n (int)Convert.ChangeType(main[nameof(PartitionByReportingNodeAndPeriod.Month)], typeof(int)),", - "\n default(Periodicity),", - "\n scenario,", - "\n default(string) );", - "\n await DataSource.UpdateAsync( new[]{ new PartitionByReportingNodeAndPeriod { ", - "\n Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(args)),", - "\n Year = args.Year,", - "\n Month = args.Month,", - "\n ReportingNode = reportingNode, ", - "\n Scenario = scenario } } );", - "\n break;", - "\n }", - "\n default : {", - "\n ApplicationMessage.Log(Error.PartitionTypeNotFound, typeof(IPartition).Name); ", - "\n return null;", - "\n }", - "\n }", - "\n ", - "\n await DataSource.CommitAsync();", - "\n return args;", - "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "markdown", "source": [ @@ -688,9 +688,9 @@ { "cell_type": "code", "source": [ - "public async Task ValidateDataNodeStatesAsync(Dictionary persistentDataNodeByDataNode)", + "public async static Task ValidateDataNodeStatesAsync(this IWorkspace workspace, Dictionary persistentDataNodeByDataNode)", "\n{", - "\n foreach(var importedDataNodeState in await Workspace.Query().ToArrayAsync())", + "\n foreach(var importedDataNodeState in await workspace.Query().ToArrayAsync())", "\n {", "\n if(persistentDataNodeByDataNode.TryGetValue(importedDataNodeState.DataNode, out var currentPersistentDataNode))", "\n {", @@ -700,7 +700,7 @@ "\n importedDataNodeState.State.ToString());", "\n", "\n if(importedDataNodeState.State == currentPersistentDataNode.State)", - "\n await Workspace.DeleteAsync(importedDataNodeState);", + "\n await workspace.DeleteAsync(importedDataNodeState);", "\n }", "\n }", "\n}" @@ -719,9 +719,7 @@ "\n .DisableInitialization()", "\n .DisableInitialization()", "\n .DisableInitialization());", - "\n ", - "\n await workspace.DeleteAsync(await workspace.Query().ToArrayAsync() );", - "\n ", + "\n ", "\n Activity.Start();", "\n var args = await GetArgsFromMainAsync(dataSet);", "\n if(Activity.HasErrors()) return Activity.Finish();", @@ -740,7 +738,7 @@ "\n }", "\n ).WithTarget(workspace).ExecuteAsync();", "\n", - "\n await ValidateDataNodeStatesAsync(storage.DataNodeDataBySystemName);", + "\n await workspace.ValidateDataNodeStatesAsync(storage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", "\n}" ], @@ -781,9 +779,7 @@ "\n .DisableInitialization()", "\n .DisableInitialization()", "\n .DisableInitialization());", - "\n ", - "\n await workspace.DeleteAsync(await workspace.Query().ToArrayAsync() );", - "\n ", + "\n ", "\n Activity.Start();", "\n var args = await GetArgsFromMainAsync(dataSet) with {ImportFormat = ImportFormats.DataNodeParameter};", "\n if(Activity.HasErrors()) return Activity.Finish();", @@ -869,10 +865,8 @@ "\n Guid partitionId = new Guid();", "\n var workspace = Workspace.CreateNew();", "\n var log = await UploadDataNodeParameterToWorkspaceAsync(dataSet, partitionId, workspace);", - "\n ", "\n await CommitToDatabase(workspace, partitionId, snapshot: false);", "\n await CommitToDatabase(workspace, partitionId, snapshot: false); ", - "\n ", "\n return log;", "\n});" ], @@ -886,7 +880,7 @@ "## Parse and Upload: Variables", "\n", "\nVariables are created upon import of Cash flow and Actual file.", - "\n
Cash flows are firstly mapped into [RawVariables](../DataModel/DataStructure#raw-variables). These are then used as input for the [calculation](ImportScopeCalculation) of the IFRS 17 business logic which computes [IfrsVariables](../DataModel/DataStructure#ifrs-variable).", + "\n
Cash flows are firstly mapped into [RawVariables](../DataModel/DataStructure#raw-variables-cashflows). These are then used as input for the [calculation](ImportScopeCalculation) of the IFRS 17 business logic which computes [IfrsVariables](../DataModel/DataStructure#ifrs-variable).", "\n
Actuals are directly mapped into [IfrsVariables](../DataModel/DataStructure#ifrs-variable). ", "\n", "\nSome computed variables depend on both cash flow and actual input, requiring recalculation at each new import. ", @@ -922,7 +916,7 @@ { "cell_type": "markdown", "source": [ - "### Cash flow as Raw Variable and Ifrs Variable" + "### Cashflow as Raw Variable and Ifrs Variable" ], "metadata": {}, "execution_count": 0, @@ -958,7 +952,7 @@ "\n return null;", "\n }", "\n ", - "\n // Filter out cash flows for DataNode that were created in the past and are still active and come with AocType = BOPI", + "\n // Filter out cashflows for DataNode that were created in the past and are still active and come with AocType = BOPI", "\n if(dataNodeData.Year < args.Year && aocType == AocTypes.BOP && novelty == Novelties.I) {", "\n ApplicationMessage.Log(Warning.ActiveDataNodeWithCashflowBOPI, dataNode);", "\n return null;", @@ -1156,7 +1150,7 @@ "\nSimple Value import is a special import that imports [IfrsVariables](../DataModel/DataStructure#ifrs-variable).", "\n
It can be used in two very different scenarios: ", "\n- Simple Value : to import final figures as computed by an independent tool. In this case our IFRS 17 calculation is not applied and variable are stored in the Database for being consumed in reports with our powerful reporting tooling. ", - "\n- Opening value : in the **fair value approach** this importer allows the import of in force opening values (AoC Step BOP and novelty I) for EstimateTypes C, L, LR, AA, OA, DA." + "\n- Opening value : in the **fair value approach** this importer allows the import of in force opening values (Aoc step BOP and novelty I) for EstimateTypes C, L, LR, AA, OA, DA." ], "metadata": {}, "execution_count": 0, From 45ef9e74b1ffa49d67b989d153eb54aec3cbccb9 Mon Sep 17 00:00:00 2001 From: Andrea Muolo Date: Fri, 25 Nov 2022 09:30:55 +0100 Subject: [PATCH 5/6] fix text --- ifrs17/Import/Importers.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 5a9419e2..14e34c21 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -431,11 +431,11 @@ { "cell_type": "markdown", "source": [ - "The [Analysis of Change configuration](../DataModel/DataStructure#aoc-step-configuration) is parsed from the input file and complemented with defaults to allow for an easy insertion of new Aoc steps. ", + "The [Analysis of Change configuration](../DataModel/DataStructure#aoc-step-configuration) is parsed from the input file and complemented with defaults to allow for an easy insertion of new AoC steps. ", "\n", "\nAfter having checked that the [AocTypes](../DataModel/DataStructure#aoc-variable-type) loaded in the target DataSource are including all the compulsory ones, default configurations are generated on the basis of the AocTypes ordering. ", "\n", - "\nThe following categories have been identified based on the *Order* of the novel Aoc step:", + "\nThe following categories have been identified based on the *Order* of the novel AoC step:", "\n", "\n**Category** $$\\hspace{2.8cm}$$ **Default added with same configuration of**", "\n| | |", @@ -446,7 +446,7 @@ "\n| CRU < Order < WO | EV with Novelty I and N |", "\n| WO < Order < CL | WO with Novelty C (only for Import Source = Actual) |", "\n", - "\nThe new Aoc Configurations are created with the same order of the Aoc Types. " + "\nThe new AoC Configurations are created with the same order of the AoC Types. " ], "metadata": {}, "execution_count": 0, From dac6cba8cdd978740223bbb2797af56984aef152 Mon Sep 17 00:00:00 2001 From: Andrea Muolo Date: Fri, 25 Nov 2022 09:49:07 +0100 Subject: [PATCH 6/6] fix text part 2 --- ifrs17/Import/Importers.ipynb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 14e34c21..fd7524ee 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -435,7 +435,7 @@ "\n", "\nAfter having checked that the [AocTypes](../DataModel/DataStructure#aoc-variable-type) loaded in the target DataSource are including all the compulsory ones, default configurations are generated on the basis of the AocTypes ordering. ", "\n", - "\nThe following categories have been identified based on the *Order* of the novel AoC step:", + "\nThe following categories have been identified based on the *Order* of the novel AoC Step:", "\n", "\n**Category** $$\\hspace{2.8cm}$$ **Default added with same configuration of**", "\n| | |", @@ -880,7 +880,7 @@ "## Parse and Upload: Variables", "\n", "\nVariables are created upon import of Cash flow and Actual file.", - "\n
Cash flows are firstly mapped into [RawVariables](../DataModel/DataStructure#raw-variables-cashflows). These are then used as input for the [calculation](ImportScopeCalculation) of the IFRS 17 business logic which computes [IfrsVariables](../DataModel/DataStructure#ifrs-variable).", + "\n
Cash flows are firstly mapped into [RawVariables](../DataModel/DataStructure#raw-variables). These are then used as input for the [calculation](ImportScopeCalculation) of the IFRS 17 business logic which computes [IfrsVariables](../DataModel/DataStructure#ifrs-variable).", "\n
Actuals are directly mapped into [IfrsVariables](../DataModel/DataStructure#ifrs-variable). ", "\n", "\nSome computed variables depend on both cash flow and actual input, requiring recalculation at each new import. ", @@ -916,7 +916,7 @@ { "cell_type": "markdown", "source": [ - "### Cashflow as Raw Variable and Ifrs Variable" + "### Cash flow as Raw Variable and Ifrs Variable" ], "metadata": {}, "execution_count": 0, @@ -952,7 +952,7 @@ "\n return null;", "\n }", "\n ", - "\n // Filter out cashflows for DataNode that were created in the past and are still active and come with AocType = BOPI", + "\n // Filter out cash flows for DataNode that were created in the past and are still active and come with AocType = BOPI", "\n if(dataNodeData.Year < args.Year && aocType == AocTypes.BOP && novelty == Novelties.I) {", "\n ApplicationMessage.Log(Warning.ActiveDataNodeWithCashflowBOPI, dataNode);", "\n return null;", @@ -1150,7 +1150,7 @@ "\nSimple Value import is a special import that imports [IfrsVariables](../DataModel/DataStructure#ifrs-variable).", "\n
It can be used in two very different scenarios: ", "\n- Simple Value : to import final figures as computed by an independent tool. In this case our IFRS 17 calculation is not applied and variable are stored in the Database for being consumed in reports with our powerful reporting tooling. ", - "\n- Opening value : in the **fair value approach** this importer allows the import of in force opening values (Aoc step BOP and novelty I) for EstimateTypes C, L, LR, AA, OA, DA." + "\n- Opening value : in the **fair value approach** this importer allows the import of in force opening values (AoC Step BOP and novelty I) for EstimateTypes C, L, LR, AA, OA, DA." ], "metadata": {}, "execution_count": 0,