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