-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updateby rollingWAvg and more #106
Merged
stanbrub
merged 2 commits into
deephaven:main
from
stanbrub:updateby-rollingWAvg-and-more-2
May 16, 2023
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exponential moving sum (not average)