From b314c09eec9eae2f0aedbd104b2cda588134d94f Mon Sep 17 00:00:00 2001 From: Scott Fennell Date: Wed, 1 Jun 2022 14:11:48 -0500 Subject: [PATCH] Tutorial suggestions (#1274) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Data-Record.md (#1265) Fix typo in input arg string. * Update TutVariableServer.md (#1269) tightened up grammar * Update TutVariableServer.md (#1270) more accurate usage hint * Update ATutNumericSim.md (#1271) instanciate -> instantiate line 376 * Update TutVariableServer.md (#1272) fixed :warning: (⚠️) not displaying properly * Update ATutNumericSim.md (#1273) fixed :point_right: (👉) not displaying properly Co-authored-by: Brian Co-authored-by: Matthew D Elmer --- .../simulation_capabilities/Data-Record.md | 16 ++++++++-------- docs/tutorial/ATutNumericSim.md | 6 +++--- docs/tutorial/TutVariableServer.md | 11 +++++------ 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/docs/documentation/simulation_capabilities/Data-Record.md b/docs/documentation/simulation_capabilities/Data-Record.md index 999321af..df0a6fc8 100644 --- a/docs/documentation/simulation_capabilities/Data-Record.md +++ b/docs/documentation/simulation_capabilities/Data-Record.md @@ -36,7 +36,7 @@ Note: drg is just an example name. Any name may be used. ### Adding a Variable To Be Recorded -To add variables to the recording group call the drg.add_variable(") method of the recording group. +To add variables to the recording group call the drg.add_variable("") method of the recording group. For example: ```python @@ -44,7 +44,7 @@ drg.add_variable("ball.obj.state.output.position[0]") drg.add_variable("ball.obj.state.output.position[1]") ``` -An optional alias may also be specified in the method as drg.add_variable(" [, ""]). +An optional alias may also be specified in the method as drg.add_variable("" [, ""]). If an alias is present as a second argument, the alias name will be used in the data recording file instead of the actual variable name. For example: @@ -121,18 +121,18 @@ recording groups as well as record a single point of data. ```c++ /* C code */ -dr_enable_group(") ; -dr_disable_group(") ; -dr_record_now_group(") ; +dr_enable_group("") ; +dr_disable_group("") ; +dr_record_now_group("") ; ``` This is the Python input file version: ```python # Python code -trick.dr_enable_group(") ; # same as .enable() -trick.dr_disable_group(") ; # same as .disable() -trick.dr_record_now_group(") ; +trick.dr_enable_group("") ; # same as .enable() +trick.dr_disable_group("") ; # same as .disable() +trick.dr_record_now_group("") ; ``` ### Changing the thread Data Recording runs on. diff --git a/docs/tutorial/ATutNumericSim.md b/docs/tutorial/ATutNumericSim.md index 90e3b737..89ae0253 100644 --- a/docs/tutorial/ATutNumericSim.md +++ b/docs/tutorial/ATutNumericSim.md @@ -264,7 +264,7 @@ int cannon_deriv(CANNON* C) { return(0); } ``` -:point_right: **Add cannon\_deriv() to cannon\_numeric.c.** +👉 **Add cannon\_deriv() to cannon\_numeric.c.** #### Creating an Integration Class Job @@ -320,7 +320,7 @@ int cannon_integ(CANNON* C) { ``` -:point_right: **Add cannon\_integ() to cannon\_numeric.c.** +👉 **Add cannon\_integ() to cannon\_numeric.c.** ## Updating the S_define File @@ -373,7 +373,7 @@ void create_connections() { The first line here defines an integration scheduler called `dyn_integloop` that executes `derivative` and `integration` jobs in the *dyn* SimObject. The integration rate is specified in parentheses. -`create_connections` is a special function-like construct whose code is copied into S_source.cpp and is executed directly after SimObject instantiations. Common uses are to 1) instanciate integrators, and 2) connect data structures between SimObjects. +`create_connections` is a special function-like construct whose code is copied into S_source.cpp and is executed directly after SimObject instantiations. Common uses are to 1) instantiate integrators, and 2) connect data structures between SimObjects. `dyn_integloop.getIntegrator` configures our integration scheduler. Its first argument specifies the integration algorithm to be used. In the case `Runge_Kutta_4`. The second argument is the number of variables that are to be integrated. There are four variables for this simulation (pos[0], pos[1], vel[0], vel[1]). diff --git a/docs/tutorial/TutVariableServer.md b/docs/tutorial/TutVariableServer.md index f7d22f63..98c016bb 100644 --- a/docs/tutorial/TutVariableServer.md +++ b/docs/tutorial/TutVariableServer.md @@ -64,10 +64,9 @@ is to configure the sessions. ## Approach -Calling functions and setting simulation variables using the variable server is -done as in the input file. That is, the client sends Python code to the variable -server where it's executed, to call functions, set variables, or both. In the -following sections we'll see examples of these. We'll also learn how to use the +Calling functions and setting simulation variables with the variable server client is a similar process to doing the same with the input file. The client sends Python code to the variable +server, where it's executed to call functions, set variables, or both. In the +following sections, we'll see examples of these. We'll also learn how to use the variable server API to get data back to the client. @@ -89,7 +88,7 @@ import socket if ( len(sys.argv) == 2) : trick_varserver_port = int(sys.argv[1]) else : - print( "Usage: vsclient ") + print( "Usage: python CannonDisplay_Rev1.py ") sys.exit() # 2.0 Connect to the variable server. @@ -178,7 +177,7 @@ send messages using an ASCII encoding (rather than binary). The two [**var_add**](#api-var-add) commands add "dyn.cannon.pos[0]" and "dyn.cannon.pos[1]" to the session variable list. -:warning: Please notice that the quotes around the variable names must be +⚠️ Please notice that the quotes around the variable names must be escaped with the '\' (backslash) character. ```