SystemML Class
dev/std/eval/python
Summary
Perform the eval() function in Python, allowing many mathematical operations to be performed
Status
Under development - interface likely to change

Overview

Warnings
  • This component is under development - this means that its interface may change in future (and its class name definitely will). You should be aware that you will have to make changes to any scripts where you use it to run against a future BRAHMS release.

This Process allows you to perform eval() in Python. This is not the fastest way to get computation done, so you should consider authoring custom Processes for operations once you have settled on them. However, this wrapper should prove very useful for prototyping.

Connectivity

  • N inputs, which will usually be std/data/numeric (but don't have to to be).
  • 1 output, the result of the eval() function.

State

This Process stores its State in DataML.

function
The function to perform, with the data from an input X represented as "$X" (see example, below).

Example

Taken from brahms_test.

Matlab Console
% empty system sys = sml_system; % pars fS = 1000; t_stop = 2; t = (1:(fS*t_stop))/fS; % add source "t" state = []; state.data = t; state.repeat = true; sys = sys.addprocess('t', 'std/2009/source/numeric', fS, state); % add source "s" state = []; state.data = exp(t*i*2*pi*10); state.repeat = true; sys = sys.addprocess('s', 'std/2009/source/numeric', fS, state); % add eval block state = []; state.function = 'real($s)+3*exp(-$t)'; sys = sys.addprocess('eval', 'dev/std/eval/python', fS, state); % links sys = sys.link('t>out', 'eval<t', 0); sys = sys.link('s>out', 'eval<s', 0); % execution exe = brahms_execution; exe.name = test; exe.stop = t_stop; exe.all = true; % execute [out, rep] = brahms(sys, exe); % plot plot(t, out.eval.out) xlabel('t') ylabel('eval')