Skip to content
Isaac Overcast edited this page Nov 1, 2015 · 2 revisions

Adding a parameter to assembly objects

You need to modify a couple different lines to properly add a parameter to an assembly object.

  1. The ''paramsdict'' is an OrderedDict that is declared and initialized in the Assembly class constructor at the top of the assembly.py file. Since this is an OrderedDict you may only add parameters to the end of this list, else other stuff will get all screwed up. In order to add a parameter you have to define a name and a sensible default in this format: ("name_of_param", "default_val")

  2. Next you need to add docs for your new parameter to paramsinfo.py, again paramsinfo is an ordered dict so only add to the end. There's a nice template for adding new docs so stick to this for consistency:

     ("13", """
     (13) prefix_outname --------------------------------------------------
    
     ----------------------------------------------------------------------
     data.setparams(13) = test          ## set a name
     data.setparams(13) = c85d4m8p4     ## set a name of parameters values
     data.setparams("prefix_outname") = c85d4m8p4   ## verbose
     ---------------------------------------------------------------------- 
     """),
    
  3. Finally you need to add a new elif to the set_params() function to actually pull in your new parameters.

  4. NB: If you build and install a new version you need to completely cycle your notebook to get it to read the new library.

Clone this wiki locally