blob: a23fe78187e074311bccad7ec76c6032502b903f [file] [log] [blame]
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Script &mdash; SystemDS 2.0.0 documentation</title>
<link rel="stylesheet" href="../../static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../static/documentation_options.js"></script>
<script src="../../static/jquery.js"></script>
<script src="../../static/underscore.js"></script>
<script src="../../static/doctools.js"></script>
<script src="../../static/language_data.js"></script>
<script type="text/javascript" src="../../static/js/theme.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Converters" href="../utils/converters.html" />
<link rel="prev" title="Dag" href="dag.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> SystemDS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Getting Started:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../getting_started/install.html">Install SystemDS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../getting_started/simple_examples.html">QuickStart</a></li>
</ul>
<p class="caption"><span class="caption-text">Guides</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../guide/federated.html">Federated Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../guide/algorithms_basics.html">Built-in Algorithms</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../operator/algorithms.html">Algorithms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../context/systemds_context.html">SystemDSContext</a></li>
<li class="toctree-l1"><a class="reference internal" href="../matrix/matrix.html">Matrix</a></li>
<li class="toctree-l1"><a class="reference internal" href="../matrix/federated.html">Federated</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/operation_node.html">Operation Node</a></li>
</ul>
<p class="caption"><span class="caption-text">Internals API</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="dag.html">Dag</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Script</a></li>
<li class="toctree-l1"><a class="reference internal" href="../utils/converters.html">Converters</a></li>
<li class="toctree-l1"><a class="reference internal" href="../utils/helpers.html">Helpers</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">SystemDS</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li>Script</li>
<li class="wy-breadcrumbs-aside">
<a href="../../sources/api/script_building/script.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="script">
<h1>Script<a class="headerlink" href="#script" title="Permalink to this headline"></a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>OPS! For internal use!</p>
</div>
<span class="target" id="module-systemds.script_building.script"></span><dl class="py class">
<dt id="systemds.script_building.script.DMLScript">
<em class="property">class </em><code class="sig-prename descclassname">systemds.script_building.script.</code><code class="sig-name descname">DMLScript</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">context</span><span class="p">:</span> <span class="n">SystemDSContext</span></em><span class="sig-paren">)</span><a class="headerlink" href="#systemds.script_building.script.DMLScript" title="Permalink to this definition"></a></dt>
<dd><p>DMLScript is the class used to describe our intended behavior in DML. This script can be then executed to
get the results.</p>
<p>TODO caching</p>
<p>TODO rerun with different inputs without recompilation</p>
<dl class="py method">
<dt id="systemds.script_building.script.DMLScript.add_code">
<code class="sig-name descname">add_code</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">code</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#systemds.script_building.script.DMLScript.add_code" title="Permalink to this definition"></a></dt>
<dd><p>Add a dml code line to our script</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>code</strong> – the dml code line</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="systemds.script_building.script.DMLScript.add_input_from_python">
<code class="sig-name descname">add_input_from_python</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">var_name</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">input_var</span><span class="p">:</span> <span class="n"><a class="reference internal" href="dag.html#systemds.script_building.dag.DAGNode" title="systemds.script_building.dag.DAGNode">systemds.script_building.dag.DAGNode</a></span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#systemds.script_building.script.DMLScript.add_input_from_python" title="Permalink to this definition"></a></dt>
<dd><p>Add an input for our preparedScript. Should only be executed for data that is python local.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>var_name</strong> – name of variable</p></li>
<li><p><strong>input_var</strong> – the DAGNode object which has data</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="systemds.script_building.script.DMLScript.build_code">
<code class="sig-name descname">build_code</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dag_root</span><span class="p">:</span> <span class="n"><a class="reference internal" href="dag.html#systemds.script_building.dag.DAGNode" title="systemds.script_building.dag.DAGNode">systemds.script_building.dag.DAGNode</a></span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#systemds.script_building.script.DMLScript.build_code" title="Permalink to this definition"></a></dt>
<dd><p>Builds code from our DAG</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dag_root</strong> – the topmost operation of our DAG, result of operation will be output</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="systemds.script_building.script.DMLScript.execute">
<code class="sig-name descname">execute</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; py4j.java_gateway.JavaObject<a class="headerlink" href="#systemds.script_building.script.DMLScript.execute" title="Permalink to this definition"></a></dt>
<dd><p>If not already created, create a preparedScript from our DMLCode, pass python local data to our prepared
script, then execute our script and return the resultVariables</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>resultVariables of our execution</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="systemds.script_building.script.DMLScript.execute_with_lineage">
<code class="sig-name descname">execute_with_lineage</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; Tuple<span class="p">[</span>py4j.java_gateway.JavaObject<span class="p">, </span>str<span class="p">]</span><a class="headerlink" href="#systemds.script_building.script.DMLScript.execute_with_lineage" title="Permalink to this definition"></a></dt>
<dd><p>If not already created, create a preparedScript from our DMLCode, pass python local data to our prepared
script, then execute our script and return the resultVariables</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>resultVariables of our execution and the string lineage trace</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../utils/converters.html" class="btn btn-neutral float-right" title="Converters" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="dag.html" class="btn btn-neutral float-left" title="Dag" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2020, Apache SystemDS
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>