Skip to content

Commit f5c8506

Browse files
committed
documenting model constructor compile arg
1 parent fa99ff3 commit f5c8506

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

docsrc/workflow.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ Compile the Stan model
4242
The: :class:`CmdStanModel` class provides methods
4343
to compile and run the Stan program.
4444
A CmdStanModel object can be instantiated by specifying
45-
either a Stan file or the executable file.
45+
either a Stan file or the executable file, or both.
46+
If only the Stan file path is specified, the constructor will
47+
check for the existence of a correspondingly named exe file in
48+
the same directory. If found, it will use this as the exe file path.
4649

4750
By default, when a CmdStanModel object is instantiated from a Stan file,
48-
CmdStanPy will automatically compile the model if:
51+
the constructor will compile the model as needed.
52+
The constructor argument `compile` controls this behavior.
4953

50-
- CmdStanPy cannot find a corresponding executable file in the same directory, or
51-
- The timestamp on the executable is older than the Stan file.
52-
53-
The argument `compile` controls this behavoir.
54-
When ``False`` the model object doesn't try to compile the Stan file.
55-
When ``True`` the model compiles the Stan file only if the timestamp is older than the Stan file.
56-
When ``Force`` the model always compiles or recompiles the mode.
54+
* ``compile=False``: never compile the Stan file.
55+
* ``compile=Force``: always compile the Stan file.
56+
* ``compile=True``: (default) compile the Stan file as needed, i.e., if no exe file exists or if the Stan file is newer than the exe file.
5757

5858
.. code-block:: python
5959
@@ -67,6 +67,9 @@ When ``Force`` the model always compiles or recompiles the mode.
6767
my_model.exe_file
6868
my_model.code()
6969
70+
The CmdStanModel class also provides the :meth:`~CmdStanModel.compile` method,
71+
which can be called at any point to (re)compile the model as needed.
72+
7073
Model compilation is carried out via the GNU Make build tool.
7174
The CmdStan ``makefile`` contains a set of general rules which
7275
specify the dependencies between the Stan program and the

0 commit comments

Comments
 (0)