# core pack 25 nodes, in `noodlelab` and above. ## Convert (node-core.float_to_int)= ### Float To Integer `core.float_to_int` Turn a number into an integer. Inserted when a float is linked into an integer input. **Inputs** | Name | Type | Description | |---|---|---| | `value` | `float` | | | `mode` | `Literal['round', 'floor', 'ceil', 'truncate']` | Default `'round'`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `int` | | (node-core.path_to_text)= ### Path To Text `core.path_to_text` A path as text. Applied automatically when a path is linked into a text input. **Inputs** | Name | Type | Description | |---|---|---| | `path` | `Path` | | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `str` | | ## Input (node-core.boolean)= ### Boolean `core.boolean` A constant true/false switch. **Inputs** | Name | Type | Description | |---|---|---| | `value` | `bool` | Default `False`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `bool` | | (node-core.file_path)= ### File Path `core.file_path` A path to a file or folder, relative to the workspace. The node it is linked into checks that the file exists and previews it. **Inputs** | Name | Type | Description | |---|---|---| | `path` | `Path` | Default `'data.csv'`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `Path` | | (node-core.integer)= ### Integer `core.integer` A constant integer. **Inputs** | Name | Type | Description | |---|---|---| | `value` | `int` | Default `0`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `int` | | (node-core.number)= ### Number `core.number` A constant floating point value. **Inputs** | Name | Type | Description | |---|---|---| | `value` | `float` | Default `0.0`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `float` | | (node-core.read_text_file)= ### Read Text File `core.read_text_file` Read a UTF-8 text file, from the workspace or remote storage. It is read again when the file changes. **Inputs** | Name | Type | Description | |---|---|---| | `path` | `FileRef` | | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `str` | | (node-core.text)= ### Text `core.text` A constant piece of text. **Inputs** | Name | Type | Description | |---|---|---| | `value` | `str` | Default `''`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `str` | | ## Internal (node-core.repeat_iteration)= ### Iteration `core.repeat_iteration` The number of the pass, from 0. **Outputs** | Name | Type | Description | |---|---|---| | `result` | `int` | | (node-core.optimize)= ### Optimize Zone `core.optimize` Find the parameter values that make the zone's objective smallest, e.g. a sum of squared residuals to calibrate a model against data. The body runs once per point the optimiser (SciPy) tries. **Inputs** | Name | Type | Description | |---|---|---| | `parameters` | `str` | One per line: name = low .. high [unit], optionally ', start x' Default `'x = 0 .. 10'`. | | `method` | `Literal['Nelder-Mead', 'Powell', 'L-BFGS-B']` | Default `'Nelder-Mead'`. | | `tolerance` | `float` | When to stop improving Default `1e-06`. | | `max_evaluations` | `int` | Default `200`. | **Outputs** | Name | Type | Description | |---|---|---| | `best` | `dict[str, Any]` | | | `objective` | `float` | | | `evaluations` | `Any` | | | `converged` | `bool` | | | `iterations` | `int` | | (node-core.sweep_row)= ### Parameters `core.sweep_row` The parameter values of the current pass of a sweep or optimize zone. **Outputs** | Name | Type | Description | |---|---|---| | `result` | `dict[str, Any]` | | (node-core.repeat_state)= ### Repeat State `core.repeat_state` A zone's state item: its first value on the first pass, then what the previous pass produced. **Inputs** | Name | Type | Description | |---|---|---| | `initial` | `Any` | | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `Any` | | (node-core.repeat)= ### Repeat Zone `core.repeat` Run the nodes of the zone again and again, each pass starting from the state the previous one produced. ``iterations`` is the number of passes made, ``converged`` whether the Until condition came true (always true in count mode), and ``history`` the collected state of every pass. **Inputs** | Name | Type | Description | |---|---|---| | `iterations` | `int` | How many passes (mode count) Default `10`. | | `mode` | `Literal['count', 'until']` | count: a fixed number of passes; until: until the Until input is true Default `'count'`. | | `max_iterations` | `int` | Mode until: stop after this many passes Default `1000`. | **Outputs** | Name | Type | Description | |---|---|---| | `iterations` | `int` | | | `converged` | `bool` | | | `history` | `dict[str, Any]` | | (node-core.sweep_result)= ### Result `core.sweep_result` A result a sweep or optimize zone collects on each pass. **Outputs** | Name | Type | Description | |---|---|---| | `result` | `Any` | | (node-core.sweep)= ### Sweep Zone `core.sweep` Run the nodes of the zone once per row of the design, each pass getting that row's values, and collect what reaches Sweep Output into a table: the design with a column per result. **Inputs** | Name | Type | Description | |---|---|---| | `design` | `Any` | A table of parameter sets, e.g. from Grid Design | **Outputs** | Name | Type | Description | |---|---|---| | `results` | `Any` | | | `iterations` | `int` | | ## Math (node-core.compare)= ### Compare `core.compare` Compare two numbers. **Inputs** | Name | Type | Description | |---|---|---| | `a` | `float` | Default `0.0`. | | `b` | `float` | Default `0.0`. | | `operation` | `Literal['less', 'less or equal', 'greater', 'greater or equal', 'equal']` | Default `'less'`. | | `epsilon` | `float` | Default `1e-06`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `bool` | | (node-core.map_range)= ### Map Range `core.map_range` Linearly remap a value from one range to another. **Inputs** | Name | Type | Description | |---|---|---| | `value` | `float` | Default `0.5`. | | `from_min` | `float` | Default `0.0`. | | `from_max` | `float` | Default `1.0`. | | `to_min` | `float` | Default `0.0`. | | `to_max` | `float` | Default `1.0`. | | `clamp` | `bool` | Default `True`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `float` | | (node-core.math)= ### Math `core.math` Scalar math. Unary operations ignore B. **Inputs** | Name | Type | Description | |---|---|---| | `operation` | `Literal['add', 'subtract', 'multiply', 'divide', 'power', 'minimum', 'maximum', 'modulo', 'sqrt', 'absolute', 'exponent', 'log', 'sine', 'cosine', 'tangent', 'round']` | Default `'add'`. | | `a` | `float` | Default `0.0`. | | `b` | `float` | Default `0.0`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `float` | | (node-core.value_class)= ### Value To Class `core.value_class` The label of the class a number falls in, e.g. a vibration velocity into ISO zones A–D or a concentration into "below / above the limit". A value equal to a break goes into the upper class. **Inputs** | Name | Type | Description | |---|---|---| | `value` | `float` | Default `0.0`. | | `breaks` | `str` | Ascending class boundaries: 1.4, 2.8, 4.5 Default `'0'`. | | `labels` | `str` | One more label than breaks Default `'low, high'`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `str` | | ## Output (node-core.save_text_file)= ### Save Text File `core.save_text_file` Write text into this run's output folder. **Inputs** | Name | Type | Description | |---|---|---| | `content` | `str` | | | `filename` | `str` | Default `'output.txt'`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `Path` | | ## Text (node-core.format_text)= ### Format Text `core.format_text` Python str.format with a single `value`, e.g. "{value:.3f} mm". Fields are names only: {value.attr} and {value[0]} are refused. **Inputs** | Name | Type | Description | |---|---|---| | `template` | `str` | Default `'Result: {value}'`. | | `value` | `Any` | Optional. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `str` | | (node-core.format_values)= ### Format Values `core.format_values` Text with up to eight computed values, for report paragraphs: "The slope is {a:.3f} ± {b:.2g} (R² = {c:.4f})". Quantities take Pint's format codes too: {a:.2f~P} gives "9.81 m/s²". Fields are names only: {a.attr} and {a[0]} are refused. **Inputs** | Name | Type | Description | |---|---|---| | `template` | `str` | Python format string with {a} … {h}, e.g. {a:.3f} Default `'{a} and {b}'`. | | `a` | `Any` | Optional. | | `b` | `Any` | Optional. | | `c` | `Any` | Optional. | | `d` | `Any` | Optional. | | `e` | `Any` | Optional. | | `f` | `Any` | Optional. | | `g` | `Any` | Optional. | | `h` | `Any` | Optional. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `str` | | (node-core.join_text)= ### Join Text `core.join_text` Join two pieces of text. **Inputs** | Name | Type | Description | |---|---|---| | `a` | `str` | Default `''`. | | `b` | `str` | Default `''`. | | `separator` | `str` | Default `' '`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `str` | | ## Utility (node-core.describe_data)= ### Describe Data `core.describe_data` Say what a value is and where it came from: a title, a description, its sources (files, instruments, URLs), licence, citations and quality notes. The value passes through unchanged; what you write travels with it and everything computed from it, into the inspector and to Add Data Sources in reports. **Inputs** | Name | Type | Description | |---|---|---| | `value` | `Any` | | | `title` | `str` | Default `''`. | | `description` | `str` | Default `''`. | | `source` | `str` | One per line Default `''`. | | `licence` | `str` | Default `''`. | | `citation` | `str` | One per line Default `''`. | | `flags` | `str` | Quality notes, one per line Default `''`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `Any` | | (node-core.viewer)= ### Viewer `core.viewer` Pass a value through unchanged. Select the node to inspect it in full. **Inputs** | Name | Type | Description | |---|---|---| | `value` | `Any` | Optional. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `Any` | |