Skip to content

Commit

Permalink
Add release notes for 1.2.1 (#729)
Browse files Browse the repository at this point in the history
* Add release notes for 1.2.1

* Update CI

* Improve doc on deprecations

* Update wording

* Add line to changelog
  • Loading branch information
WardBrian authored Feb 5, 2024
1 parent e7e6121 commit ef09fa1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,14 @@ jobs:
run: |
install_cmdstan -h
install_cxx_toolchain -h
python -c "import cmdstanpy; cmdstanpy.install_cmdstan(version='${{ needs.get-cmdstan-version.outputs.version }}', cores=2)"
python -c "import cmdstanpy; cmdstanpy.install_cmdstan(version='${{ needs.get-cmdstan-version.outputs.version }}', cores=4)"
- name: Install CmdStan (Windows)
if: matrix.os == 'windows-latest'
run: |
install_cmdstan -h
install_cxx_toolchain -h
$env:TBB_CXXFLAGS = "-D_UCRT"
python -m cmdstanpy.install_cmdstan --version ${{ needs.get-cmdstan-version.outputs.version }} --cores 2
echo "TBB_CXXFLAGS+=-D_UCRT" >> ~/.cmdstan/cmdstan-${{ needs.get-cmdstan-version.outputs.version }}/make/local
python -m cmdstanpy.install_cmdstan --version ${{ needs.get-cmdstan-version.outputs.version }} --cores 4
- name: Run tests
run: |
Expand Down
27 changes: 19 additions & 8 deletions cmdstanpy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ class CmdStanModel:
"""
The constructor method allows model instantiation given either the
Stan program source file or the compiled executable, or both.
By default, the constructor will compile the Stan program on instantiation
unless the argument ``compile=False`` is specified.
The set of constructor arguments are:
This will compile the model if provided a Stan file and no executable,
:param model_name: Model name, used for output file names.
Optional, default is the base filename of the Stan program file.
Deprecated: In version 2.0.0, model name cannot be
specified and will always be taken from executable.
:param stan_file: Path to Stan program file.
Expand All @@ -94,9 +94,8 @@ class CmdStanModel:
the compiled executable file are specified, the base filenames
must match, (but different directory locations are allowed).
:param compile: Whether or not to compile the model. Default is ``True``.
If set to the string ``"force"``, it will always compile even if
an existing executable is found.
:param force_compile: If ``True``, always compile, even if there
is an existing executable file for this model.
:param stanc_options: Options for stanc compiler, specified as a Python
dictionary containing Stanc3 compiler option name, value pairs.
Expand All @@ -109,6 +108,13 @@ class CmdStanModel:
:param user_header: A path to a header file to include during C++
compilation.
Optional.
:param compile: Whether or not to compile the model. Default is ``True``.
If set to the string ``"force"``, it will always compile even if
an existing executable is found.
Deprecated: Use ``force_compile`` instead. The ability to instantiate
a CmdStanModel without an executable will be removed in version 2.0.0.
"""

def __init__(
Expand All @@ -126,14 +132,16 @@ def __init__(
"""
Initialize object given constructor args.
:param model_name: Model name, used for output file names.
:param model_name: Deprecated. Model name, used for output file names.
:param stan_file: Path to Stan program file.
:param exe_file: Path to compiled executable file.
:param compile: Whether or not to compile the model.
:param force_compile: Whether or not to force recompilation if
executable file already exists.
:param stanc_options: Options for stanc compiler.
:param cpp_options: Options for C++ compiler.
:param user_header: A path to a header file to include during C++
compilation.
:param compile: Deprecated. Whether or not to compile the model.
"""
self._name = ''
self._stan_file = None
Expand Down Expand Up @@ -446,6 +454,9 @@ def compile(
_internal: bool = False,
) -> None:
"""
Deprecated: To compile a model, use the :class:`~cmdstanpy.CmdStanModel`
constructor or :func:`cmdstanpy.compile_stan_file()`.
Compile the given Stan program file. Translates the Stan code to
C++, then calls the C++ compiler.
Expand Down
12 changes: 12 additions & 0 deletions docsrc/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ What's New

For full changes, see the `Releases page <https://github.com/stan-dev/cmdstanpy/releases>`_ on GitHub.

CmdStanPy 1.2.1
---------------

- Switched from :class:`numpy.random.RandomState` to :func:`~numpy.random.default_rng`.
- Fixed minor doc typos.
- Stan 2.34: Fixed parsing of unit_e output files.
- Stan 2.34: Exposed new Pathfinder arguments.
- Allow the ``vars`` argument to :meth:`CmdStanMCMC.draws_pd` to filter the ``chain__``, ``iter__``, and ``draws__`` columns.
- Fixed a bug involving the interaction of the ``adapt_engaged`` and ``iter_warmup`` arguments to :meth:`CmdStanMCMC.sample`.

Reminder: The next non-bugfix release of CmdStanPy will be version 2.0, which will remove all existing deprecations.

CmdStanPy 1.2.0
---------------
- **New functionality**
Expand Down

0 comments on commit ef09fa1

Please sign in to comment.