public void Deserialize() { _unitUnderTest.CreateDb(DbRootDir, TestDbName); var secondManagement = new DbManagement(true); secondManagement.GetDbNames().Count.Should().Be(1); }
public void DewPointTest() { var db = new DbManagement().GetDb("f*x"); var queryTable = db.GetTable<float>("Aussen.Wetterstation.(?<k>.*?)$", "time > now() - 1y"); var result = queryTable .Transform(i => i.GroupByHours(1, o => o.Mean())) .DewPoint("Temperatur", "Feuchtigkeit", "Taupunkt"); }
public void DynamicTableInScript() { var db = new DbManagement().GetDb("f*x"); var result = new ScriptingEngine(db, @"db.GetTable<float>(""Aussen.Wetterstation.(?<k>[TF]).*?$"", ""time > now() - 1M"") .Transform(i => i.GroupByHours(1, o => o.Mean())) .ZipAndAdd(""Sum"", t => t.T + t.F)").Execute(); }
public void FixFromTo() { var dbm = new DbManagement(); var db = dbm.GetDb("f*x"); var sw = Stopwatch.StartNew(); var mix = db.Collect(db.GetSerie<float>("Aussen.Wetterstation.Temperatur", "time > now() - 2d") .GroupBy("6h", a => a.Mean()), db.GetTable<float>(".*Feuchtigkeit", "time > now() - 2d")); sw.Stop(); }
public void MovingAverage() { var db = new DbManagement().GetDb("f*x"); var time = "time < now() - 14d and time > now() - 21d"; var serie = db.GetSerie<float>("Aussen.Wetterstation.Temperatur", time) .Group( g => g.ByTime.Minutes(10) .TimeStampIsMiddle() .ExpandTimeRangeByFactor(20) .Aggregate(a => a.MeanByTime())); }
public void AllCalcTempValuesTest() { var db = new DbManagement().GetDb("f*x"); var queryTable = db.GetTable<float>("Aussen.Wetterstation.(?<k>.*?)$", "time > now() - 1M"); var result = queryTable .Transform(i => i.GroupByHours(1, o => o.Mean())) .AddDewPoint("Temperatur", "Feuchtigkeit") .AddAbsoluteHumidity("Temperatur", "Feuchtigkeit") .AddHumidex("Temperatur", "Feuchtigkeit") .AddHeatIndex("Temperatur", "Feuchtigkeit") .AddSleetLine("Temperatur", "Feuchtigkeit", 440) .AddSnowLine("Temperatur", "Feuchtigkeit", 440) .RemoveSerie("Feuchtigkeit"); }
public void Setup() { _unitUnderTest = new DbManagement(true); _unitUnderTest.DetachAllDbs(); }
public void DynamicWithRealDb() { var db = new DbManagement().GetDb("f*x"); var queryTable = db.GetTable<float>("Aussen.Wetterstation.(?<k>[TF]).*?$", "time > now() - 1M"); var result = queryTable .Group(g => g.ByTime.Hours(1).Aggregate(o => o.Mean())) .Calc(t => t.Sum = t.T + t.F); result.Series.Count().Should().Be(3); result = result.RemoveDbSeries(); result.Series.Count().Should().Be(1); }
public void MultipleTableGroups() { var db = new DbManagement().GetDb("f*x"); var queryTable = db.GetTable<float>("Innen.(?<g>.*).(?<k>Temperatur|Feuchtigkeit)$", "time > now() - 1M"); var result = queryTable .Transform(i => i.GroupByHours(1, o => o.Mean())) .ZipToNew("Sum", t => t.Temperatur + t.Feuchtigkeit); }
public void MultipleAbsoluteHumidityTableGroups() { var db = new DbManagement().GetDb("f*x"); var result = db.GetTable<float>("Innen.(?<g>.*).(?<k>Temperatur|Feuchtigkeit)$", "time > now() - 1M") .Transform(g => g.Group(i => i.ByTime.Hours(1).ExpandTimeRangeByFactor(7).Aggregate(o => o.Mean()))) .GroupSeries().Transform(t => t.AbsoluteHumidity("Temperatur", "Feuchtigkeit")).MergeTables(); }
public void SchneefallTest() { var db = new DbManagement().GetDb("Haus"); var result = db.Schneefallgrenze("time > now() - 1d", "1m", 50); }
public void DewPoinTest() { var db = new DbManagement().GetDb("Haus"); var result = db.DewPoint("Hm.*(?<g>(EG|OG).*)(?<k>Temp|Hum)","time > now() - 1d", "1m", "Temp", "Hum", 50); }