From 5480f79f5a88fe30de024517d360fc2dcfdb9c59 Mon Sep 17 00:00:00 2001 From: ahmednfwela Date: Tue, 14 Jan 2025 22:47:46 +0200 Subject: [PATCH] fix: rename current_mean and current_sigma --- lib/src/settings/distribution.dart | 16 ++++++++-------- test/search_test.dart | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/src/settings/distribution.dart b/lib/src/settings/distribution.dart index 9cb880a3..42292a9b 100644 --- a/lib/src/settings/distribution.dart +++ b/lib/src/settings/distribution.dart @@ -5,27 +5,27 @@ class DistributionShift { /// Value where the results are "packed". /// Similarity scores are translated so that they are packed around 0.5 instead - final double currentMean; + final double mean; /// standard deviation of a similarity score. /// /// Set below 0.4 to make the results less packed around the mean, and above 0.4 to make them more packed. - final double currentSigma; + final double sigma; DistributionShift({ - required this.currentMean, - required this.currentSigma, + required this.mean, + required this.sigma, }); factory DistributionShift.fromMap(Map map) { return DistributionShift( - currentMean: map['current_mean'] as double, - currentSigma: map['current_sigma'] as double, + mean: map['mean'] as double, + sigma: map['sigma'] as double, ); } Map toMap() => { - 'current_mean': currentMean, - 'current_sigma': currentSigma, + 'mean': mean, + 'sigma': sigma, }; } diff --git a/test/search_test.dart b/test/search_test.dart index e68a2830..0d9ca03e 100644 --- a/test/search_test.dart +++ b/test/search_test.dart @@ -604,8 +604,8 @@ void main() { binaryQuantized: true, dimensions: 100, distribution: DistributionShift( - currentMean: 20, - currentSigma: 5, + mean: 20, + sigma: 5, ), url: 'https://example.com', documentTemplateMaxBytes: 200, @@ -619,8 +619,8 @@ void main() { 'documentTemplate': 'a book titled {{ doc.title }}', 'dimensions': 100, 'distribution': { - 'current_mean': 20, - 'current_sigma': 5, + 'mean': 20, + 'sigma': 5, }, 'url': 'https://example.com', 'documentTemplateMaxBytes': 200, @@ -635,8 +635,8 @@ void main() { expect( deserialized.documentTemplate, 'a book titled {{ doc.title }}'); expect(deserialized.dimensions, 100); - expect(deserialized.distribution?.currentMean, 20); - expect(deserialized.distribution?.currentSigma, 5); + expect(deserialized.distribution?.mean, 20); + expect(deserialized.distribution?.sigma, 5); expect(deserialized.url, 'https://example.com'); expect(deserialized.documentTemplateMaxBytes, 200); expect(deserialized.binaryQuantized, true);