@@ -13,15 +13,24 @@ Tools will sit under the following categories: Results Analysis, Model Build, Mo
13
13
14
14
These tools act as standalone scripts. To run them, please read the available documentation for each tool.
15
15
16
- .. _ fmapi_toolbox_cli :
16
+ .. _ fmapi_toolbox :
17
17
18
- fmapi-toolbox cli
19
- -----------------
18
+ fmapi-toolbox
19
+ -------------
20
20
21
- .. _how_to_run_a_tool :
21
+ A tool to use in the command line to interact with all the API toolbox scripts.
22
+
23
+ You can use these command line arguements:
24
+
25
+ - *-l * or *-list * : list all toolbox scripts installed
26
+ - *-ld * or *-list-detailed * : list all toolbox scripts installed including usage
27
+ - *-r * or *-register * : register a new tool to the fmapi-toolbox
28
+
29
+ .. _run_a_tool :
30
+
31
+ Run a tool
32
+ ----------
22
33
23
- How to run a tool
24
- -----------------
25
34
Tools can be run from the command line or from code:
26
35
27
36
.. note ::
@@ -43,33 +52,48 @@ Tools can be run from the command line or from code:
43
52
name = " model_name" ,
44
53
)
45
54
46
- .. _how_edit_existing_tool :
55
+ .. _edit_existing_tool :
56
+
57
+ Edit an existing tool
58
+ ---------------------
47
59
48
- How to edit an existing tool
49
- ----------------------------
60
+ You can edit previously existing tools for the Flood Modeller API.
50
61
51
- .. _ how_to_add_a_new_tool :
62
+ Go to the scripts folder and select the tool you want to edit, then change what you want to.
52
63
53
- How to add a new tool
54
- ---------------------
64
+ .. _add_a_new_tool :
65
+
66
+ Add a new tool
67
+ --------------
55
68
56
69
You can develop your own tools to integrate with the Flood Modeller Python API.
57
70
58
71
There are a few conventions you need to follow to do this:
59
72
60
- - Add a python file to one of the directories in the toolbox
61
- - Within the file, define the tool as single function
73
+ - Add a python file to one of the directories in the toolbox, depending on the category of the tool
74
+ - Within the file, define the tool as a single function (add a definition file)
62
75
- Within the same file, create a child class of FMTool, passing in the tool name and description, funciton to be run and the function parameters
76
+ - Register the file as a script
77
+
78
+ See the *example_tool.py * script in the toolbox for an example of how to do this.
79
+
80
+ .. _add_new_execution_method :
63
81
64
- See the *example_tool.py * script for an example of how to do this.
82
+ Add a new execution method
83
+ --------------------------
65
84
66
- ** Create the code **
85
+ You can add command-line execution for a tool by having its * .py * and * .bat * scripts in the * scripts * folder.
67
86
68
- ** Add a definition file **
87
+ .. code :: python
69
88
70
- **Register it as a script **
89
+ example.py
90
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91
+ from floodmodeller_api.toolbox import Example
92
+ Example().run_from_command_line()
71
93
72
- .. _ how_to_add_new_execution_method :
94
+ .. code :: console
73
95
74
- How to add a new execution method
75
- ---------------------------------
96
+ example.bat
97
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98
+ @echo off
99
+ python "%~dp0\example.py" %*
0 commit comments