-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updateby rollingWAvg and more (#106)
* updateby rolling std,wavg,count,ems,emmax,emmin * Change scale factors to save some time for updateby
- Loading branch information
Showing
21 changed files
with
736 additions
and
10 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
src/it/java/io/deephaven/benchmark/tests/standard/updateby/EmMaxTickTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* Copyright (c) 2022-2023 Deephaven Data Labs and Patent Pending */ | ||
package io.deephaven.benchmark.tests.standard.updateby; | ||
|
||
import org.junit.jupiter.api.*; | ||
import io.deephaven.benchmark.tests.standard.StandardTestRunner; | ||
|
||
/** | ||
* Standard tests for the updateBy table operation. Calculates a tick-based exponential moving maximum for specified | ||
* columns and places the result into a new column for each row. | ||
*/ | ||
public class EmMaxTickTest { | ||
final StandardTestRunner runner = new StandardTestRunner(this); | ||
|
||
@BeforeEach | ||
public void setup() { | ||
runner.setRowFactor(6); | ||
runner.tables("timed"); | ||
runner.addSetupQuery("from deephaven.updateby import emmax_tick"); | ||
} | ||
|
||
@Test | ||
public void emMaxTick0Group1Col() { | ||
runner.setScaleFactors(20, 12); | ||
var q = "timed.update_by(ops=emmax_tick(time_scale_ticks=100,cols=['X=int5']))"; | ||
runner.test("EmMaxTick- No Groups 1 Col", q, "int5"); | ||
} | ||
|
||
@Test | ||
public void emMaxTick0Group2Cols() { | ||
runner.setScaleFactors(10, 7); | ||
var q = "timed.update_by(ops=emmax_tick(time_scale_ticks=100,cols=['X=int5','Y=int10']))"; | ||
runner.test("EmMaxTick- No Groups 2 Cols", q, "int5", "int10"); | ||
} | ||
|
||
|
||
@Test | ||
public void emMaxTick1Group1Col() { | ||
runner.setScaleFactors(7, 1); | ||
var q = "timed.update_by(ops=emmax_tick(time_scale_ticks=100,cols=['X=int5']), by=['str100'])"; | ||
runner.test("EmMaxTick- 1 Group 100 Unique Vals 1 Col", q, "str100", "int5"); | ||
} | ||
|
||
@Test | ||
public void emMaxTick1Group2Cols() { | ||
runner.setScaleFactors(5, 1); | ||
var q = "timed.update_by(ops=emmax_tick(time_scale_ticks=100,cols=['X=int5','Y=int10']), by=['str100'])"; | ||
runner.test("EmMaxTick- 1 Group 100 Unique Vals 2 Cols", q, "str100", "int5", "int10"); | ||
} | ||
|
||
@Test | ||
public void emMaxTick2GroupsInt() { | ||
runner.setScaleFactors(5, 1); | ||
var q = "timed.update_by(ops=emmax_tick(time_scale_ticks=100,cols=['X=int5']), by=['str100','str150'])"; | ||
runner.test("EmMaxTick- 2 Groups 15K Unique Combos 1 Col Int", q, "str100", "str150", | ||
"int5"); | ||
} | ||
|
||
@Test | ||
public void emMaxTick2GroupsFloat() { | ||
runner.setScaleFactors(5, 1); | ||
var q = "timed.update_by(ops=emmax_tick(time_scale_ticks=100,cols=['X=float5']), by=['str100','str150'])"; | ||
runner.test("EmMaxTick- 2 Groups 15K Unique Combos 1 Col Float", q, "str100", "str150", | ||
"float5"); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
src/it/java/io/deephaven/benchmark/tests/standard/updateby/EmMaxTimeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* Copyright (c) 2022-2023 Deephaven Data Labs and Patent Pending */ | ||
package io.deephaven.benchmark.tests.standard.updateby; | ||
|
||
import org.junit.jupiter.api.*; | ||
import io.deephaven.benchmark.tests.standard.StandardTestRunner; | ||
|
||
/** | ||
* Standard tests for the updateBy table operation. Calculates a time-based exponential moving maximum for specified | ||
* columns and places the result into a new column for each row. | ||
*/ | ||
public class EmMaxTimeTest { | ||
final StandardTestRunner runner = new StandardTestRunner(this); | ||
|
||
@BeforeEach | ||
public void setup() { | ||
runner.setRowFactor(6); | ||
runner.tables("timed"); | ||
runner.addSetupQuery("from deephaven.updateby import emmax_time"); | ||
} | ||
|
||
@Test | ||
public void emMaxTime0Group1Col() { | ||
var q = "timed.update_by(ops=emmax_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=int5']))"; | ||
runner.test("EmMaxTime- No Groups 1 Col", q, "int5", "timestamp"); | ||
} | ||
|
||
@Test | ||
public void emMaxTime1Group1Col() { | ||
var q = "timed.update_by(ops=emmax_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=int5']), by=['str100'])"; | ||
runner.test("EmMaxTime- 1 Group 100 Unique Vals 1 Col", q, "str100", "int5", "timestamp"); | ||
} | ||
|
||
@Test | ||
public void emMaxTime2GroupsInt() { | ||
var q = "timed.update_by(ops=emmax_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=int5']), by=['str100','str150'])"; | ||
runner.test("EmMaxTime- 2 Groups 15K Unique Combos 1 Col Int", q, "str100", "str150", | ||
"int5", "timestamp"); | ||
} | ||
|
||
@Test | ||
public void emMaxTime2GroupsFloat() { | ||
var q = "timed.update_by(ops=emmax_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=float5']), by=['str100','str150'])"; | ||
runner.test("EmMaxTime- 2 Groups 15K Unique Combos 1 Col Float", q, "str100", "str150", | ||
"float5", "timestamp"); | ||
} | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
src/it/java/io/deephaven/benchmark/tests/standard/updateby/EmMinTickTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* Copyright (c) 2022-2023 Deephaven Data Labs and Patent Pending */ | ||
package io.deephaven.benchmark.tests.standard.updateby; | ||
|
||
import org.junit.jupiter.api.*; | ||
import io.deephaven.benchmark.tests.standard.StandardTestRunner; | ||
|
||
/** | ||
* Standard tests for the updateBy table operation. Calculates a tick-based exponential moving minimum for specified | ||
* columns and places the result into a new column for each row. | ||
*/ | ||
public class EmMinTickTest { | ||
final StandardTestRunner runner = new StandardTestRunner(this); | ||
|
||
@BeforeEach | ||
public void setup() { | ||
runner.setRowFactor(6); | ||
runner.tables("timed"); | ||
runner.addSetupQuery("from deephaven.updateby import emmin_tick"); | ||
} | ||
|
||
@Test | ||
public void emMinTick0Group1Col() { | ||
runner.setScaleFactors(20, 12); | ||
var q = "timed.update_by(ops=emmin_tick(time_scale_ticks=100,cols=['X=int5']))"; | ||
runner.test("EmMinTick- No Groups 1 Col", q, "int5"); | ||
} | ||
|
||
@Test | ||
public void emMinTick0Group2Cols() { | ||
runner.setScaleFactors(10, 7); | ||
var q = "timed.update_by(ops=emmin_tick(time_scale_ticks=100,cols=['X=int5','Y=int10']))"; | ||
runner.test("EmMinTick- No Groups 2 Cols", q, "int5", "int10"); | ||
} | ||
|
||
@Test | ||
public void emMinTick1Group1Col() { | ||
runner.setScaleFactors(7, 1); | ||
var q = "timed.update_by(ops=emmin_tick(time_scale_ticks=100,cols=['X=int5']), by=['str100'])"; | ||
runner.test("EmMinTick- 1 Group 100 Unique Vals 1 Col", q, "str100", "int5"); | ||
} | ||
|
||
@Test | ||
public void emMinTick1Group2Cols() { | ||
runner.setScaleFactors(5, 1); | ||
var q = "timed.update_by(ops=emmin_tick(time_scale_ticks=100,cols=['X=int5','Y=int10']), by=['str100'])"; | ||
runner.test("EmMinTick- 1 Group 100 Unique Vals 2 Cols", q, "str100", "int5", "int10"); | ||
} | ||
|
||
@Test | ||
public void emMinTick2GroupsInt() { | ||
runner.setScaleFactors(5, 1); | ||
var q = "timed.update_by(ops=emmin_tick(time_scale_ticks=100,cols=['X=int5']), by=['str100','str150'])"; | ||
runner.test("EmMinTick- 2 Groups 15K Unique Combos 1 Col Int", q, "str100", "str150", | ||
"int5"); | ||
} | ||
|
||
@Test | ||
public void emMinTick2GroupsFloat() { | ||
runner.setScaleFactors(5, 1); | ||
var q = "timed.update_by(ops=emmin_tick(time_scale_ticks=100,cols=['X=float5']), by=['str100','str150'])"; | ||
runner.test("EmMinTick- 2 Groups 15K Unique Combos 1 Col Float", q, "str100", "str150", | ||
"float5"); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
src/it/java/io/deephaven/benchmark/tests/standard/updateby/EmMinTimeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* Copyright (c) 2022-2023 Deephaven Data Labs and Patent Pending */ | ||
package io.deephaven.benchmark.tests.standard.updateby; | ||
|
||
import org.junit.jupiter.api.*; | ||
import io.deephaven.benchmark.tests.standard.StandardTestRunner; | ||
|
||
/** | ||
* Standard tests for the updateBy table operation. Calculates a time-based exponential moving minimum for specified | ||
* columns and places the result into a new column for each row. | ||
*/ | ||
public class EmMinTimeTest { | ||
final StandardTestRunner runner = new StandardTestRunner(this); | ||
|
||
@BeforeEach | ||
public void setup() { | ||
runner.setRowFactor(6); | ||
runner.tables("timed"); | ||
runner.addSetupQuery("from deephaven.updateby import emmin_time"); | ||
} | ||
|
||
@Test | ||
public void emMinTime0Group1Col() { | ||
var q = "timed.update_by(ops=emmin_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=int5']))"; | ||
runner.test("EmMinTime- No Groups 1 Col", q, "int5", "timestamp"); | ||
} | ||
|
||
@Test | ||
public void emMinTime1Group1Col() { | ||
var q = "timed.update_by(ops=emmin_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=int5']), by=['str100'])"; | ||
runner.test("EmMinTime- 1 Group 100 Unique Vals 1 Col", q, "str100", "int5", "timestamp"); | ||
} | ||
|
||
@Test | ||
public void emMinTime2GroupsInt() { | ||
var q = "timed.update_by(ops=emmin_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=int5']), by=['str100','str150'])"; | ||
runner.test("EmMinTime- 2 Groups 15K Unique Combos 1 Col Int", q, "str100", "str150", | ||
"int5", "timestamp"); | ||
} | ||
|
||
@Test | ||
public void emMinTime2GroupsFloat() { | ||
var q = "timed.update_by(ops=emmin_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=float5']), by=['str100','str150'])"; | ||
runner.test("EmMinTime- 2 Groups 15K Unique Combos 1 Col Float", q, "str100", "str150", | ||
"float5", "timestamp"); | ||
} | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
src/it/java/io/deephaven/benchmark/tests/standard/updateby/EmsTickTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* Copyright (c) 2022-2023 Deephaven Data Labs and Patent Pending */ | ||
package io.deephaven.benchmark.tests.standard.updateby; | ||
|
||
import org.junit.jupiter.api.*; | ||
import io.deephaven.benchmark.tests.standard.StandardTestRunner; | ||
|
||
/** | ||
* Standard tests for the updateBy table operation. Calculates a tick-based exponential moving sum for specified | ||
* columns and places the result into a new column for each row. | ||
*/ | ||
public class EmsTickTest { | ||
final StandardTestRunner runner = new StandardTestRunner(this); | ||
|
||
@BeforeEach | ||
public void setup() { | ||
runner.setRowFactor(6); | ||
runner.tables("timed"); | ||
runner.addSetupQuery("from deephaven.updateby import ems_tick"); | ||
} | ||
|
||
@Test | ||
public void emsTick0Group1Col() { | ||
runner.setScaleFactors(30, 15); | ||
var q = "timed.update_by(ops=ems_tick(time_scale_ticks=100,cols=['X=int5']))"; | ||
runner.test("EmsTick- No Groups 1 Col", q, "int5"); | ||
} | ||
|
||
@Test | ||
public void emsTick0Group2Cols() { | ||
runner.setScaleFactors(15, 8); | ||
var q = "timed.update_by(ops=ems_tick(time_scale_ticks=100,cols=['X=int5','Y=int10']))"; | ||
runner.test("EmsTick- No Groups 2 Cols", q, "int5", "int10"); | ||
} | ||
|
||
@Test | ||
public void emsTick1Group1Col() { | ||
runner.setScaleFactors(9, 1); | ||
var q = "timed.update_by(ops=ems_tick(time_scale_ticks=100,cols=['X=int5']), by=['str100'])"; | ||
runner.test("EmsTick- 1 Group 100 Unique Vals 1 Col", q, "str100", "int5"); | ||
} | ||
|
||
@Test | ||
public void emsTick1Group2Cols() { | ||
runner.setScaleFactors(5, 1); | ||
var q = "timed.update_by(ops=ems_tick(time_scale_ticks=100,cols=['X=int5','Y=int10']), by=['str100'])"; | ||
runner.test("EmsTick- 1 Group 100 Unique Vals 2 Cols", q, "str100", "int5", "int10"); | ||
} | ||
|
||
@Test | ||
public void emsTick2GroupsInt() { | ||
runner.setScaleFactors(5, 1); | ||
var q = "timed.update_by(ops=ems_tick(time_scale_ticks=100,cols=['X=int5']), by=['str100','str150'])"; | ||
runner.test("EmsTick- 2 Groups 15K Unique Combos 1 Col Int", q, "str100", "str150", | ||
"int5"); | ||
} | ||
|
||
@Test | ||
public void emsTick2GroupsFloat() { | ||
runner.setScaleFactors(5, 1); | ||
var q = "timed.update_by(ops=ems_tick(time_scale_ticks=100,cols=['X=float5']), by=['str100','str150'])"; | ||
runner.test("EmsTick- 2 Groups 15K Unique Combos 1 Col Float", q, "str100", "str150", | ||
"float5"); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
src/it/java/io/deephaven/benchmark/tests/standard/updateby/EmsTimeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* Copyright (c) 2022-2023 Deephaven Data Labs and Patent Pending */ | ||
package io.deephaven.benchmark.tests.standard.updateby; | ||
|
||
import org.junit.jupiter.api.*; | ||
import io.deephaven.benchmark.tests.standard.StandardTestRunner; | ||
|
||
/** | ||
* Standard tests for the updateBy table operation. Calculates a time-based exponential moving average for specified | ||
* columns and places the result into a new column for each row. | ||
*/ | ||
public class EmsTimeTest { | ||
final StandardTestRunner runner = new StandardTestRunner(this); | ||
|
||
@BeforeEach | ||
public void setup() { | ||
runner.setRowFactor(6); | ||
runner.tables("timed"); | ||
runner.addSetupQuery("from deephaven.updateby import ems_time"); | ||
} | ||
|
||
@Test | ||
public void emsTime0Group1Col() { | ||
var q = "timed.update_by(ops=ems_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=int5']))"; | ||
runner.test("EmsTime- No Groups 1 Col", q, "int5", "timestamp"); | ||
} | ||
|
||
@Test | ||
public void emsTime1Group1Col() { | ||
var q = "timed.update_by(ops=ems_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=int5']), by=['str100'])"; | ||
runner.test("EmsTime- 1 Group 100 Unique Vals 1 Col", q, "str100", "int5", "timestamp"); | ||
} | ||
|
||
@Test | ||
public void emsTime2GroupsInt() { | ||
var q = "timed.update_by(ops=ems_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=int5']), by=['str100','str150'])"; | ||
runner.test("EmsTime- 2 Groups 15K Unique Combos 1 Col Int", q, "str100", "str150", | ||
"int5", "timestamp"); | ||
} | ||
|
||
@Test | ||
public void emsTime2GroupsFloat() { | ||
var q = "timed.update_by(ops=ems_time(ts_col='timestamp', time_scale='00:00:02', cols=['X=float5']), by=['str100','str150'])"; | ||
runner.test("EmsTime- 2 Groups 15K Unique Combos 1 Col Float", q, "str100", "str150", | ||
"float5", "timestamp"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.