doc-exports/docs/modelarts/umn/devtool-modelarts_0212.html
Lai, Weijian 4e4b2d5f6d ModelArts UMN 23.3.0 Version.
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Lai, Weijian <laiweijian4@huawei.com>
Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
2024-06-26 07:03:02 +00:00

35 lines
9.3 KiB
HTML

<a name="EN-US_TOPIC_0000001846056313"></a><a name="EN-US_TOPIC_0000001846056313"></a>
<h1 class="topictitle1">Code Parametrization Plug-in</h1>
<div id="body32001227"><div class="section" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_section15178143018477"><h4 class="sectiontitle">Use Guide</h4><ul id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_ul13081050114815"><li id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_li887271316443">The <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b04103264206">Add Form</strong> and <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b2410162610207">Edit Form</strong> buttons are available only to the shortcut menu of code cells.<div class="fignone" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_fig4195103317548"><span class="figcap"><b>Figure 1 </b>Viewing a code cell</span><br><span><img id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_image03085505485" src="figure/en-us_image_0000001846137413.png" width="NaN" height="NaN"></span></div>
</li></ul>
<ul id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_ul1169712592471"><li id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_li12697195918473">After opening new code, add a form before editing it.<div class="fignone" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_fig3931162704811"><span class="figcap"><b>Figure 2 </b>Shortcut menu of code cells</span><br><span><img id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_image2071422117273" src="figure/en-us_image_0000001799498236.png" width="497.42" height="261.877" title="Click to enlarge" class="imgResize"></span></div>
</li></ul>
</div>
<p id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_p179015205381"></p>
<div class="section" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_section135951730185620"><h4 class="sectiontitle">Add Form</h4><p id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_p20398192011577">If you click <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b10378141821019">Add Form</strong>, a code cell will be split into the code and form edit area. Click <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b117271541181116">Edit</strong> on the right of the form to change the default title.</p>
<div class="fignone" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_fig19247184119564"><span class="figcap"><b>Figure 3 </b>Two edit areas</span><br><span><img id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_image10505158122310" src="figure/en-us_image_0000001846057345.png" width="523.6875" height="22.472877" title="Click to enlarge" class="imgResize"></span></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_section144126215588"><h4 class="sectiontitle">Edit Form</h4><p id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_p1183253810589">If you click <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b133373384126">Edit Form</strong>, four sub-options will be displayed: <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b12308843181211">Add new form field</strong>, <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b224134591217">Hide code</strong>, <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b957144718120">Hide form</strong>, and <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b446574917129">Show All</strong>.</p>
</div>
<ul id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_ul2166716588"><li id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_li3164775818">You can set the form field type to <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b823195151416">dropdown</strong>, <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b854496121414">input</strong>, and <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b343988141411">slider</strong>. See <a href="#EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_fig86841216610">Figure 4</a>. Each time a field is added, the corresponding variable is added to the code and form areas. If a value in the form area is changed, the corresponding variable in the code area is also changed.<div class="note" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_note721273918312"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_p42121939539">When creating a dropdown form, click <span class="parmname" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_parmname421215394315"><b>ADD Item</b></span> and add at least two items. See <a href="#EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_fig946213314619">Figure 5</a>.</p>
</div></div>
<div class="fignone" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_fig86841216610"><a name="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_fig86841216610"></a><a name="en-us_topic_0000001278648233_fig86841216610"></a><span class="figcap"><b>Figure 4 </b>Form style of dropdown, input, and slider </span><br><span><img id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_image11684821568" src="figure/en-us_image_0000001799498252.png" height="144.3449" width="492.1" title="Click to enlarge" class="imgResize"></span></div>
<div class="fignone" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_fig946213314619"><a name="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_fig946213314619"></a><a name="en-us_topic_0000001278648233_fig946213314619"></a><span class="figcap"><b>Figure 5 </b>Creating a dropdown form</span><br><span><img id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_image1446912682717" src="figure/en-us_image_0000001846057329.png" width="492.1" height="281.4679" title="Click to enlarge" class="imgResize"></span></div>
<div class="fignone" id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_fig16901112315137"><span class="figcap"><b>Figure 6 </b>Deleting a form</span><br><span><img id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_image37784542245" src="figure/en-us_image_0000001846137397.png" width="492.1" height="105.8015" title="Click to enlarge" class="imgResize"></span></div>
<ul id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_ul145271618171114"><li id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_li19489155935814">If the form field type is set to <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b365132192810">dropdown</strong>, the supported variable types are <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b36515216289">raw</strong> and <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b565225289">string</strong>.<span><img id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_image1666026284" src="figure/en-us_image_0000001846058197.png"></span> </li><li id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_li61281350165917">If the form field type is set to <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b1233732872816">input</strong>, the supported variable types are <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b833782862818">boolean</strong>, <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b193371528162814">date</strong>, <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b18337162813283">integer</strong>, <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b15338528132812">number</strong>, <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b19338828182814">raw</strong>, and <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b19338628122811">string</strong>.</li><li id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_li137212054101215">If the form field type is set to <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b165435381610">slider</strong>, the minimum value, maximum value, and step can be set.</li></ul>
</li><li id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_li11110850121412">If you click <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b1435243141716">Hide code</strong>, the code area will be hidden.</li><li id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_li6668418141513">If you click <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b13294312131713">Hide form</strong>, the form area will be hidden.</li><li id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_li13498194113156">If you click <strong id="EN-US_TOPIC_0000001846056313__en-us_topic_0000001278648233_b522211591715">Show All</strong>, both the code and form areas will be displayed.</li></ul>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="devtool-modelarts_0211.html">JupyterLab Plug-ins</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>