From ef09fa13c7edc565f73730260abc801952e38b86 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Mon, 5 Feb 2024 14:42:04 -0500 Subject: [PATCH] Add release notes for 1.2.1 (#729) * Add release notes for 1.2.1 * Update CI * Improve doc on deprecations * Update wording * Add line to changelog --- .github/workflows/main.yml | 6 ++---- cmdstanpy/model.py | 27 +++++++++++++++++++-------- docsrc/changes.rst | 12 ++++++++++++ 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f86030f..ecc253f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: | diff --git a/cmdstanpy/model.py b/cmdstanpy/model.py index 3ec13b90..17be3b5e 100644 --- a/cmdstanpy/model.py +++ b/cmdstanpy/model.py @@ -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. @@ -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. @@ -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__( @@ -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 @@ -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. diff --git a/docsrc/changes.rst b/docsrc/changes.rst index 10242d81..cd179060 100644 --- a/docsrc/changes.rst +++ b/docsrc/changes.rst @@ -7,6 +7,18 @@ What's New For full changes, see the `Releases page `_ 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**