----------------------------------------------- lines 17-149 of file: devel/cmd/set_command.cpp ----------------------------------------------- {xrst_begin set_command} Directly Setting Table Values ############################# Syntax ****** {xrst_comment Only the first syntax below is implemented in this file. The rest are implemented in the dismod_at main program. } | ``dismod_at`` *database* ``set`` ``option`` *name* *value* | ``dismod_at`` *database* ``set`` ``avgint`` ``data`` | ``dismod_at`` *database* ``set`` *table_out* *source* | ``dismod_at`` *database* ``set`` *table_out* *source* *sample_index* database ******** Is an `sqlite `_ database containing the ``dismod_at`` :ref:`input-name` tables which are not modified. option ****** This documentation is for the case where ``option`` follows ``set`` . name ==== Is the name of the option we are setting. It must be a valid :ref:`option_table@Table Format@option_name` . value ===== Is the new :ref:`option_table@Table Format@option_value` for the specified option name. If *value* is the empty string, null is used for the corresponding value in the database; see :ref:`database@Null@Text can be Null, not Empty` . init ==== The set option commands does not require the ``init`` to be run first. In addition, if *option_name* is not ``parent_node_id`` , the :ref:`model_variables-name` do not change and you do not have to re-run the :ref:`init_command-name` . avgint ****** This documentation is for the case where ``avgint`` follows ``set`` . In this case ``data`` must follow ``avgint`` and the :ref:`avgint_table-name` is set to be equal to the :ref:`data_table-name` . The only difference is that the column name :ref:`data_table@data_id` in the data table has column name :ref:`avgint_table@avgint_id` in the avgint table. table_out ********* The *table_out* cases set the values in *table_out* using the values specified by *source* . If this table exists before the command, the values originally in the table are lost. start_var ========= If *table_out* is ``start_var`` , the :ref:`start_var` table is created. Note that this table may also be created directly by the user (with the aid of the :ref:`var_table-name` ). scale_var ========= If *table_out* is ``scale_var`` , the :ref:`scale_var` table is created. Note that this table may also be created directly by the user (with the aid of the :ref:`var_table-name` ). truth_var ========= If *table_out* is ``truth_var`` , the :ref:`truth_var` table is created. Note that this table may also be created directly by the user (with the aid of the :ref:`var_table-name` ). source ****** The set command *source* must be one of the possibilities listed below (and not be the same as *table_out* ). Only the case where *source* is *sample* has the extra argument *sample_index* . sample ====== If *source* is ``sample`` , *sample_index* must be present. In this case the :ref:`model_variables-name` in the sample table, and corresponding to the specified sample index, are used for the values in *table_out* . prior_mean ========== If *source* is ``prior_mean`` , the mean of the priors is used for the values in *table_out* . fit_var ======= If *source* is ``fit_var`` , the results of the previous fit is used for the values in *table_out* . start, scale, truth =================== If *source* is :ref:`start_var` , :ref:`scale_var` , or :ref:`truth_var` , the contents of this table are copied to *table_out* . {xrst_toc_hidden example/get_started/set_command.py } Example ******* The files :ref:`set_command.py-name` and :ref:`set_command.py-name` contains examples and tests using this command. {xrst_end set_command}