stan-dev / cmdstanpy

CmdStanPy is a lightweight interface to Stan for Python users which provides the necessary objects and functions to compile a Stan program and fit the model to data using CmdStan.
BSD 3-Clause "New" or "Revised" License
149 stars 67 forks source link

Compile flag deprecation presents problems for reformatting code #739

Closed bamarco closed 3 months ago

bamarco commented 3 months ago

Summary:

Deprecating the compile flag in the CmdStanModel constructor will make reformatting code impossible unless proper precautions are taken.

Description:

There is an upcoming deprecation for the compile flag in the CmdStanModel(compile=...) constructor. If you are unable to set compile=False you will be unable to reformat deprecated code before an error is thrown. Just wanted to make sure whoever is updating the constructor makes sure to at least provide a stand alone function for reformatting code.

cmdstanpy - WARNING - CmdStanModel(compile=...) is deprecated and will be removed in the next major version. The constructor will always ensure a model has a compiled executable.
If you wish to force recompilation, use force_compile=True instead.

Additional Information:

Current Version:

Please include the output of import cmdstanpy; cmdstanpy.show_versions(), or at least the cmdstan and cmdstanpy versions used. cmdstanpy version 1.2.1

WardBrian commented 3 months ago

This will be moved to a function independent of the CmdStanModel object, like compilation itself has already been. Good catch though, we might want to do this as a 1.2.2 or something before the jump to 2.x