Moved Model Name and Predictor Model Name to

Property Configuration
This commit is contained in:
2022-10-09 08:50:48 -07:00
parent a6168f5976
commit d951ad6696
34 changed files with 181 additions and 185 deletions

View File

@ -1,7 +1,6 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using View_by_Distance.Shared.Models.Methods;
using View_by_Distance.Shared.Models.Stateless;
namespace View_by_Distance.Instance.Models;
@ -103,7 +102,7 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
}
}
private void WriteGroup(Property.Models.Configuration configuration, Model? model, PredictorModel? predictorModel, string outputResolution, List<Tuple<string, Dictionary<int, G_Index>>> indexInfoTuples)
private void WriteGroup(Property.Models.Configuration configuration, string outputResolution, List<Tuple<string, Dictionary<int, G_Index>>> indexInfoTuples)
{
string json;
G_Index[] indices;
@ -111,14 +110,14 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
foreach (Tuple<string, Dictionary<int, G_Index>> tuple in indexInfoTuples)
{
indices = (from l in tuple.Item2 select l.Value).ToArray();
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, model, predictorModel, tuple.Item1, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: string.Empty, collectionDescription: "Unknown A");
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, tuple.Item1, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: string.Empty, collectionDescription: "Unknown A");
json = JsonSerializer.Serialize(indices, _WriteIndentedJsonSerializerOptions);
if (!Shared.Models.Stateless.Methods.IPath.WriteAllText(string.Concat(directoryInfoCollection[0].Replace("<>", "[]"), ".json"), json, updateDateWhenMatches: true, compareBeforeWrite: true))
continue;
}
}
private void AppendTSV(Property.Models.Configuration configuration, Model? model, PredictorModel? predictorModel, string outputResolution, Dictionary<string, List<Tuple<string, Shared.Models.Property>>> filePropertiesKeyValuePairs)
private void AppendTSV(Property.Models.Configuration configuration, string outputResolution, Dictionary<string, List<Tuple<string, Shared.Models.Property>>> filePropertiesKeyValuePairs)
{
Shared.Models.Property property;
DateTime?[] dateTimes;
@ -137,11 +136,11 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
maximumDateTime = (from l in dateTimes where l.HasValue select l.Value).Max();
minimumDateTime = (from l in dateTimes where l.HasValue select l.Value).Min();
}
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, model, predictorModel, tuples.Key, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: "Unkown B", collectionDescription: string.Empty);
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, tuples.Key, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: "Unkown B", collectionDescription: string.Empty);
}
}
internal void SetIndex(Property.Models.Configuration configuration, Model? model, PredictorModel? predictorModel, string outputResolution, Dictionary<string, List<Tuple<string, Shared.Models.Property>>> filePropertiesKeyValuePairs)
internal void SetIndex(Property.Models.Configuration configuration, string outputResolution, Dictionary<string, List<Tuple<string, Shared.Models.Property>>> filePropertiesKeyValuePairs)
{
FileInfo fileInfo;
G_Index indexInfo;
@ -166,7 +165,7 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
foreach (KeyValuePair<string, List<Tuple<string, Shared.Models.Property>>> tuples in filePropertiesKeyValuePairs)
{
valuePairs = new Dictionary<int, G_Index>();
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, model, predictorModel, tuples.Key, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: "Unknown C", collectionDescription: string.Empty);
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, tuples.Key, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: "Unknown C", collectionDescription: string.Empty);
foreach (Tuple<string, Shared.Models.Property> tuple in tuples.Value)
{
fileInfo = new FileInfo(Path.Combine(directoryInfoCollection[0].Replace("<>", "{}"), string.Concat(Path.GetFileNameWithoutExtension(tuple.Item1), ".json")));
@ -202,8 +201,8 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
throw new Exception(string.Join(Environment.NewLine, parseExceptions));
if (neededTuples.Any())
throw new Exception();
WriteGroup(configuration, model, predictorModel, outputResolution, indexInfoTuples);
AppendTSV(configuration, model, predictorModel, outputResolution, filePropertiesKeyValuePairs);
WriteGroup(configuration, outputResolution, indexInfoTuples);
AppendTSV(configuration, outputResolution, filePropertiesKeyValuePairs);
}
string Shared.Models.Stateless.Methods.IIndex.TestStatic_GetJson(string jsonFileFullName, FileInfo fileInfo) => throw new NotImplementedException();