Changeset e7ad08 for doc


Ignore:
Timestamp:
Apr 11, 2018, 6:30:10 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.6.1, ChemicalSpaceEvaluator, PythonUI_with_named_parameters, TremoloParser_IncreasedPrecision
Children:
cd91bd
Parents:
8819d2
git-author:
Frederik Heber <frederik.heber@…> (09/06/17 12:58:47)
git-committer:
Frederik Heber <frederik.heber@…> (04/11/18 06:30:10)
Message:

Python interface now converts dashes in tokens to underscores, store-session used keyword arguments.

  • MoleCuilder's python functions (i.e. commands) typically have quite a number of arguments and therefore can be easily confused. We circumvent this by using keyword (or named) arguments that are also independent of position. Moreover, in that case only the non-default arguments need to be given.
  • TESTS: Marked failing python tests as XFAIL for the moment.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/userguide/userguide.xml

    r8819d2 re7ad08  
    26102610          the python interface described below, i.e. it is a full python script
    26112611          (that however requires the so-called <emphasis role="italic">pyMoleCuilder</emphasis> module).</para>
     2612          <note>The python session will store a file with python commands using named arguments. As some actions have quite
     2613          a number of arguments, all of them end up in a single function call. This makes it very hazard-prone to mix them up.
     2614          Therefore, it is <emphasis>strongly</emphasis> recommended to always use named arguments in python scripts
     2615          when employing MoleCuilder commands.</note>
     2616          <para>When using named arguments for MoleCuilder commands in Python scripts, remember that dashes ("-") in
     2617          argument names have been converted to underscores ("_") as the former characters are illegal. Apart from that
     2618          the argument names resemble exactly the token names as encountered on the command line, e.g.
     2619          <programlisting>
     2620          pyMoleCuilder.CommandVerbose(verbose="1")
     2621          ...
     2622          </programlisting>
     2623          where the keyword argument "verbose" is for the Action that changes MoleCuilder's output verbosity. Also,
     2624          you see that arguments are always given as string.
     2625          </para>
    26122626        </section>
    26132627        <section xml:id="sessions.load-session">
     
    29993013      <para>Therefore, more complex python scripts need to be called with
    30003014      python and a set PYTHONPATH as described above.</para>
     3015          <note>It is <emphasis>strongly</emphasis> recommended to always use named arguments in python scripts
     3016          when employing MoleCuilder commands. As commands tend to have many arguments, it is very easy to mix
     3017          them up as python is not a strongly typed language.</note>
    30013018    </section>
    30023019  </chapter>
Note: See TracChangeset for help on using the changeset viewer.