Open nbauernfeind opened 3 years ago
Devin and I believe that we can offer an alternative python application mode experience that would work as follows:
from deephaven import TableTools from deephaven import Application def demo_implicit(): print("Running Implicit Demo.") size_imp = 42 hello_imp = TableTools.emptyTable(size) world_imp = TableTools.timeTable("00:00:01") Application.initialize_implicitly(demo_implicit)
Here hello_imp and world_imp would both be exported as Fields, but none of the variables would leak to the QueryScope.
hello_imp
world_imp
Note that this is in contrast to the other "pretty" python application mode approach:
from deephaven import TableTools from deephaven import Application, ApplicationState def demo_app(app: ApplicationState): print("Running Strict App Demo.") size = 42 app.setField("hello", TableTools.emptyTable(size)) app.setField("world", TableTools.timeTable("00:00:01")) Application.initialize(demo_app)
We've got a version of initialize_implicitly that works when the invoked function uses global.
global
Devin and I believe that we can offer an alternative python application mode experience that would work as follows:
Here
hello_imp
andworld_imp
would both be exported as Fields, but none of the variables would leak to the QueryScope.Note that this is in contrast to the other "pretty" python application mode approach: