Skip to content

Commit 0f9d767

Browse files
committed
Update compile='force' logic
1 parent fa99ff3 commit 0f9d767

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

cmdstanpy/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def __init__(
210210
get_logger().debug("TBB already found in load path")
211211

212212
if compile and self._exe_file is None:
213-
self.compile(force=compile == 'force')
213+
self.compile(force=str(compile).lower() == 'force')
214214
if self._exe_file is None:
215215
raise ValueError(
216216
'Unable to compile Stan model file: {}.'.format(

docsrc/workflow.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ CmdStanPy will automatically compile the model if:
5353
The argument `compile` controls this behavoir.
5454
When ``False`` the model object doesn't try to compile the Stan file.
5555
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.
56+
When ``"force"`` the model always (re)compiles.
5757

5858
.. code-block:: python
5959
@@ -123,7 +123,7 @@ numpy arrays or pandas.Series.
123123
Run the CmdStan inference engine
124124
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125125

126-
For each CmdStan inference method, there is a corresponding method on the :class:`CmdStanModel` class.
126+
For each CmdStan inference method, there is a corresponding method on the :class:`CmdStanModel` class.
127127
An example of each is provided in the `next section <examples.rst>`__
128128

129129
* The :meth:`~CmdStanModel.sample` method runs Stan's
@@ -133,14 +133,14 @@ An example of each is provided in the `next section <examples.rst>`__
133133
a sample from the posterior distribution of the model conditioned on the data.
134134

135135
* The :meth:`~CmdStanModel.variational` method runs Stan's
136-
`Automatic Differentiation Variational Inference (ADVI) algorithm <https://mc-stan.org/docs/reference-manual/vi-algorithms-chapter.html>`_.
136+
`Automatic Differentiation Variational Inference (ADVI) algorithm <https://mc-stan.org/docs/reference-manual/vi-algorithms-chapter.html>`_.
137137

138138
It returns a :class:`CmdStanVB` object which contains
139139
an approximation the posterior distribution in the unconstrained variable space.
140140

141141
* The :meth:`~CmdStanModel.optimize` runs one of
142142
`Stan's optimization algorithms <https://mc-stan.org/docs/reference-manual/optimization-algorithms-chapter.html>`_
143-
to find a mode of the density specified by the Stan program.
143+
to find a mode of the density specified by the Stan program.
144144

145145
It returns a :class:`CmdStanMLE` object.
146146

@@ -151,16 +151,16 @@ An example of each is provided in the `next section <examples.rst>`__
151151

152152
It returns a :class:`CmdStanGQ` object.
153153

154-
154+
155155
Validate, view, export the inference engine outputs
156156
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157157

158-
The inference engine results objects
158+
The inference engine results objects
159159
:class:`CmdStanMCMC`, :class:`CmdStanVB`, :class:`CmdStanMLE` and :class:`CmdStanGQ,`
160160
contain the CmdStan method configuration information
161161
and the location of all output files produced.
162162
The provide a common set methods for accessing the inference results and metadata,
163-
as well as method-specific informational properties and methods.objects
163+
as well as method-specific informational properties and methods.objects
164164

165165
Metadata
166166
--------
@@ -188,14 +188,14 @@ the object's :attr:`~CmdStanMCMC.metadata` property.
188188
property specifies the names, dimensions of the Stan model variables.
189189

190190
Output data
191-
-----------
191+
-----------
192192

193193
The CSV data is assembled into the inference result object.
194194
CmdStanPy provides accessor methods which return this information
195195
either as columnar data (i.e., in terms of the CSV file columns),
196196
or as method and model variables.
197197

198-
The :meth:`~CmdStanMCMC.draws` and :meth:`~CmdStanMCMC.draws_pd` methods
198+
The :meth:`~CmdStanMCMC.draws` and :meth:`~CmdStanMCMC.draws_pd` methods
199199
for both :class:`CmdStanMCMC` and :class:`CmdStanGQ` return the sample contents
200200
in columnar format, as a numpy.ndarray or pandas.DataFrame, respectively. Similarly,
201201
the :meth:`~CmdStanMCMC.draws_xr` method of these two objects returns the sample

0 commit comments

Comments
 (0)