All Plugin Functions
All the functions available on this instance of nadi, are listed here.
Env Functions
Plugin | Function | Help |
---|---|---|
core | int | make an int from the value |
debug | clip | Echo the ----8<---- line for clipping syntax |
attributes | log | Logarithm of a value, natural if base not given |
regex | str_split | Split the string with the given pattern |
core | type_name | Type name of the arguments |
core | min_num | Minimum of the variables |
core | count | Count the number of true values in the array |
core | range | Generate integer array, end is not included |
core | assert_eq | Assert the two values are equal |
debug | debug | Print the args and kwargs on this function |
logic | gt | Greater than check |
connections | root_node | default name used for ROOT node of the network |
core | day | day from date/datetime |
core | unique_str | Get a list of unique string values |
attributes | sqrt | Square Root |
attributes | float_mult | Float Multiplication (same as * operator) |
logic | ifelse | Simple if else condition |
regex | str_replace | Replace the occurances of the given match |
core | max_num | Minimum of the variables |
core | json | format the attribute as a json string |
core | year | year from date/datetime |
attributes | powi | Integer power |
core | isinf | check if a float is +/- infinity |
core | str | make a string from value |
regex | str_find | Find the given pattern in the value |
dss | list_catalog | List the catalog of the dss file |
core | float | make a float from value |
core | attrmap | make an attrmap from the arguments |
attributes | strmap | map values from the attribute based on the given table |
files | from_file | Reads the file contents as string |
logic | or | boolean or |
core | sum | Sum of the variables |
attributes | float_div | Float Division (same as / operator) |
attributes | parse_attr | Parse attribute from string |
core | month | month from date/datetime |
logic | eq | Equality than check |
core | isna | check if a float is nan |
core | min | Minimum of the variables |
core | prod | Product of the variables |
logic | lt | Less than check |
debug | echo | Echo the string to stdout or stderr |
render | render | Render the template based on the node attributes |
logic | not | boolean not |
files | exists | Checks if the given path exists |
regex | str_match | Check if the given pattern matches the value or not |
core | append | append a value to an array |
attributes | powf | Float power |
regex | str_find_all | Find all the matches of the given pattern in the value |
files | to_file | Writes the string to the file |
core | assert_neq | Assert the two values are not equal |
debug | sleep | sleep for given number of milliseconds |
regex | str_filter | Filter from the string list with only the values matching pattern |
attributes | exp | Exponential |
core | max | Maximum of the variables |
core | concat | Concat the strings |
core | array | make an array from the arguments |
logic | all | check if all of the bool are true |
regex | str_count | Count the number of matches of given pattern in the string |
attributes | get | get the choosen attribute from Array or AttrMap |
nadi_pdf | typst_compile | convert the typst content into pdf/svg/png |
core | assert | Assert the condition is true |
core | count_str | Get a count of unique string values |
logic | any | check if any of the bool are true |
attributes | parse_attrmap | Parse attribute map from string |
logic | and | Boolean and |
core | length | length of an array or hashmap |
Node Functions
Plugin | Function | Help |
---|---|---|
timeseries | ts_list | List all timeseries in the node |
timeseries | ts_dtype | Type name of the timeseries |
attributes | set_attrs_ifelse | if else condition with multiple attributes |
series | set_series | set the following series to the node |
series | sr_to_array | Make an array from the series |
core | inputs_count | Count the number of input nodes in the node |
series | sr_mean | Type name of the series |
render | render | Render the template based on the node attributes |
files | exists | Checks if the given path exists when rendering the template |
series | sr_sum | Sum of the series |
errors | calc_ts_error | Calculate Error from two timeseries values in the node |
core | output_attr | Get attributes of the output node |
attributes | print_all_attrs | Print all attrs in a node |
dams | count_node_if | Count the number of nodes upstream at each point that satisfies a certain condition |
dams | min_year | Propagate the minimum year downstream |
attributes | print_attrs | Print the given node attributes if present |
command | command | Run the given template as a shell command. |
series | sr_dtype | Type name of the series |
streamflow | check_negative | Check the given streamflow timeseries for negative values |
attributes | set_attrs | Set node attributes |
timeseries | ts_count | Number of timeseries in the node |
timeseries | ts_len | Length of the timeseries |
attributes | load_toml_render | Set node attributes by loading a toml from rendered template |
errors | calc_ts_errors | Calculate Error from two timeseries values in the node |
attributes | has_attr | Check if the attribute is present |
attributes | first_attr | Return the first Attribute that exists |
timeseries | ts_print | Print the given timeseries values in csv format |
print_node | print_node | Print the node with its inputs and outputs |
core | has_outlet | Node has an outlet or not |
core | inputs_attr | Get attributes of the input nodes |
attributes | get_attr | Retrive attribute |
datafill | load_csv_fill | |
series | sr_list | List all series in the node |
series | sr_len | Length of the series |
command | run | Run the node as if it’s a command if inputs are changed |
datafill | datafill_experiment | |
attributes | load_attrs | Loads attrs from file for all nodes based on the given template |
series | sr_count | Number of series in the node |
attributes | set_attrs_render | Set node attributes based on string templates |
Network Functions
Plugin | Function | Help |
---|---|---|
connections | load_file | Load the given file into the network |
table | table_to_markdown | Render the Table as a rendered markdown |
timeseries | series_csv | Write the given nodes to csv with given attributes and series |
graphviz | save_graphviz | Save the network as a graphviz file |
core | node_attr | Get the attr of the provided node |
print_node | print_attr_csv | Print the given attributes in csv format with first column with node name |
command | command | Run the given template as a shell command. |
connections | subset_largest | Take a subset of network by only including the largest blob of connected nodes |
render | render_template | Render a File template for the nodes in the whole network |
gis | gis_load_network | Load network from a GIS file |
attributes | set_attrs_render | Set network attributes based on string templates |
connections | subset | Take a subset of network by only including the selected nodes |
errors | calc_attr_error | Calculate Error from two attribute values in the network |
timeseries | ts_print_csv | Save timeseries from all nodes into a single csv file |
datafill | save_experiments_csv | Write the given nodes to csv with given attributes and experiment results |
nadi_pdf | typst_table | Generate Typst code for given Table |
connections | save_file | Save the network into the given file |
render | render_nodes | Render each node of the network and combine to same variable |
fancy_print | fancy_print | Fancy print a network |
gis | gis_save_nodes | Save GIS file of the nodes |
connections | load_edges | Load the given edges as a network |
html | export_map | Exports the network as a HTML map |
gis | gis_save_connections | Save GIS file of the connections |
attributes | set_attrs | Set network attributes |
gnuplot | plot_timeseries | Generate a gnuplot file that plots the timeseries data in the network |
core | outlet | Get the name of the outlet node |
table | save_csv | Save CSV |
visuals | set_nodesize_attrs | Set the node size of the nodes based on the attribute value |
core | count | Count the number of nodes in the network |
render | render | Render from network attributes |
gis | gis_load_attrs | Load node attributes from a GIS file |
connections | load_str | Load network from the given string |
visuals | svg_save | Exports the network as a svg |
command | parallel | Run the given template as a shell command for each nodes in the network in parallel. |
connections | subset_from | Take a subset of network by taking the given node as new outlet |