cmdstanpy icon indicating copy to clipboard operation
cmdstanpy copied to clipboard

Breaking change: Disallow CmdStanModel without executable

Open WardBrian opened this issue 2 years ago • 0 comments

Summary:

As discussed in #689.

The current behavior when exe_file=None, compile=False yields a broken object - essentially all methods other than compile() cannot be called until after compile() is called.

I think it should be factored such that:

cmdstanpy.compile(stan_file, force=False, stanc_args={}, cmdstan_args={}) -> str is a function outside of any class which invokes make as requested.

And the constructor looks like CmdStanMLE(stan_file=None, exe_file=None, force_compile=False, stanc_args={}, cmdstan_args={})

This raises an error if:

  • stan_file and exe_file are both None, or
  • force_compile is True but stanc_file was None

Otherwise, it will always be the case that when the constructor is finished, we have an executable ready for use (either because the user supplied one, or because we compiled it)

This would be a 2.0 change

WardBrian avatar Sep 07 '23 20:09 WardBrian