Changeset 44:10d33af464cf

Show
Ignore:
Timestamp:
10/05/09 13:31:04 (4 years ago)
Author:
Andrew Davison <andrew.davison@…>
Branch:
default
Message:

Minor documentation changes

Location:
doc
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • doc/build_reference.py

    r37 r44  
    22from sumatra import commands 
    33 
    4 modes = ("init", "configure", "info", "run", "list", "delete", "comment", "tag", "repeat") 
     4modes = ["init", "configure", "info", "run", "list", "delete", "comment", "tag", "repeat"] 
    55modes.sort() 
    66 
     
    2626f.write("=====================\n\n") 
    2727 
    28 for mode, sio in usage.items(): 
     28for mode in modes: 
     29    sio = usage[mode] 
    2930    f.write(mode + '\n') 
    3031    f.write('-'*len(mode) + '\n::\n\n    ') 
  • doc/using_the_api.txt

    r42 r44  
    6464the parameters for later use in searching and comparison, so they need to be 
    6565transformed into a form Sumatra can use. This is very simple, we just replace 
    66 the ``execfile()`` call with a ``build_parameters()`` call. 
     66the ``execfile()`` call with a ``build_parameters()`` call:: 
    6767 
    6868    from sumatra.parameters import build_parameters 
    6969    parameters = build_parameters(parameter_file) 
    7070     
    71 Now we create a new ``SimRecord`` object, telling it which script and executable 
    72 to use (these are obviously inferable, but in the current version of Sumatra 
    73 we have to specify them explicitly):: 
     71Now we create a new ``SimRecord`` object, telling it that the script is the 
     72current file:: 
    7473 
    75     from sumatra.programs import Script, get_executable 
    76     simulator = get_executable('python') 
     74    from sumatra.programs import Script 
    7775    script = Script(main_file=__file__) 
    7876    script.update_code() 
    7977     
    8078    sim_record = project.new_record(parameters=parameters, 
    81                                     executable=simulator, 
    8279                                    script=script, 
    8380                                    label="api_example", 
     
    8582 
    8683Now comes the main body of the simulation, which is unchanged except that we 
    87 take the opportunity to give the output data file a more informative name: 
     84take the opportunity to give the output data file a more informative name:: 
    8885 
    8986    output_file = "%s.dat" % sim_record.label 
     
    106103    import time 
    107104    from sumatra.projects import load_simulation_project 
    108     from sumatra.programs import Script, get_executable 
     105    from sumatra.programs import Script 
    109106    from sumatra.parameters import build_parameters 
    110107 
     
    115112    parameters = build_parameters(parameter_file) 
    116113 
    117     simulator = get_executable('python') 
    118114    script = Script(main_file=__file__) 
    119115    script.update_code() 
    120116     
    121117    sim_record = project.new_record(parameters=parameters, 
    122                                     executable=simulator, 
    123118                                    script=script, 
    124119                                    label="api_example", 
  • doc/using_the_api_example.py

    r42 r44  
    33import time 
    44from sumatra.projects import load_simulation_project 
    5 from sumatra.programs import Script, get_executable 
     5from sumatra.programs import Script 
    66from sumatra.parameters import build_parameters 
    77 
     
    1212parameters = build_parameters(parameter_file) 
    1313 
    14 simulator = get_executable('python') 
    1514script = Script(main_file=__file__) 
    1615script.update_code() 
    1716     
    1817sim_record = project.new_record(parameters=parameters, 
    19                                 executable=simulator, 
    2018                                script=script, 
    2119                                label="api_example",