Skip to content

Commit

Permalink
Fix JS API examples after deephaven2 -> deephaven rename (#2170)
Browse files Browse the repository at this point in the history
- Fix all python code snippets in the JS API examples
- Tested each page accessible from http://localhost:10000/jsapi/
  • Loading branch information
mofojed authored Apr 7, 2022
1 parent ac87f19 commit d2c8106
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ <h3>Table data (bold headers are keys)</h3>
ide = await connection.startSession("python");

await ide.runCode(`
from deephaven.TableTools import emptyTable
from deephaven import empty_table
import jpy
KeyedArrayBackedMutableTable = jpy.get_type('io.deephaven.engine.table.impl.util.KeyedArrayBackedMutableTable')
remoteTable = KeyedArrayBackedMutableTable.make(emptyTable(0).updateView('id=0', 'data=""'), 'id')
remoteTable = KeyedArrayBackedMutableTable.make(empty_table(0).update_view(['id=0', 'data=""']).j_table, 'id')
`)
} else if (types.indexOf("groovy") !== -1) {
ide = await connection.startSession("groovy");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ <h3>Table data</h3>
ide = await connection.startSession("python");
// Run code that will create a static table with 10 rows and three columns, I, J, K
await ide.runCode(`
from deephaven.TableTools import emptyTable
remoteTable = emptyTable(10).updateView('I=i', 'J=I*I', 'K=i%2==0?"Hello":"World"')
from deephaven import empty_table
remoteTable = empty_table(10).update_view(['I=i', 'J=I*I', 'K=i%2==0?"Hello":"World"'])
`)
} else if (types.indexOf("groovy") !== -1) {
// Start a groovy session
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ <h3>Filter Details</h3>
if (types.indexOf("python") !== -1) {
ide = await connection.startSession("python");
await ide.runCode(`
from deephaven.TableTools import timeTable
remoteTable = timeTable("00:00:01").updateView("I=i", "J=I*I", "K=I%100").lastBy("K")
from deephaven import time_table
remoteTable = time_table("00:00:01").update_view(["I=i", "J=I*I", "K=I%100"]).last_by("K")
`)
} else if (types.indexOf("groovy") !== -1) {
ide = await connection.startSession("groovy");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ <h3>Selected table data (click headers to sort)</h3>
if (types.indexOf("python") !== -1) {
ide = await connection.startSession("python");
await ide.runCode(`
from deephaven.TableTools import timeTable
remoteTable = timeTable("00:00:01").updateView("I=i", "J=I*I", "K=I%100").lastBy("K")
from deephaven import time_table
remoteTable = time_table("00:00:01").update_view(["I=i", "J=I*I", "K=I%100"]).last_by("K")
`)
} else if (types.indexOf("groovy") !== -1) {
ide = await connection.startSession("groovy");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ <h3>Table data</h3>
if (types.indexOf("python") !== -1) {
ide = await connection.startSession("python");
await ide.runCode(`
from deephaven.TableTools import timeTable
remoteTable = timeTable("00:00:01").updateView("I=i", "J=I*I", "K=I%100").lastBy("K")
from deephaven import time_table
remoteTable = time_table("00:00:01").update_view(["I=i", "J=I*I", "K=I%100"]).last_by(by = ["K"])
`)
} else if (types.indexOf("groovy") !== -1) {
ide = await connection.startSession("groovy");
Expand Down

0 comments on commit d2c8106

Please sign in to comment.