From a4defea07e1ea3ea698f2cf56fc5ab883650efcc Mon Sep 17 00:00:00 2001 From: akatz Date: Mon, 23 Jan 2023 12:04:25 +0100 Subject: [PATCH 01/13] generalization --- ifrs17/Utils/ActivityLog.ipynb | 142 +++++++++++++++++++++------------ 1 file changed, 89 insertions(+), 53 deletions(-) diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index e0e951ca..b772cd2e 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -157,6 +157,11 @@ "\n public string Format {get; init;}", "\n protected IDataSetImportVariable DataSetReader {get; set;}", "\n protected ISessionVariable Session {get; set;}", + "\n", + "\n public KeyedImportExport() ", + "\n { ", + "\n Id = Guid.NewGuid();", + "\n }", "\n}" ], "metadata": {}, @@ -220,6 +225,14 @@ "\n{", "\n protected ImportOptions Options {get; set;}", "\n", + "\n public KeyedImport() {Id = Guid.NewGuid();}", + "\n", + "\n public abstract KeyedImport WithOptions(ImportOptions options);", + "\n", + "\n public KeyedImport WithSession(ISessionVariable session) => this with {Session = session};", + "\n", + "\n public KeyedImport WithDataSetReader(IDataSetImportVariable importVariable) => this with {DataSetReader = importVariable};", + "\n", "\n public async Task InitializeImportDataAsync()", "\n {", "\n var stream = await GenerateStreamWrapperAsync();", @@ -287,6 +300,8 @@ "\n", "\n public string Source {get; init;}", "\n", + "\n public ImportFile() : base(){;}", + "\n", "\n public ImportFile(FileImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", "\n {", "\n Options = options;", @@ -302,6 +317,25 @@ "\n // Andrey Katz: Options.TargetDataSource.Partion.GetCurrent(?? What do we put here, different classes might posess various partitions, e.g. Yield Curve has none ??)", "\n }", "\n", + "\n public override ImportFile WithOptions(ImportOptions options)", + "\n {", + "\n if (options is FileImportOptions fio)", + "\n {", + "\n string fileName = fio.FileName;", + "\n return this with{Options = fio,", + "\n Name = Path.GetFileName(fileName),", + "\n Directory = Path.GetDirectoryName(fileName),", + "\n ContentType = Path.GetExtension(fileName),", + "\n Source = options.Storage.GetType().Name,", + "\n Partition = GetInvolvedPartitions(options)", + "\n };", + "\n }", + "\n else", + "\n {", + "\n throw new Exception(\"The import options must be of file import options type\");", + "\n }", + "\n }", + "\n", "\n public ImportFile(Guid id)", "\n {", "\n Id = id;", @@ -329,6 +363,8 @@ "\n{", "\n public string Content {get; init;}", "\n", + "\n public ImportString() : base(){;}", + "\n", "\n public ImportString(StringImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", "\n {", "\n Options = options;", @@ -338,6 +374,13 @@ "\n Content = options.Content;", "\n }", "\n", + "\n public override ImportString WithOptions(ImportOptions options)", + "\n {", + "\n if (options is StringImportOptions sgio) return this with {Options = sgio, ", + "\n Content = sgio.Content};", + "\n else throw new Exception(\"The import options must be of string import options type\");", + "\n }", + "\n", "\n public ImportString(Guid id)", "\n {", "\n Id = id;", @@ -364,6 +407,14 @@ "\n Id = Guid.NewGuid();", "\n }", "\n", + "\n public ImportDataSet() : base() {;}", + "\n", + "\n public override ImportDataSet WithOptions(ImportOptions options)", + "\n {", + "\n if (options is DataSetImportOptions dsio) return this with {Options = dsio};", + "\n else throw new Exception(\"The import options must be of data set import options type\");", + "\n }", + "\n", "\n public ImportDataSet(Guid id)", "\n {", "\n Id = id;", @@ -390,6 +441,14 @@ "\n Id = Guid.NewGuid();", "\n }", "\n", + "\n public ImportStream() : base() {;}", + "\n", + "\n public override ImportStream WithOptions(ImportOptions options)", + "\n {", + "\n if (options is StreamImportOptions smio) return this with {Options = smio};", + "\n else throw new Exception(\"The import options must be of stream import options type\");", + "\n }", + "\n", "\n public ImportStream(Guid id)", "\n {", "\n Id = id;", @@ -425,71 +484,23 @@ "\n var log = await Builder.ExecuteAsync();", "\n var options = Builder.GetImportOptions();", "\n var activity = new ImportExportActivity(log, Session);", - "\n bool importSucceeded = true;", + "\n var importSucceeded = true;", "\n switch(options)", "\n {", "\n case FileImportOptions fio:", - "\n var importFile = new ImportFile(Guid.NewGuid());", - "\n try", - "\n {", - "\n importFile = await (new ImportFile(fio, ImportVariable, Session)).InitializeImportDataAsync() as ImportFile;", - "\n activity = activity with {SourceId = importFile.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from File\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importFile.RepeatOnce());", + "\n activity = await ReportInputAndUpdateActivityAsync(activity, fio);", "\n break;", "\n", "\n case StringImportOptions sgio:", - "\n var importString = new ImportString(Guid.NewGuid());", - "\n try", - "\n {", - "\n importString = await (new ImportString(sgio, ImportVariable, Session)).InitializeImportDataAsync() as ImportString;", - "\n activity = activity with {SourceId = importString.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from String\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importString.RepeatOnce());", + "\n activity = await ReportInputAndUpdateActivityAsync(activity, sgio);", "\n break;", "\n ", "\n case StreamImportOptions smio:", - "\n var importStream = new ImportStream(Guid.NewGuid());", - "\n try", - "\n {", - "\n importStream = await (new ImportStream(smio, ImportVariable, Session)).InitializeImportDataAsync() as ImportStream;", - "\n activity = activity with {SourceId = importStream.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from Stream\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importStream.RepeatOnce());", + "\n activity = await ReportInputAndUpdateActivityAsync(activity, smio);", "\n break;", "\n", "\n case DataSetImportOptions dsio:", - "\n var importDataSet = new ImportDataSet(Guid.NewGuid());", - "\n try", - "\n {", - "\n importDataSet = await (new ImportDataSet(dsio, ImportVariable, Session)).InitializeImportDataAsync() as ImportDataSet;", - "\n activity = activity with {SourceId = importDataSet.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from Data Set\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importDataSet.RepeatOnce());", + "\n activity = await ReportInputAndUpdateActivityAsync(activity, dsio);", "\n break;", "\n", "\n default:", @@ -500,6 +511,31 @@ "\n await DataSource.CommitAsync();", "\n return log;", "\n }", + "\n", + "\n private async Task ReportInputAndUpdateActivityAsync(ImportExportActivity activity, ", + "\n TOptions options)", + "\n where TOptions: ImportOptions", + "\n where TImport: KeyedImport, new()", + "\n {", + "\n try", + "\n {", + "\n var import = new TImport();", + "\n import = await import.WithSession(Session)", + "\n .WithDataSetReader(ImportVariable)", + "\n .WithOptions(options)", + "\n .InitializeImportDataAsync() as TImport;", + "\n activity = activity with {SourceId = import.Id, ", + "\n Category = \"Import from File\"};", + "\n await DataSource.UpdateAsync(import.RepeatOnce());", + "\n }", + "\n catch (Exception e)", + "\n {", + "\n activity = activity with {SourceId = null, ", + "\n\t\t\t\t\t\t\t\t\tCategory = \"Import from File\",", + "\n ExceptionMessage = e.Message};", + "\n }", + "\n return activity;", + "\n }", "\n}" ], "metadata": {}, From d4d17062fffeb3ecc1285df32791a73764153891 Mon Sep 17 00:00:00 2001 From: akatz Date: Mon, 23 Jan 2023 13:43:15 +0100 Subject: [PATCH 02/13] more concise switch --- ifrs17/Utils/ActivityLog.ipynb | 38 +++++++++++----------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index ee3d17cf..45ca471c 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -79,7 +79,7 @@ "cell_type": "markdown", "source": [ "## Import Export Activity ", - "\nEvery activity to and from (import or export) the DataSource is tracked by recording an ImportExportActivity. Among other information this record tracks the user who performs the action, the timestamp, the activity log, and a unique identifier which can be used to retrieve the data subject of the activity. " + "\nEvery activity to and from (import or export) the DataSource is tracked by recording an ImportExportActivity. Among other information this record tracks the user who performe the action, the timestamp, the activity log, and a unique identifier which can be used to retrieve the data subject of the activity. " ], "metadata": {}, "execution_count": 0, @@ -483,40 +483,26 @@ "\n {", "\n var log = await Builder.ExecuteAsync();", "\n var options = Builder.GetImportOptions();", - "\n var activity = new ImportExportActivity(log, Session);", - "\n var importSucceeded = true;", - "\n switch(options)", + "\n var activity = options switch", "\n {", - "\n case FileImportOptions fio:", - "\n activity = await ReportInputAndUpdateActivityAsync(activity, fio);", - "\n break;", - "\n", - "\n case StringImportOptions sgio:", - "\n activity = await ReportInputAndUpdateActivityAsync(activity, sgio);", - "\n break;", - "\n ", - "\n case StreamImportOptions smio:", - "\n activity = await ReportInputAndUpdateActivityAsync(activity, smio);", - "\n break;", - "\n", - "\n case DataSetImportOptions dsio:", - "\n activity = await ReportInputAndUpdateActivityAsync(activity, dsio);", - "\n break;", - "\n", - "\n default:", - "\n throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", - "\n break;", - "\n }", + "\n FileImportOptions fio => await ReportInputAndUpdateActivityAsync(log, fio),", + "\n StringImportOptions sgio => await ReportInputAndUpdateActivityAsync(log, sgio),", + "\n StreamImportOptions smio => await ReportInputAndUpdateActivityAsync(log, smio),", + "\n DataSetImportOptions dsio => await ReportInputAndUpdateActivityAsync(log, dsio),", + "\n _ => null,", + "\n };", + "\n if (activity is null) throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", "\n await DataSource.UpdateAsync(activity.RepeatOnce());", "\n await DataSource.CommitAsync();", "\n return log;", "\n }", "\n", - "\n private async Task ReportInputAndUpdateActivityAsync(ImportExportActivity activity, ", - "\n TOptions options)", + "\n private async Task ReportInputAndUpdateActivityAsync(ActivityLog log, ", + "\n TOptions options)", "\n where TOptions: ImportOptions", "\n where TImport: KeyedImport, new()", "\n {", + "\n var activity = new ImportExportActivity(log, Session);", "\n try", "\n {", "\n var import = new TImport();", From 031d4aa560a4180704ada1ce604f6ec8299806bb Mon Sep 17 00:00:00 2001 From: akatz Date: Mon, 23 Jan 2023 13:48:27 +0100 Subject: [PATCH 03/13] typo --- ifrs17/Utils/ActivityLog.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index 45ca471c..2a3e0353 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -79,7 +79,7 @@ "cell_type": "markdown", "source": [ "## Import Export Activity ", - "\nEvery activity to and from (import or export) the DataSource is tracked by recording an ImportExportActivity. Among other information this record tracks the user who performe the action, the timestamp, the activity log, and a unique identifier which can be used to retrieve the data subject of the activity. " + "\nEvery activity to and from (import or export) the DataSource is tracked by recording an ImportExportActivity. Among other information this record tracks the user who performs the action, the timestamp, the activity log, and the unique identifier which can be used to retrieve the data subject of the activity. " ], "metadata": {}, "execution_count": 0, From ab444ace888fa074b3fe433c8ba3f1bec44d8a2b Mon Sep 17 00:00:00 2001 From: akatz Date: Mon, 23 Jan 2023 14:10:38 +0100 Subject: [PATCH 04/13] messages fixed --- ifrs17/Utils/ActivityLog.ipynb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index 2a3e0353..eef17b64 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -485,10 +485,10 @@ "\n var options = Builder.GetImportOptions();", "\n var activity = options switch", "\n {", - "\n FileImportOptions fio => await ReportInputAndUpdateActivityAsync(log, fio),", - "\n StringImportOptions sgio => await ReportInputAndUpdateActivityAsync(log, sgio),", - "\n StreamImportOptions smio => await ReportInputAndUpdateActivityAsync(log, smio),", - "\n DataSetImportOptions dsio => await ReportInputAndUpdateActivityAsync(log, dsio),", + "\n FileImportOptions fio => await ReportInputAndUpdateActivityAsync(log, fio, \"Import from File \"),", + "\n StringImportOptions sgio => await ReportInputAndUpdateActivityAsync(log, sgio, \"Import from String\"),", + "\n StreamImportOptions smio => await ReportInputAndUpdateActivityAsync(log, smio, \"Import from Stream\"),", + "\n DataSetImportOptions dsio => await ReportInputAndUpdateActivityAsync(log, dsio, \"Import fro Data Set\"),", "\n _ => null,", "\n };", "\n if (activity is null) throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", @@ -498,7 +498,8 @@ "\n }", "\n", "\n private async Task ReportInputAndUpdateActivityAsync(ActivityLog log, ", - "\n TOptions options)", + "\n TOptions options, ", + "\n string categoryMessage)", "\n where TOptions: ImportOptions", "\n where TImport: KeyedImport, new()", "\n {", @@ -511,13 +512,13 @@ "\n .WithOptions(options)", "\n .InitializeImportDataAsync() as TImport;", "\n activity = activity with {SourceId = import.Id, ", - "\n Category = \"Import from File\"};", + "\n Category = categoryMessage};", "\n await DataSource.UpdateAsync(import.RepeatOnce());", "\n }", "\n catch (Exception e)", "\n {", "\n activity = activity with {SourceId = null, ", - "\n\t\t\t\t\t\t\t\t\tCategory = \"Import from File\",", + "\n\t\t\t\t\t\t\t\t\tCategory = categoryMessage,", "\n ExceptionMessage = e.Message};", "\n }", "\n return activity;", From c1fc09a7c92c503ff030f95baf6004ca0291c278 Mon Sep 17 00:00:00 2001 From: akatz Date: Wed, 25 Jan 2023 15:43:04 +0100 Subject: [PATCH 05/13] changed api one again --- ifrs17/Utils/ActivityLog.ipynb | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index eef17b64..5c89d920 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -314,7 +314,7 @@ "\n ContentType = Path.GetExtension(fileName);", "\n Source = options.Storage.GetType().Name; ", "\n Partition = GetInvolvedPartitions(options);", - "\n // Andrey Katz: Options.TargetDataSource.Partion.GetCurrent(?? What do we put here, different classes might posess various partitions, e.g. Yield Curve has none ??)", + "\n // Andrey Katz: Options.TargetDataSource.Partion.GetCurrentPartitions(?? What do we put here, different classes might posess various partitions, e.g. Yield Curve has none ??)", "\n }", "\n", "\n public override ImportFile WithOptions(ImportOptions options)", @@ -474,11 +474,12 @@ { "cell_type": "code", "source": [ - "public record ImportBuilderWriter(ImportOptionsBuilder Builder, ", - "\n ISessionVariable Session, ", - "\n IDataSource DataSource, ", - "\n IDataSetImportVariable ImportVariable)", + "public record ImportBuilderWriter(ImportOptionsBuilder Builder) ", "\n{", + "\n public static ISessionVariable Session {get; set;}", + "\n public static IDataSource DataSource {get; set;}", + "\n public static IDataSetImportVariable ImportVariable {get; set;}", + "\n", "\n public async Task ExecuteAsync()", "\n {", "\n var log = await Builder.ExecuteAsync();", @@ -523,7 +524,11 @@ "\n }", "\n return activity;", "\n }", - "\n}" + "\n}", + "\n", + "\nImportBuilderWriter.Session = Session;", + "\nImportBuilderWriter.DataSource = DataSource;", + "\nImportBuilderWriter.ImportVariable = DataSetReader;" ], "metadata": {}, "execution_count": 0, @@ -532,11 +537,11 @@ { "cell_type": "code", "source": [ - "public record ExportBuilderWriter(DocumentBuilder Builder, ", - "\n ISessionVariable Session, ", - "\n IDataSource DataSource, ", - "\n IDataSetImportVariable ImportVariable)", + "public record ExportBuilderWriter(DocumentBuilder Builder)", "\n{", + "\n public static ISessionVariable Session {get; set;}", + "\n public static IDataSetImportVariable ImportVariable {get; set;}", + "\n public static IDataSource DataSource {get; set;}", "\n public async Task ExecuteAsync()", "\n {", "\n var exportResult = await Builder.ExecuteAsync();", @@ -548,7 +553,10 @@ "\n await DataSource.CommitAsync();", "\n return exportResult;", "\n }", - "\n}" + "\n}", + "\nExportBuilderWriter.Session = Session;", + "\nExportBuilderWriter.DataSource = DataSource;", + "\nExportBuilderWriter.ImportVariable = DataSetReader;" ], "metadata": {}, "execution_count": 0, @@ -557,11 +565,7 @@ { "cell_type": "code", "source": [ - "public static ImportBuilderWriter WithActivityLog(this ImportOptionsBuilder builder, ", - "\n ISessionVariable session, ", - "\n IDataSource dataSource, ", - "\n IDataSetImportVariable importVariable) => ", - "\n new ImportBuilderWriter(builder, session, dataSource, importVariable);" + "public static ImportBuilderWriter WithActivityLog(this ImportOptionsBuilder builder) => new ImportBuilderWriter(builder);" ], "metadata": {}, "execution_count": 0, @@ -570,11 +574,7 @@ { "cell_type": "code", "source": [ - "public static ExportBuilderWriter WithActivityLog(this IDocumentBuilder builder, ", - "\n ISessionVariable session, ", - "\n IDataSource dataSource, ", - "\n IDataSetImportVariable importVariable) =>", - "\n new ExportBuilderWriter(builder as DocumentBuilder, session, dataSource, importVariable);" + "public static ExportBuilderWriter WithActivityLog(this IDocumentBuilder builder) => new ExportBuilderWriter(builder as DocumentBuilder);" ], "metadata": {}, "execution_count": 0, From 85e4b85101878a18d15d75078044a51f04ffed0c Mon Sep 17 00:00:00 2001 From: akatz Date: Wed, 25 Jan 2023 17:04:15 +0100 Subject: [PATCH 06/13] api update --- .../InitSystemorphBaseToMemory.ipynb | 6 +-- .../InitSystemorphRefDataToMemory.ipynb | 26 +++++------ .../InitSystemorphToDatabase.ipynb | 44 +++++++++---------- .../InitSystemorphToMemory.ipynb | 14 +++--- 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index 412f644a..de4c15af 100644 --- a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -80,7 +80,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -93,7 +93,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -106,7 +106,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb index d406a80d..29276b04 100644 --- a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb @@ -118,7 +118,7 @@ "\n .WithType()", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -131,7 +131,7 @@ "await Import.FromFile(\"../Files/Dimensions.csv\")", "\n .WithFormat(ImportFormats.AocConfiguration)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -144,7 +144,7 @@ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -166,42 +166,42 @@ "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync();", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync());", "\nlog" ], @@ -215,7 +215,7 @@ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -228,7 +228,7 @@ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -241,7 +241,7 @@ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb index ecb29f00..e8bec1bd 100644 --- a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb @@ -96,7 +96,7 @@ "\n .WithType()", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -109,7 +109,7 @@ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -131,42 +131,42 @@ "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync();", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog" @@ -181,7 +181,7 @@ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -194,7 +194,7 @@ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -207,7 +207,7 @@ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -229,7 +229,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -242,7 +242,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -255,7 +255,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -277,7 +277,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Opening)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -290,7 +290,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -303,7 +303,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -316,7 +316,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -329,7 +329,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -342,7 +342,7 @@ "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue )", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -355,7 +355,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb index f5a7d4bc..cb39d2f2 100644 --- a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb @@ -70,7 +70,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Opening)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -83,7 +83,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -96,7 +96,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -109,7 +109,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -122,7 +122,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -135,7 +135,7 @@ "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue )", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -148,7 +148,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, From c365e9885a07649126302c0d7e8b3c037e1abaf3 Mon Sep 17 00:00:00 2001 From: akatz Date: Wed, 25 Jan 2023 17:09:12 +0100 Subject: [PATCH 07/13] new api --- ifrs17-template/Import/CloseImportTemplate.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ifrs17-template/Import/CloseImportTemplate.ipynb b/ifrs17-template/Import/CloseImportTemplate.ipynb index fc78fc44..9b1a2624 100644 --- a/ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/ifrs17-template/Import/CloseImportTemplate.ipynb @@ -121,7 +121,7 @@ "await Import.FromFile(pathToFile)", "\n .WithFormat(format)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -170,7 +170,7 @@ "await Import.FromFile(pathToFile)", "\n .WithFormat(format)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, From e4928e8c4acdab7631e07c271bb6a5fa89b71821 Mon Sep 17 00:00:00 2001 From: akatz Date: Wed, 25 Jan 2023 17:16:37 +0100 Subject: [PATCH 08/13] full update --- ifrs17-template/Export/MapTemplate.ipynb | 6 +++--- .../ActualsUseCaseDataImport.ipynb | 18 +++++++++--------- .../CsmSwitchDataImport.ipynb | 18 +++++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index dc792dba..ca2f80c7 100644 --- a/ifrs17-template/Export/MapTemplate.ipynb +++ b/ifrs17-template/Export/MapTemplate.ipynb @@ -155,7 +155,7 @@ "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -241,7 +241,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -328,7 +328,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb index f3066174..e71da8f0 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb @@ -77,7 +77,7 @@ "await Import.FromFile(\"DataNodes_ActualsCase_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -90,7 +90,7 @@ "await Import.FromFile(\"DataNodeStates_ActualsCase_CH_2020_1.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -103,7 +103,7 @@ "await Import.FromFile(\"DataNodeParameters_ActualsCase_CH_2020_1.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -134,7 +134,7 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -147,7 +147,7 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -169,7 +169,7 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_6.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -182,7 +182,7 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_6.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -204,7 +204,7 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -217,7 +217,7 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb index a0d0556a..7f14af98 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb @@ -76,7 +76,7 @@ "await Import.FromFile(\"DataNodes_CsmSwitch_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -89,7 +89,7 @@ "await Import.FromFile(\"DataNodeStates_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -102,7 +102,7 @@ "await Import.FromFile(\"DataNodeParameters_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -133,7 +133,7 @@ "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -146,7 +146,7 @@ "await Import.FromFile(\"Actuals_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -159,7 +159,7 @@ "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -172,7 +172,7 @@ "await Import.FromFile(\"Actuals_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -194,7 +194,7 @@ "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -207,7 +207,7 @@ "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.SimpleValue)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, From 23cc11f360eaa0c5caeb91083abc10fa4e665c57 Mon Sep 17 00:00:00 2001 From: akatz Date: Fri, 27 Jan 2023 15:28:49 +0100 Subject: [PATCH 09/13] new api --- .../Test/Data/InitSystemorphToMemoryForTesting.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb index 36b1ed2a..47edc4ec 100644 --- a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb +++ b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb @@ -30,7 +30,7 @@ "await Import.FromFile(\"Actuals_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, From 4fd3a16d545ccd6111bbe42829148393b03aeab9 Mon Sep 17 00:00:00 2001 From: akatz Date: Fri, 27 Jan 2023 15:32:12 +0100 Subject: [PATCH 10/13] new API in tests --- ifrs17-template/Test/SequenceImportTest.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ifrs17-template/Test/SequenceImportTest.ipynb b/ifrs17-template/Test/SequenceImportTest.ipynb index fec21ac1..754e3954 100644 --- a/ifrs17-template/Test/SequenceImportTest.ipynb +++ b/ifrs17-template/Test/SequenceImportTest.ipynb @@ -58,7 +58,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(ws1)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -71,7 +71,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(ws1)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -132,7 +132,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(ws2)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -145,7 +145,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(ws2)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, From 098d9ddf789c856622d8a8ee5a321b41dd4144f8 Mon Sep 17 00:00:00 2001 From: akatz Date: Fri, 27 Jan 2023 19:02:27 +0100 Subject: [PATCH 11/13] identation --- ifrs17/Utils/ActivityLog.ipynb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index 5c89d920..8cec2e11 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -498,9 +498,7 @@ "\n return log;", "\n }", "\n", - "\n private async Task ReportInputAndUpdateActivityAsync(ActivityLog log, ", - "\n TOptions options, ", - "\n string categoryMessage)", + "\n private async Task ReportInputAndUpdateActivityAsync(ActivityLog log, TOptions options, string categoryMessage)", "\n where TOptions: ImportOptions", "\n where TImport: KeyedImport, new()", "\n {", From 394a489c5496316b5588cc528330a3a0d58baf3c Mon Sep 17 00:00:00 2001 From: Andrey Katz <118806207+andrey-katz-systemorph@users.noreply.github.com> Date: Thu, 9 Feb 2023 18:41:07 +0100 Subject: [PATCH 12/13] Update ActivityLog.ipynb typo fixed --- ifrs17/Utils/ActivityLog.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index 8cec2e11..771ddfa9 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -489,7 +489,7 @@ "\n FileImportOptions fio => await ReportInputAndUpdateActivityAsync(log, fio, \"Import from File \"),", "\n StringImportOptions sgio => await ReportInputAndUpdateActivityAsync(log, sgio, \"Import from String\"),", "\n StreamImportOptions smio => await ReportInputAndUpdateActivityAsync(log, smio, \"Import from Stream\"),", - "\n DataSetImportOptions dsio => await ReportInputAndUpdateActivityAsync(log, dsio, \"Import fro Data Set\"),", + "\n DataSetImportOptions dsio => await ReportInputAndUpdateActivityAsync(log, dsio, \"Import from Data Set\"),", "\n _ => null,", "\n };", "\n if (activity is null) throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", @@ -588,4 +588,4 @@ "outputs": [] } ] -} \ No newline at end of file +} From 3b0b38b87950090269d04465d2b50665a7bc6eff Mon Sep 17 00:00:00 2001 From: akatz Date: Fri, 10 Feb 2023 08:51:18 +0100 Subject: [PATCH 13/13] idents fixed --- ifrs17/Utils/ActivityLog.ipynb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index 771ddfa9..03176664 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -510,15 +510,14 @@ "\n .WithDataSetReader(ImportVariable)", "\n .WithOptions(options)", "\n .InitializeImportDataAsync() as TImport;", - "\n activity = activity with {SourceId = import.Id, ", - "\n Category = categoryMessage};", + "\n activity = activity with {SourceId = import.Id, Category = categoryMessage};", "\n await DataSource.UpdateAsync(import.RepeatOnce());", "\n }", "\n catch (Exception e)", "\n {", "\n activity = activity with {SourceId = null, ", - "\n\t\t\t\t\t\t\t\t\tCategory = categoryMessage,", - "\n ExceptionMessage = e.Message};", + "\n Category = categoryMessage, ", + "\n ExceptionMessage = e.Message};", "\n }", "\n return activity;", "\n }", @@ -588,4 +587,4 @@ "outputs": [] } ] -} +} \ No newline at end of file